PDA

View Full Version : MODDER S.O.S.!


DarthDementous
08-16-2006, 09:32 PM
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

Mav
08-16-2006, 09:46 PM
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

DarthDementous
08-16-2006, 09:54 PM
Could you name a mod that comes with a script that does what I need?

stoffe
08-17-2006, 06:58 AM
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("st_enemy1", 45.0, 2.0, GetFirstPC());
ST_SpawnNPCAround("st_enemy2", 315.0, 2.0, GetFirstPC());
ST_SpawnNPCAround("st_enemy3", 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.

DarthDementous
08-17-2006, 11:07 AM
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

stoffe
08-17-2006, 01:02 PM
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.

DarthDementous
08-17-2006, 01:33 PM
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

stoffe
08-17-2006, 02:03 PM
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.

DarthDementous
08-17-2006, 02:12 PM
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!

stoffe
08-17-2006, 02:57 PM
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.

DarthDementous
08-17-2006, 03:03 PM
Wow. Thank you soooooooo much! Thank you! Thank you! Thank you! You saved my mod!