Mindtwistah Posted March 29, 2008 Share Posted March 29, 2008 Is there any script that spawns something in another module? Like, if I go to Dantooine and buy a let us say robot through a dialog, and I want it to spawn in the Ebon Hawk, is there a script to do that? If yes, can you post it? Link to comment Share on other sites More sharing options...
HdVaderII Posted March 29, 2008 Share Posted March 29, 2008 There isn't one script that does all that, but I think you'd be able to if you combined globals and the ebon hawk on-enter script. Sorry, I can't really be more specific than that. Link to comment Share on other sites More sharing options...
Stream Posted March 29, 2008 Share Posted March 29, 2008 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 More sharing options...
Mindtwistah Posted March 29, 2008 Author Share Posted March 29, 2008 What if I don't want to edit the OnEnter script? Is there any other way? Cause if I would edit the OnEnter script, the mod would conflict with my Cheat-Bot mod. Link to comment Share on other sites More sharing options...
HdVaderII Posted March 29, 2008 Share Posted March 29, 2008 Hmm....could you use the heartbeat of something else in the ebon hawk? Link to comment Share on other sites More sharing options...
Stream Posted March 29, 2008 Share Posted March 29, 2008 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 More sharing options...
Mindtwistah Posted March 30, 2008 Author Share Posted March 30, 2008 Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.