|
Post by Sentinel on Aug 15, 2010 2:32:10 GMT
I was wondering if anyone knew how to get a group of monsters to begin their attack on an NPC when you approach.
(Sort of like that guy who gets attacked by Kagouti in Morrowind.)
|
|
|
Post by jgf on Aug 22, 2010 8:40:43 GMT
In that instance the kagouti are actually attacking you, you just happen to have the NPC as a temporary companion. The game treats NPCs and creatures identically, hence all the NPCs illogically wandering around daedric runs not being attacked by anything.
I think you would have to script the creatures to attack your NPC, using something the PC would come near as a trigger (a small rock in the path, etc.). Possibly the PCs proximity to the creatures could be used as the trigger, but I'm not sure. (My knowledge of scripting wouldn't fill an index card.)
|
|
|
Post by kateri on Aug 22, 2010 15:28:51 GMT
I did this with Julan and the clannfear, if that's any help as a model. One sec...
script on attacking creature:
Begin KS_Jul_clanf01
float timer
if ( menumode == 1 ) return endif
if ( KS_Julan->GetHealth > 0 ) StartCombat KS_Julan else return endif
If ( GetHealth > 0 ) If ( KS_Julan->GetWeaponDrawn == 0 ) If ( KS_Julan->GetSpellReadied == 0 ) set timer to ( timer + GetSecondsPassed ) If ( timer < 1 ) return endif KS_Julan->StartCombat KS_Jul_clannfear01 endif endif endif
End
Scripts don't run if you're not in the same cell, so I just used that - i.e. no distance check, the battle starts when you enter the cell. That was OK, since the battle could go on for a while - I set up the creature's stats that way (low attacks, high HP). If you want it to only start when the PC is very close, you can add a line at the top with a distance-to-player check. Just bear in mind that if the player can see them as they approach the group from a long way, it will look very odd if they all stand around scratching their bums then suddenly start fighting when the player steps over an invisible line.
K.
|
|