schep
Level: Smitemaster
Rank Points: 865
Registered: 03-01-2005
IP: Logged
|
Re: A bit of scripting help required (0)
To be more precise, an NPC being stabbed does generate the 'Monster Stabbed' event. But this is one of those events that can happen after an NPC's script has run, which complicates things. If Beethro, moving mimic, Slayer, or guard does the stabbing, then it happens before NPCs act, and NPCs checking for the event that turn are sure to detect it. If a decoy or just-placed mimic stabbed, then NPCs checking for a stab with "If ... go to" have already executed code assuming no stab happened and won't catch the event, but NPCs checking for a stab without "If ... go to" are still waiting for the event and will detect it and resume, but can't execute any code until the next turn. When it's another NPC that does the stabbing, which of the above cases applies depends on the monster move order for the stabber and the tester.
But the reason this example didn't work had nearly nothing to do with all that. The "Move to" command always ends the NPC's turn. So the NPC in that GoWestLoop doesn't check for a stabbing until the beginning of each turn. In which case, no, nothing has been stabbed this turn.
Anyway, I can't think of any solution better than what was mentioned. (At least, not until TCB gives us "Wait for NPC at relative (-2,0)".) But it may act more obviously if you make sure the stab-detector NPC executes after the moving NPC.
|