Robespierre Posted February 5, 2008 Share Posted February 5, 2008 Well, as you know, I'm working on the droid teleporter on Telos. However, for whatever reason the pben_swoopdrd.utc won't spawn. I've got the .utc and the spawning .ncs scripts in the override folder. Because I was having trouble with the scripting tutorial, I took the advice of someone (can't remember who) and decompiled the k_ptar_02aa_en.ncs file, added my lines and recompiled. Here's the result: // Globals int intGLOB_1 = 0; int intGLOB_2 = 1; int intGLOB_3 = 2; int intGLOB_4 = 3; int intGLOB_5 = 4; int intGLOB_6 = 5; int intGLOB_7 = 6; int intGLOB_8 = 7; int intGLOB_9 = 8; int intGLOB_10 = 9; int intGLOB_11 = 10; int intGLOB_12 = 11; int intGLOB_13 = 12; int intGLOB_14 = 13; int intGLOB_15 = 14; int intGLOB_16 = 15; int intGLOB_17 = 16; int intGLOB_18 = 17; int intGLOB_19 = 18; int intGLOB_20 = 19; int intGLOB_21 = 1100; int intGLOB_22 = (-6); int intGLOB_23 = (-5); int intGLOB_24 = (-4); int intGLOB_25 = (-2); int intGLOB_26 = (-1); int intGLOB_27 = 0; // Prototypes int sub2(object objectParam1, int intParam2); void sub1(object objectParam1); int sub2(object objectParam1, int intParam2) { int nLocalBool; if ((((intParam2 >= 0) && (intParam2 <= 19)) && GetIsObjectValid(objectParam1))) { nLocalBool = GetLocalBoolean(objectParam1, intParam2); if ((nLocalBool > 0)) { return 1; } } return 0; } void sub1(object objectParam1) { object oAreaObject = GetFirstObjectInArea(objectParam1, 1); while (GetIsObjectValid(oAreaObject)) { if (sub2(oAreaObject, intGLOB_10)) { DestroyObject(oAreaObject, 0.0, 1, 0.0); } oAreaObject = GetNextObjectInArea(objectParam1, 1); } } void main() { object oTrooper1 = GetObjectByTag("Trooper1", 0); object oDroid1 = GetObjectByTag("droid1", 0); object oDroid2 = GetObjectByTag("droid2", 0); object oBith = GetObjectByTag("Bith", 0); object oDuros = GetObjectByTag("Duros", 0); if ((((((!GetIsObjectValid(oTrooper1)) && (!GetIsObjectValid(oDroid1))) && (!GetIsObjectValid(oDroid2))) || ((GetIsDead(oTrooper1) && GetIsDead(oDroid1)) && GetIsDead(oDroid2))) && (!GetLoadFromSaveGame()))) { AssignCommand(oTrooper1, SetIsDestroyable(1, 1, 1)); AssignCommand(oDroid1, SetIsDestroyable(1, 1, 1)); AssignCommand(oDroid2, SetIsDestroyable(1, 1, 1)); AssignCommand(oBith, SetIsDestroyable(1, 1, 1)); DestroyObject(oTrooper1, 0.0, 1, 0.0); DestroyObject(oDroid1, 0.0, 1, 0.0); DestroyObject(oDroid2, 0.0, 1, 0.0); DestroyObject(oBith, 0.0, 1, 0.0); DestroyObject(oDuros, 0.0, 1, 0.0); sub1(OBJECT_SELF); } } void sub3() { object oEntering = GetEnteringObject(); object oDroid = GetObjectByTag("pebn_swoopdrd"); if (GetIsPC(oEntering)) { if (GetIsObjectValid(oDroid) == FALSE) { CreateObject (OBJECT_TYPE_CREATURE, "pebn_swoopdrd", Location(Vector (87.09, 126.80, 0.00), 0.0)); } } } Can anyone see anything wrong here? Do I need to 'inject' the .utc into the module file or something? I'd appreciate the help. Link to comment Share on other sites More sharing options...
swfan28 Posted February 5, 2008 Share Posted February 5, 2008 It seems that your new function, sub3, is never run. You need to add the line sub3() to the main function to run it. Link to comment Share on other sites More sharing options...
Robespierre Posted February 6, 2008 Author Share Posted February 6, 2008 Yay fixed. Now he spawns! Thanks for that. Now...how to make him actually teleport me... Link to comment Share on other sites More sharing options...
swfan28 Posted February 6, 2008 Share Posted February 6, 2008 Inside the same module use the function: ActionJumpToLocation(location lLocation); If you want to jump to another mudule use the function: StartNewModule(string sModuleName, string sWayPoint="", string sMovie1="", string sMovie2="", string sMovie3="", string sMovie4="", string sMovie5="", string sMovie6=""); You can specify the starting waypoint for the new module as the second parameter. Link to comment Share on other sites More sharing options...
Robespierre Posted February 6, 2008 Author Share Posted February 6, 2008 As in, the way point coordinates? Or do I have to edit the module and manually set a waypoint? Link to comment Share on other sites More sharing options...
swfan28 Posted February 6, 2008 Share Posted February 6, 2008 For the same module you can specify the coordinates like you did with that swoop droid but for other modules this needs to be an existing waypoint and the string parameter is the waypoint's tag. Waypoints can be spawned by scripts in TSL but not to other modules. You'll need to edit the git-files to place new waypoints or use the existing waypoints already in the modules. Link to comment Share on other sites More sharing options...
Robespierre Posted February 8, 2008 Author Share Posted February 8, 2008 What do the "string smovie1="" fields do? Can I remove them? Link to comment Share on other sites More sharing options...
swfan28 Posted February 8, 2008 Share Posted February 8, 2008 I think they would launch the specified bik movies before loading the module. They can be safely removed as the default is empty string. Link to comment Share on other sites More sharing options...
Robespierre Posted February 8, 2008 Author Share Posted February 8, 2008 ARGH: void main() { StartNewModule(string star_m02ac, string sWayPoint=swoop_trans); } That's my .nss file. But when I try to compile it, it gives me a: Error: Syntax error at "string" Link to comment Share on other sites More sharing options...
swfan28 Posted February 8, 2008 Share Posted February 8, 2008 void main() { StartNewModule("star_m02ac", "swoop_trans"); } That should do it. Link to comment Share on other sites More sharing options...
Robespierre Posted February 9, 2008 Author Share Posted February 9, 2008 Yay! Now I just have to get the rest of those waypoints in. Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.