(SOLVED) spawn item gravity

Minor

Member
hi,
just a small problem.

I spawn the following "1up" item in the blank, and it falls down at the beginning of the stage, but i can pick up the item (subtype touch).
When i put a subject to gravity 0, spawn location is correct but i can't pick up the item.

5mZGYj6.png


How can i spawn correctly this item and pick it up?
 
Value 0 for subject_to_gravity does not have a gravity effect, but 1 does have a normal effect according to the manual. Did you not put antigravity 100 in the header? It should remain floating without falling to the ground. I cannot remember using subject_to_gravity though. If you want an item to be picked when you jump to it instead of it being on the floor for you to get it, why not use itembox for grabbing a floated item there?

itembox

itembox {x} {y} {right} {down}

An item box which can hit bboxes. This can only be used by 'item' entities.
{x}, {y}, {right}, and {down} work exactly like in a bbox.
If another entity touches this itembox, the item will be picked up by that entity.
The entity who can touch or pick this item is determined by 'candamage'. See 'candamage' above.
 
Everything's ok beastie  (item floats now) ;)


And thank you again maxman, "itembox" allows to make what i want.

But i always don't understand why the subtype touch didn't work. But nevermind now  ;)
touch: For items. The item will be collected just by touching it. You won't need to press the attack button.
 
Maybe subtype TOUCH is outdated or it was broken in some past version. I don't use it, so check Zvitor's Marvel First Alliance, he uses the item with touch. I think he uses a itembox, because he uses a didhitscript.
 
Thegr8test said:
when you were trying to use subtype touch were you adding a bbox to the item?
Yes, that was weird.
And an "itembox" with these same coodinates worked.

As "o" said, maybe it's outdated. I will check this "didhitscript too, but everything's is ok with "itembox.

Thank you guys, problem solved  ;)
 
Back
Top Bottom