Signal another NPC
Moderator: Team Members
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Signal another NPC
I know I asked this before but I cannot find the post after multiple searches. I need to signal another NPC. How would I go about doing that? So basically I was to tell NPC one to send a signal to NPC two. Once NPC two gets the signal I want it to react. What I am attempting to do, and someone may have a better idea of how to do it, is to record the spell effects.
Resident Dirty Hippy
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Signal another NPC
You can get pointers to other spawns with the various GetSpawn functions and then use that pointer to do whatever you want for example
As you are talking about spell effects you might also want to look at the casted_on function that is triggered on a spawn every time a spell or entity command is used on them.
Code: Select all
function hailed(NPC, Spawn)
spawn2 = GetSpawn(Spawn, 1234) -- Get the closest spawn with a DB ID of 1234
-- make sure pointer is valid before using
if spawn2 ~= nil then
Attack(spawn2, Spawn) -- Have spawn2 attack the player
end
end
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Who is online
Users browsing this forum: No registered users and 0 guests