Say I want to run a script through an NPC that returns its reference.
How would I go about doing this?
How can I get a reference to the NPC that is running the script?
Getting NPC ref from their script
Moderators: marionline, SDHawk
- Bob the Hamster
- Lord of the Slimes
- Posts: 7658
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
Actually, any script triggered by an NPC can automatically get a reference to the NPC who triggered it.
http://rpg.hamsterrepublic.com/ohrrpgce ... PC_Scripts
http://rpg.hamsterrepublic.com/ohrrpgce ... PC_Scripts
Code: Select all
plotscript, npc activation script, arg, ref, begin
#arg will be filled with the script argument from the NPC editor.
#ref will be filled with a reference to this specific NPC.
end