A way to get the ref of the NPC who triggered a plotscript?
Moderators: marionline, SDHawk
A way to get the ref of the NPC who triggered a plotscript?
I'm running a plotscript for NPCs for things like health pickups and other powerups. But to have them spawn from dead enemies, I don't believe using onetime tags would be a suitable way to make them disappear since the onetimes are tied to the NPC ID, not the reference. So I was hoping there would be a way to get the NPC reference of whatever NPC triggered the pickup/powerup plotscript, so I could destroy that NPC reference after the powerup effect occurs. But I'm not finding anything like that in plotdict.xml. Any info would be appreciated.
This is one of the most weirdly-documented features and it feels like the third time this week someone's needed it. Basically, a script run by an NPC will automatically send the NPC Reference to the second argument of that script.
Sweet, thanks! And yeah, that definitely needs to be documented better. Even a blurb in plotdict.xml under the #about-plotscript section would be great.
Honestly I almost never read the help files on the wiki, should probably make an effort to read through it more though to avoid asking dumb questions like this.
Honestly I almost never read the help files on the wiki, should probably make an effort to read through it more though to avoid asking dumb questions like this.
It's not a dumb question, it's a great question. The wiki is really scary and I wouldn't recommend trying to read through it unless it was some kinda around the world in 80 days style bet. Even the List of Frequently Asked Questions makes me cross-eyed.Foxley wrote:Sweet, thanks! And yeah, that definitely needs to be documented better. Even a blurb in plotdict.xml under the #about-plotscript section would be great.
Honestly I almost never read the help files on the wiki, should probably make an effort to read through it more though to avoid asking dumb questions like this.
This might be the most commonly asked question of all. For a long time I've been meaning to make Custom itself preview what arguments will be passed to all triggered scripts.
And of course, the Plotscripting Tutorial is a terrible place to document it; a dedicated plotdict section would be a good idea.
And of course, the Plotscripting Tutorial is a terrible place to document it; a dedicated plotdict section would be a good idea.
Last edited by TMC on Sun Jan 01, 2017 6:29 am, edited 1 time in total.