Help understanding PowerUps/PickUps

SuperNatetendo

New member
Okay, I'm stuck. Not sure what part of the tutorials I'm missing but, does anyone know a way to determine what variable a particular pickup modifies? Right now I have two monster objects set as pickups (there are reasons they aren't game objects beyond just saving space), but I don't know how to set them to modify a variable.

Any help?

P.S. Forgot if Joe had answered this, but the HUD creation tool isn't quite finished correct?
 

dale_coop

Moderator
Staff member
In the « Project settings > Script settings », you can assign scripts to each elf the 4 PowerUp items (the 4 last ones)
You can find the scripts in the PowerUp folder (in platform and/or adventure... you can use/mix them)

If you declared your own variable in the HUD variables (for example « myAmmo »), you would need to make a new script to deal with your value (DEC myAmmo or INC myAmmo) and maybe update the HUD, if you display the variable on your HUD (look at the content of the other scripts)

If you have problems, we can help you to finalize your script.
 

SuperNatetendo

New member
Okay, I see those now. That's a good start. Now, say I create a "monster" object that's checked as a "pickup/powerup" how do I then assign it to one of the pick-up scripts?
 

dale_coop

Moderator
Staff member
If it’s a monster object, no specific script is assigned to them.
You will need to modify the « HandleObjectCollisions_xxx.asm » script to do whatever you want it to do (search for « collectable » in the script).
There is a comment about that.
 

SuperNatetendo

New member
Taking a look at it - mentions something along the lines of "HandlePickupPowerup". Not sure where that code is. I think this may be beyond my abilities in ASM.

Potentially I could create the pickups as NPC objects and then have them update the values directly upon being interacted with.

Perhaps this may be something that needs some attention in future versions for NESmaker for a bit more versatility.
 

dale_coop

Moderator
Staff member
I am not sure it would required more versatility in the new version, we have already 4 different power ups.

But who knows what Joe added in the new version;)

Else yes you could add code directly in the collision script (check the object id number, incredease or decrease your variable and update the hud)
 

SuperNatetendo

New member
Well, I don't view it as not having enough power-ups, but rather say you wanted multiple objects to do the exact same thing. For example, say you needed to collect 5 treasures to beat any given level. It'd be really cumbersome to have to write specific code for each one based on ID to point to the exact same code. When it could be written in a way similar to ending action states or edge/solid collision checks when it's a powerup.

And of course there's the added, "I barely know ASM" dilemma. I don't really know where to begin with this one.
 

dale_coop

Moderator
Staff member
Yep but your example is exactly.... a specific case :p
NESMaker is not enough versatile to support all the specific cases (and it can't due to memory space).
So you (or someone else) would need a specific code/scripts.
 

SuperNatetendo

New member
What I'm saying is - I'm not against coding specific cases. I'd just like an easier way of pointing to any given code.

I think what I can do is have a range of values point to a Macro for now. Just gotta figure out what exact bits a monster object which is also a pickup would occupy and how to branch from there.
 
Top Bottom