Changing NPC event scripts on the fly...

Forum for scripters of NWN material and third party applications.
Post Reply
World Leader - LoT: Thay
Posts: 71
Joined: Fri Jun 04, 2004 3:27 pm
Location: Thaymount, Thay

Changing NPC event scripts on the fly...

Post by Cromwell » Mon Oct 18, 2004 7:22 pm

I heard somewhere it was possible, i'm asking because i have a system in which i spawn some Standard palette npc and i want to use henchmen AI, rather than putting this NPC in the custom palette and changing the scripts, i rather do it "on the fly" by adding variables on the npc to define ondeath, onspawn etc event types.
[color=red]"How wonderfully mad of you!"[/color]

World Leader: Abyss404
Posts: 154
Joined: Tue Jun 15, 2004 7:38 pm

Post by Sarrena » Mon Oct 18, 2004 9:43 pm

Likely be a matter of writing a script to take the target in game clicked, have it duplicate it with the scripts you want pluged in and wipe the original. Just like the PC mirrior one from the OC but with script shifting.
World Leader : Abyss 404

Posts: 105
Joined: Mon Nov 24, 2003 9:39 pm

Post by Arcsylver » Mon Oct 18, 2004 9:45 pm

Jeff from Ea has a spawn system that can do a lot of what you are wanting.

You may want to talk with him about how he sets the variables on his spawns on the fly using the DM Client a bit for some ideas.

I cant give details as I agreed to no divulge anything of his code for intellectual property reasons however and I will not violate his rights in that regard.

Posts: 137
Joined: Tue Nov 25, 2003 7:29 am
Location: Avlis Team - Tairis'nadur Team

Post by Mistcaller » Tue Oct 19, 2004 2:50 am

The most sufficient way I can think of is to use the SignalEvent command

object oNPC;
event eSpecialEvent;

eSpecialEvent = EventUserDefined(1234);
In other words, you can have one script (In the User Defined event) with many different numbered events, that can be activated by any external source, but under normal conditions they are slumbering...


Post by Guest » Tue Oct 19, 2004 10:56 am

Looked at that, and unfortunetly it doesn't have onspawn ondeath and a few others i need... It does have heartbeat... But thats more work than nessacary, i guess i will just throw them over into the custom palette.

Post Reply