PDA

View Full Version : Detecting if an item has been picked up.



SUCCESSOR
03-12-2014, 10:30 PM
I was originally detecting a collision between Lnk and the item but this seems to be flawed due to weird item hitboxes. BigJoe's idea is to just check if the item becomes invalid. I am not certain this is full-proof just yet. This seems to work fine in an FFC script but global script would be more complicated. And what about FFCs carrying over?

Is there another way to do it?

Gleeok
03-13-2014, 11:00 PM
With the first method: If an item disappears then it would count as a pickup, so that's no good for all items but would still work for some. The easiest way would probably be ... *wait for it* ... Item pickup scripts. :P



//script that when set to an item pickup slot maims Link.
item script MyNefariousItemPickup
{
void fun()
{
//item has been picked up already
Link->HP = 1;
FunctionThatLetsAScriptKnowTheItemWasPickedUpWowTh isIsAReallyLongNameDood();
}
}


I think this is what you were looking for.

SUCCESSOR
03-15-2014, 05:45 PM
Unfortunately, no. That could work if it was just one item but the item is set through an ffc argument so it can be any in game item. It would be nice to assign a script to an item on demand. That could get in the way of a already assigned item script though...

I think i may figure out where the collision actually happens.

Gleeok
03-15-2014, 06:31 PM
Yuck.
Okay: Plan B Hack: If the item is null then just extend the items hitbox by 16. If there's a collision with that then Link probably picked up the item. :shrug: