Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

weapon variables

5 replies · 2,422 views · Started 19 March 2015

int weapon->Parent
Returns the id of the item or the Screen->LoadNPC() number for the npc that created it or -1 in the case it was created by a script. Yes this is possible right now.

bool weapon->isLit
Returns true if the weapon is currently providing light.

And may'be if it can be made possible

int weapon->DriftDir
If is the drift dir. 3-Shot and 5-Shot use this as do rising fireballs.
Returns -1 if not drifting.

int weapon->DriftStep
This is the weapons drift step.
Returns 0 if not drifting. Since weapons can have a negative step.

Wait wut?!

weapon->Parent is a thing?! That is so incredibly awesome!
Where did you find these properties? I don't remember seeing them anywhere. Do you know which version added them?

Oh... oops.

Well, I could make up an excuse for why I fell for it like a big goof, but instead I'll just say that I'm totally thumbs-up on this and it needs to be a thing.

Mero wrote:int weapon->Parent
Returns the id of the item or the Screen->LoadNPC() number for the npc that created it or -1 in the case it was created by a script. Yes this is possible right now.

This should refernce the NPCs ID. What if a NPC on screen died and the NPC that created it's reference number has changed? What if the NPC is no longer valid? Plus ID i just the more useful number. Also if script is the parent it's be nice if it somehow referenced what script made it.

Well that's how they work internally, so that's probably going to be how it'll have to work. With -1 being returned by a weapon created by a script. And no you cannot specify which script created it since all script created weapon have -1 as their parentIDs and parentItems.