Hello. I am trying to get an NPC to attack the PC when you try to bludgeon through a door nearby. My guess is that it wold be a script in the door's OnAttacked script - an object to find nearest NPC named so and so, or some such. But I don't know how to do it. Any help regarding this is manifestly appreciated! Thanx.
Script to make NPC attack when nearby door is bludgeoned??
Débuté par
Groove Widdit
, juin 14 2013 11:06
#1
Posté 14 juin 2013 - 11:06
#2
Posté 14 juin 2013 - 11:19
This is an incredibly basic draft. You may want to do a lot more than this, but it gets the job done.
void main()
{
object oPC = GetLastAttacker();
object oGuard = GetNearestObjectByTag("Guard");
AssignCommand(oGuard, ClearAllActions());
AssignCommand(oGuard, ActionSpeakString("You asked for it!"));
AssignCommand(oGuard, ActionAttack(oPC));
}
Modifié par Squatting Monk, 14 juin 2013 - 11:21 .
#3
Posté 15 juin 2013 - 12:18
It worked! The line of dialogue is awesome. Your kung fu is the baddest, monk.
#4
Posté 15 juin 2013 - 12:18
double post
Modifié par Groove Widdit, 15 juin 2013 - 12:20 .
#5
Posté 15 juin 2013 - 12:40
<Blatant Self-Promotion Warning>
I have a whole bunch of scripts that I posted some time ago that handles this and a whole bunch of other solutions to the pc bashing door problem. I called it "Fun Doors" and if you try the demo module (but read the read me first) you'll see why. I also included a table of what script does what and what resources each uses, so you can grab just the scripts you need. As the download is less than 112kb it is no great wait to get it. Just follow the link on its name to get it from the new vault.
TR
I have a whole bunch of scripts that I posted some time ago that handles this and a whole bunch of other solutions to the pc bashing door problem. I called it "Fun Doors" and if you try the demo module (but read the read me first) you'll see why. I also included a table of what script does what and what resources each uses, so you can grab just the scripts you need. As the download is less than 112kb it is no great wait to get it. Just follow the link on its name to get it from the new vault.
TR
#6
Posté 19 juin 2013 - 06:29
Okay.





Retour en haut







