Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

User defined events

Page: 1 of 1
 jinger
01-08-2006, 4:32 PM
#1
I'm doing something wrong, events won't fire, please help! :firehead
for every user defined event I put the default script in the creature template so that k_ai_master is executed and the event is fired - should be - then i defined my event handlers and put the script in the template, did I miss something?


#include "k_inc_generic"
#include "k_inc_debug"
#include "k_inc_utility"

void main(){
int nUser = GetUserDefinedEventNumber();

if(nUser == 1001) //HEARTBEAT
{
bla bla bla…
}else if(nUser == 1006) // DAMAGED
{
bla bla bla…
}else if(nUser == 1007) // DEATH
{
bla bla bla…
}else if(nUser == 1011) //DIALOGUE END
{
bla bla bla…
}else if(nUser == HOSTILE_RETREAT)
{
UT_ReturnToBase();
}
}
 Darth333
01-08-2006, 4:40 PM
#2
What did you used as the OnSpawn scipt? You have to set the proper flags in the OnSpawn script.

Check k_def_spawn01.nss and uncomment the flags you need then save under a custon name (edit your .utc file accordingly) as explained in this tutorial: http://nwn.bioware.com/forums/viewcodepost.html?post=762559) (it's for nwn but it's valid for Kotor)
 jinger
01-08-2006, 5:01 PM
#3
Yep I forgot to turn on the flags -_-
:) thanks!
Page: 1 of 1