DarthDementous Posted August 17, 2006 Share Posted August 17, 2006 Hello. I am DarthDementous, the modder that made several recruitment mods for KOTOR TSL that can be found on http://knightsoftheoldrepublic.filefront.com. I am not a good scripter at all, though. For my latest recruitment character update, I'll need a script that will spawn three enemies around the PC. Since I dont have the skills to do so, I would like to put some scripters to the test (or just make a desperate plee for help). If any of you create the script, please send it to my (hardly ever used) old email, PM Me. THANK YOU! Please do not post your email address. Use the Private Message (PM) system instead. Thanks. -RH Link to comment Share on other sites More sharing options...
Mav Posted August 17, 2006 Share Posted August 17, 2006 Psst, posting of e-mail is a no no, but you should check some mods that come with scripts, most modders leave their source scripts in seperate folders so others can use them, and I rely on those source scripts for everything Mav Link to comment Share on other sites More sharing options...
DarthDementous Posted August 17, 2006 Author Share Posted August 17, 2006 Could you name a mod that comes with a script that does what I need? Link to comment Share on other sites More sharing options...
stoffe Posted August 17, 2006 Share Posted August 17, 2006 For my latest recruitment character update, I'll need a script that will spawn three enemies around the PC. Here's an example script that does something like that. It spawns three enemies in a ring around the Exile, 2 meters away, seemingly under "Stealth mode" which is deactivated after 1 second (to prevent them from magically popping out of nowhere): void ST_CloakDecloak(float fDelay); void ST_SpawnNPCAround(string sResRef, float fAngle, float fDistance, object oSource=OBJECT_SELF); void main() { // ST: Spawn three enemies 2 meters from the player, one right behind, two in front of the Exile. ST_SpawnNPCAround("[color=Yellow]st_enemy1[/color]", 45.0, 2.0, GetFirstPC()); ST_SpawnNPCAround("[color=Yellow]st_enemy2[/color]", 315.0, 2.0, GetFirstPC()); ST_SpawnNPCAround("[color=Yellow]st_enemy3[/color]", 180.0, 2.0, GetFirstPC()); } void ST_SpawnNPCAround(string sResRef, float fAngle, float fDistance, object oSource=OBJECT_SELF) { vector vPos = GetPosition(oSource); location lNPC = Location(vPos + (AngleToVector(fAngle) * fDistance), 0.0); object oNPC = CreateObject(OBJECT_TYPE_CREATURE, sResRef, lNPC); AssignCommand(oNPC, SetFacingPoint(vPos)); // ST: Look at the player AssignCommand(oNPC, ST_CloakDecloak(1.0)); // ST: Start out stealthed, decloak after 1 second. } void ST_CloakDecloak(float fDelay) { effect eStealth = EffectVisualEffect(8000); effect eDecloak = EffectVisualEffect(8001); EnableRendering(OBJECT_SELF, FALSE); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eStealth, OBJECT_SELF); DelayCommand(fDelay-0.1, EnableRendering(OBJECT_SELF, TRUE)); DelayCommand(fDelay+0.1, RemoveEffectByID(OBJECT_SELF, 8000)); DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDecloak, OBJECT_SELF)); } The parts colored in yellow in the script above is the ResRef of the UTC templates to use to spawn the enemies. Link to comment Share on other sites More sharing options...
DarthDementous Posted August 17, 2006 Author Share Posted August 17, 2006 THANK YOU!!! You just helped me make my mod 2 times better! EDIT: There is a problem. I put in the resrefs for the characters in the script and saved the script with the name 'spawnjedi'. I went into conversation editor and told it to run the script 'spawnjedi' at a certain dialogue choice. But it doesnt work. DId I skip something while making the script or something? RE-EDIT: Can someone help me by telling me what I did wrong? I really need to update my mod soon! Please refrain from double/triple posting. If you need to add something, please use the "edit this" function to the lower right of your last post ~ ChAiNz.2da Link to comment Share on other sites More sharing options...
stoffe Posted August 17, 2006 Share Posted August 17, 2006 Can someone help me by telling me what I did wrong? I really need to update my mod soon! Did you compile the script into a NCS file? The game doesn't use NSS (script source code) files for anything. Link to comment Share on other sites More sharing options...
DarthDementous Posted August 17, 2006 Author Share Posted August 17, 2006 every time i try to compile it with hazard x's thing it says syntax error and won't work. EDIT: can someone just give me the code of an already existing script of what i need. i tried making one and failed. thanks. Please refrain from double/triple posting. If you need to add something, please use the "edit this" function to the lower right of your last post ~ ChAiNz.2da Link to comment Share on other sites More sharing options...
stoffe Posted August 17, 2006 Share Posted August 17, 2006 every time i try to compile it with hazard x's thing it says syntax error and won't work. EDIT: can someone just give me the code of an already existing script of what i need. i tried making one and failed. thanks. Well, it works compiling here without any problems, and works fine when I tested it in the game a moment ago as well. Not using HazardX compiler though. Try using the compiler that comes with KotorTool, that should work. If you tell what the names are of the UTC files of the enemies you want to spawn I can compile it and send the NCS file. Link to comment Share on other sites More sharing options...
DarthDementous Posted August 17, 2006 Author Share Posted August 17, 2006 that would be great, but i don't have any utc's to use yet. when i was trying it i was testing it with gammoreans01,02,and03. i'm not exactly sure how to create a utc from scratch though. can you tell me how please? I know this is a lot to ask and im sorry! Link to comment Share on other sites More sharing options...
stoffe Posted August 17, 2006 Share Posted August 17, 2006 that would be great, but i don't have any utc's to use yet. when i was trying it i was testing it with gammoreans01,02,and03. i'm not exactly sure how to create a utc from scratch though. can you tell me how please? I know this is a lot to ask and im sorry! Usually the easiest way to make new UTC files is to edit an existing one that is (somewhat) close to what you need and then make your changes and save it under a different name. Anyway, the attached file contains a compiled NCS variant of the script, called dd_doambush.ncs since I don't know in what context you intend to use it. Run this script in-game and... well... you'll be ambushed. If you run it from a dialog, make sure you run it from one of the last nodes before the conversation ends to prevent them from appearing while still in dialog mode. The script assumes that the three attackers have the ResRefs and Tags dd_ambusher1, dd_ambusher2 and dd_ambusher3. I have included three sample attackers in the archive as well so you can test the script (3 mandalorians currently). To make your own attackers according to your need you could modify those three UTC files to change their appearance, weapons, feats etc with KotorTool's creature editor (the "Open GFF Files..." option in the File menu). You can edit them with a GFF Editor as well, but KotorTool is easier. ambushscript.zip Link to comment Share on other sites More sharing options...
DarthDementous Posted August 17, 2006 Author Share Posted August 17, 2006 Wow. Thank you soooooooo much! Thank you! Thank you! Thank you! You saved my mod! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.