Jump to content

Home

[K1] Somewhat different spawn-script


Mindtwistah

Recommended Posts

Like HdVaderll said you can use a global to achieve this, the simplest way to do it is edit globalcat.2da and add a new global boolean, if you release this as mod it's best to use TSL Patcher so it's compatible with other mods. Once you've added a new global, for an example we'll say the global is called MINDTWISTAH_TEST, you'll have to set it through a script when the droid is bought, this script will do;

 

void main () {

SetGlobalBoolean("MINDTWISTAH_TEST",TRUE);

}

Next you'll want to make the script so the droid will spawn on the Ebon Hawk, there's two ways of doing it but I'll go for the quickest, first extract the original complied script for the on enter for the Ebon Hawk module, I can't remember what it's called off hand, now rename it to something like old_onload.ncs, then compile this script and name it what the Ebon Hawk on load script is called.

 

void main() {

if ((GetGlobalBoolean("MINDTWISTAH_TEST")==TRUE))
   {
CreateObject(OBJECT_TYPE_CREATURE, "DROID_TAG", Location(Vector(x, y, z), 0.0));
SetGlobalBoolean("MINDTWISTAH_TEST",FALSE);
ExecuteScript("old_onload", OBJECT_SELF, 1002);    
   }
else {
if ((GetGlobalBoolean("MINDTWISTAH_TEST")==FALSE))
ExecuteScript("old_onload", OBJECT_SELF, 1002);    
}
}

In that script we set the boolean back to false so the droid won't re-spawn each time we enter the Ebon Hawk.

 

I hope that makes sense, I'm not the best at explaining things.

 

--Stream

Link to comment
Share on other sites

Yeah you could use the heart beat for something if you wanted, same scripts as above but you don't have to rename any scripts and change the execute script to k_def_heartbt01, so the end script would look like this.

void main() {

if ((GetGlobalBoolean("MINDTWISTAH_TEST")==TRUE))
   {
CreateObject(OBJECT_TYPE_CREATURE, "DROID_TAG", Location(Vector(x, y, z), 0.0));
SetGlobalBoolean("MINDTWISTAH_TEST",FALSE);
ExecuteScript("k_def_heartbt01", OBJECT_SELF, 1002);    
   }
else {
if ((GetGlobalBoolean("MINDTWISTAH_TEST")==FALSE))
ExecuteScript("k_def_heartbt01", OBJECT_SELF, 1002);    
}
}

Call that script whatever you like on and type it into the heartbeat field of whatever you want to use.

 

--Stream

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...