Difference between revisions of "Command an NPC/Creature to Attack"
Command an NPC/Creature to Attack (edit)
Revision as of 22:51, 22 December 2009
, 22:51, 22 December 2009no edit summary
imported>Phinix (A simple way to set up an Attack/Defend menu using OnActivate.) |
imported>Phinix |
||
Line 7: | Line 7: | ||
== Create a Global variable == | == Create a Global variable == | ||
Start by clicking '''Gameplay''' on the main CS menu, and select '''Globals''' | Start by clicking '''Gameplay''' on the main CS menu, and select '''Globals'''. | ||
Right-click the list on the left and select "New." | Right-click the list on the left and select "New." | ||
Line 13: | Line 13: | ||
[[Image:Phicommandtut01.jpg]] | [[Image:Phicommandtut01.jpg]] | ||
Give your variable a name. For this guide I’ll use '''globalvar1''' but you'll want to make | Give your variable a name. For this guide I’ll use '''globalvar1''' but you'll want to make certain and use something unique for any global you create. | ||
You can see it | You can see it gets set as a '''short''' variable with a value of "0" by default, which is what we want. Click OK to close the Globals window. | ||
== Create a Magic Effect script == | == Create a Magic Effect script == | ||
Line 54: | Line 54: | ||
Now right-click the space on the right and select "New" to bring up the box to add a new spell effect. | Now right-click the space on the right and select "New" to bring up the box to add a new spell effect. | ||
For the effect choose "Script Effect" and give it a duration (I use 360 but it doesn’t | For the effect choose "Script Effect" and give it a duration (I use 360 but for this spell it really doesn’t matter since it will stay on until it’s dismissed.) | ||
Give it an "Effect Name," then choose any school and visual. Do not check "Effect is Hostile." | Give it an "Effect Name," then choose any school and visual. Do not check "Effect is Hostile." | ||
Line 64: | Line 64: | ||
== Create the Object script for your NPC == | == Create the Object script for your NPC == | ||
Follow the same steps as above to create another new script, only make this one an '''Object''' type. You can replace the names of the short and float variables listed at the top to be whatever you wish. Same goes for the script name. | |||
Once created this script will need to go on the NPC/creature you want to command: | |||
ScriptName MyNPCScript | ScriptName MyNPCScript |