PDA

View Full Version : weapon variables



Tamamo
03-19-2015, 03:46 PM
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.

CJC
03-19-2015, 08:54 PM
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?

Tamamo
03-19-2015, 08:54 PM
You forget CJC, I have access to the code.
Also you know this is suggestions right?

CJC
03-19-2015, 09:54 PM
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.

SUCCESSOR
03-20-2015, 12:37 AM
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.

Tamamo
03-20-2015, 12:57 AM
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.