Jump to content

Home

[KOTOR]trouble with userdefined events


jinger

Recommended Posts

i'm modding the Ebon Hawk to have people do stuff like in TSL but i guess userdefined events hold some secret from me, help! here's what i did:

k_oei_hench_inc.nss

#include "k_inc_generic"
#include "k_inc_utility"

void DoSpecialSpawnIn(object pObject);
void DoSpecialUserDefined(object pObject, int pUserEvent);
…
void DoMissionSpawnIn(object oPartyMember, string sModuleName);
void DoMissionUserDef(object oPartyMember,int pUserEvent, string sModuleName);

void DoSpecialSpawnIn(object pObject)
{
 if(GetIsObjectValid(pObject))
 {
   string tTag = GetTag(pObject);
   string sModuleName = GetModuleFileName();
   …
   else if(tTag == "Mission")
   {
     DoMissionSpawnIn(pObject, sModuleName);
   }
 }
}

void DoSpecialUserDefined(object pObject, int pUserEvent)
{
 if(GetIsObjectValid(pObject))
 {
   string tTag = GetTag(pObject);
   string sModuleName = GetModuleFileName();
   …
   else if(tTag == "Mission")
   {
     DoMissionUserDef(pObject, pUserEvent, sModuleName);
   }
 }
}

void DoMissionSpawnIn(object oPartyMember, string sModuleName)
{
 if(sModuleName=="ebo_m12aa")
 {
   GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DIALOGUE_END);
   PlayAnimation(15,1.0,-1.0);
 }
}

void DoMissionUserDef(object oPartyMember,int pUserEvent, string sModuleName)
{
 switch(pUserEvent)
 {
 case 1011 : //DIALOGUE END
   SetFacing(GetFacing(GetWaypointByTag("pebn_mission")));
   PlayAnimation(15,1.0,-1.0);
 break;
 case 1100 :
   UT_ReturnToBase();
 break;
 }
}

k_oei_spawn.nss

#include "k_oei_hench_inc"
#include "k_inc_debug"

void main()
{
 SetIsDestroyable(TRUE,TRUE,TRUE);
 GN_SetListeningPatterns();
 DoSpecialSpawnIn(OBJECT_SELF);
}

k_oei_userdef.nss

#include "k_oei_hench_inc"
#include "k_inc_debug"

void main()
{
 int nUser = GetUserDefinedEventNumber();
 DoSpecialUserDefined(OBJECT_SELF, nUser);
}

of course i put these in each .utc but for some reason userdefined events won't fire, and there's more, out of the ship no specialSpawnIn works either! damn, TSL was way more easy to mod :(

Link to comment
Share on other sites

I got it. It's SW_FLAG_EVENT_DIALOGUE_END, not SW_FLAG_EVENT_ON_DIALOGUE_END. Now Mission is at the security console, Juhani's meditating in the starboard dormitory like Visas and Zaalbar's at the workbench like i did for Mira :D HK in the storage compartment. I tried to have T3 doing the stuff he does in TSL but that'd be quite too much trouble, i'd need to make a new k_inc_waypoints (if the names correct), the pausing and the animations are handled differently or less in detail than in TSL :(

Link to comment
Share on other sites

Be carefull with changing the Event user Def for NPC's as the are used sometimes for plot specific stuff... This means you could screw op the storyline at some point if using other scripts for your NPC's.....Ie most NPC's in your party has special stuff they should do at Korriban...

 

 

The Party NPC's has special User defined events called hench events.....It refers to a master script where special events might or might not be defined depending on the tag....

Link to comment
Share on other sites

Jinger I would recomend also creating your own custom versions of the above scripts as they are technically K2 resource scripts and were not part of K1. This is determined by the "K_oei_" beginning for all of them. Because of this any K1 mod that you release with these scripts would be considered having Ported Assests from another game which is a "BIG RED FLAG" No, No around here. However if you change there names then you won't be committing any infractions.

Link to comment
Share on other sites

Jinger I would recomend also creating your own custom versions of the above scripts as they are technically K2 resource scripts and were not part of K1.
thanks for the advice! i'll change the names right away (though i never thought to release this stuff).
Be carefull with changing the Event user Def for NPC's as the are used sometimes for plot specific stuff...
yep, i check that out first to see if it was worth the trouble :) i included in the script any special stuff i found in the original nss files for each npc, luckily only Canderous has a special userdef script in his utc, for the others it was only a matter of adding a DoSpecialStuff at the end of k_hen_spawn01 and k_def_userdef01.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...