Difference between revisions of "Actors Who Assist"

362 bytes added ,  04:04, 8 August 2009
imported>Vagrant0
m
imported>Vagrant0
Line 22: Line 22:
== Notes ==
== Notes ==


Creatures do not always assist other actors whom they have a high disposition with. In these cases it is almost always best to just use scripting to make the creature assist. An example script might look something like this.
Creatures do not always assist other actors whom they have a high disposition with, but is not in the same faction, or is not aggressive enough on their own toward any would-be attacker. In these cases it is almost always best to just use scripting to make the creature assist. An example script might look something like this.
<pre>
<pre>
scn DefendParentScript
scn DefendParentScript
Line 41: Line 41:


Begin gamemode
Begin gamemode
if cooldown >= 1
if cooldown >= 1  
set cooldown to cooldown - 1
set cooldown to cooldown - 1
elseif cooldown <= 0
elseif cooldown <= 0 && pref.getdead != 1
If self.isincombat != 1 && pref.isincombat == 1
If self.isincombat != 1 && pref.isincombat == 1
set mytarget to pref.getcombattarget
set mytarget to pref.getcombattarget
Line 56: Line 56:
end
end
</pre>
</pre>
This script works with parenting, and makes the child creature assist the parent, yield with the parent, but fight back if attacked. Additional scripting would be needed to make the parent assist the child creature in a similar manner.  
This script works with parenting, and makes the child creature assist the parent, yield with the parent, but fight back if attacked. Additional scripting might be needed to make the parent assist the child creature in a similar manner. Again, this normally only needs to be done when you are trying to make a creature assist an NPC. To get the reverse situation, a NPC protecting a creature, you can usually accomplish this with factions or setting ownership on the creature.
 
 


== See Also ==
== See Also ==
Anonymous user