Difference between revisions of "Command an NPC/Creature to Attack"
Command an NPC/Creature to Attack (edit)
Revision as of 07:09, 24 December 2009
, 07:09, 24 December 2009→Create the Object script for your NPC
imported>Phinix |
imported>Phinix |
||
Line 120: | Line 120: | ||
That should do it. I set my summons to have '''aggression''' at 10 in their AI setup by default. That way they’ll fight when attacked but won’t go after friendlies unless you command them to. | That should do it. I set my summons to have '''aggression''' at 10 in their AI setup by default. That way they’ll fight when attacked but won’t go after friendlies unless you command them to. | ||
'''UPDATE:''' The reason I use the timer for setting the defensive state to 2 and then back to 0 (waiting state) is so that if multiple NPC/Creatures are watching this same global variable status to change their hostility (using the Ability script we added), we want to give the game a few frames to think about it so all of them get the message. | |||
This is something I have discovered in troubleshooting some issues with actor scripts seemingly losing the ability to effect the global through their menu. I believe this has been resolved by adding the Ability to their spell list directly in the editor rather than attempting to do so on-the-fly via additional scripting. This method eliminates some unnecessary complexity, and seems to work better. Your mileage may vary. | |||
Best of luck! | Best of luck! | ||
-Phinix | -Phinix |