⌂ YolkfolkThe Dizzy Fansite
Community discussion

collectibles

Started by Meph on 18 March 2012 • 3,666 views

6 posts
#55139
Is there a way i can get Dizzy to NOT pick up a collectible if his already holding 5? I'm using collectibles to remove baddies and blockers (5 each) but if the player has more than 5 it just causes an error. So if i can prevent him of picking up any more once he gets 5 things should work ok.

Unless theres an alternative way round.

ps. All the puzzles are complete, i've just got all the extras to do such as baddies, HUD and stuff like that.
I hope it have ti ready for testing by April. :teethy:
👍 0
#76867
Meph, not sure what you mean. The normal method to restrict the maximum inventory items is to set the Maxinventory line in the gamedef file to '5'. But not sure whether you mean that the max inventory is more than five, and that five specific collectibles affect each baddie/blocker, or that five of the same collectible such as 'jewels' affect each baddie/blocker and you need to remove five of them when you disable a baddie/blocker.

Could you be a bit more specific ...and say what the error is.
👍 0
#76870
I mean coins (I'm using stars this time)


5 coins will kill a ghost, but if you have more than 5 and touch tghostust the game just has a fit.
So i need to prevent Dizzy (zaks) from carrying more then 5 if possible.
👍 0
#76873

quite simple, 2 ways to do this.

1. stop dizzy picking up collectibles:

if(class==CLASS_COIN) // coins are to be collected
{
	coins = PlayerGet(P_COINS)+1;
	if(coins>5)
	{
		ObjSet(idx, O_DISABLE, 1); // make disabled (picked up)
		PlayerSet(P_COINS,coins); // store coins counter
		SamplePlay(FX_COIN);
		OpenDialogMessage("YOU HAVE FOUNDnA COIN");
	}
	else
	{
		OpenDialogMessage("YOU ALREADY HAVE 5 COINS");
	}
}

use that as code in action.gs, and following code to remove coins when you hit baddies:

PlayerSet(P_COINS,0);

way 2 is easier, just remove correct number of coins when you hit baddies:

coins = PlayerGet(P_COINS);
	if(coins>=5)
	{
		PlayerSet(P_COINS,coins-5);
	}
👍 0
#76874
Ah, thats an idea.
I was trying to do it acompletelyy different way.

Cheers, i'll see if this works.
👍 0
#76888
Spot on Entropy. I'll only add one insy suggestion. As the stars are removing baddies and blocks, perhaps adding the line: SamplePlay(FX_SUCCESS); would add that little extra touch.
👍 0