Non-Respawning Item Spawner
#1
Posted 19 March 2017 - 07:32 AM
Hypothetically, if someone wanted to put several rupee pickups on the floor and have them only be able to be picked up once, how would someone go about having the item respawn each time the screen is remade unless they picked up the item?
I suppose having the FFC occupy the same space as the item, and check whether the player entered its hitbox. It's the only way I can think of at the moment.
- Shane likes this
#2
Posted 19 March 2017 - 08:26 AM
0000001b; //item one
0000010b; //item two
...and so forth. Then, OR the flags together on collection into a specific Screen-D index. The ffc would use a D arg to specify its unique flag (per screen)
When the ffc that spawns items runs, if an the Screen->D index has that flag, it spawns no more. Otherwise, spawn the item and mark it. The item pick-up script registers that flag to Screen-D on collection.
Note that with the itemdata updates in 2.51 and above (2.54, inclusive), you could use the ffc that spawns the items to assign them a specific pick-up script, rather than needing to set one to the items by default. This allows using an item that has no pick-up script set, or a differemt script, in the above manner.
Those itemdata changes are in canonical ZC now, and will be in the next major release.
If you use Collision, just OR the value stored in item->Misc[] to Screen->D[]. It would be best if only one ffc script runs the collision function.
Edited by ZoriaRPG, 19 March 2017 - 08:30 AM.
- ShadowTiger likes this
#4
Posted 19 March 2017 - 10:56 AM
So, Moosh, given that I see that these use flags #16-31, apparently, what does that mean in terms of the screen's secrets?
Y'know what'd be interesting for this script? And correct me if I'm wrong on this and this is actually how it works, but it'd be neat if each FFC defined a Combo ID number rather than a Combo Flag. This way you could have a unique floor combo just to have these items appear on it without having to have a flag on it.
#5
Posted 19 March 2017 - 11:00 AM
Mooshs script lets you use any flag, not just flags 16-31
- ShadowTiger likes this
#6
Posted 19 March 2017 - 11:08 AM
Mooshs script lets you use any flag, not just flags 16-31
......!
Who's a moron with two thumbs? This guy. *Points to self with a banana*
Thanks very much! I hadn't figured that when reading the directions. I'll experiment around with it.
What a glorious day. :-P
#7
Posted 19 March 2017 - 11:09 AM
So, Moosh, given that I see that these use flags #16-31, apparently, what does that mean in terms of the screen's secrets?
It means I like to live dangerously. On a screen where there's actual secrets going on you'd want to use script flags or raft flags or block trigger or something else that functionally does nothing. I was just showing off that in cases where there's no secrets on the screen, you can use secret flags.
Y'know what'd be interesting for this script? And correct me if I'm wrong on this and this is actually how it works, but it'd be neat if each FFC defined a Combo ID number rather than a Combo Flag. This way you could have a unique floor combo just to have these items appear on it without having to have a flag on it.
This sounded like a handy feature if flags were for whatever reason on short supply. I went ahead and updated the script so it interprets a negative flag as a combo number.
Edited by Moosh, 19 March 2017 - 11:24 AM.
- ShadowTiger likes this
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users