PDA

View Full Version : Are random sith spawns possible?


Maxstate
08-13-2005, 04:48 PM
To those who'd like to know
________________________

First of all id like to say that ill be continueing work on the saber color mod tomorrow or the day after tomorrow. There will be some changes though, dont worry. Oh yeah i just got back from my vacation, sorry for the poor layout but i havent slept for 27 hours.




Now on to my question, would it be possible to spawn hostile npcs like kath hounds or enemy sith on planets? There isnt much action in the outside world after you kill off the animals so i was wondering if you could make some kind of respawning enemy like in the dantooine plains or something? I was thinking about mercs or kath hounds?

*yawn* now Maxxy goes to bed, good night!

stoffe
08-13-2005, 05:04 PM
would it be possible to spawn hostile npcs like kath hounds or enemy sith on planets? There isnt much action in the outside world after you kill off the animals so i was wondering if you could make some kind of respawning enemy like in the dantooine plains or something? I was thinking about mercs or kath hounds?


If the areas in question have OnEnter event scripts assigned this would be fairly easy to do.

Create your creature templates for the respawning monsters. Grab the coordinates where you wish the creatures to spawn. Then modify the OnEnter script to check if the creatures are present. If not, spawn them.

For example this script would spawn 4 creatures with the Tag and Resref set to st_respawn1, st_respawn2, st_respawn3 and st_respawn4 set in their templates, at the specified coordinates. But only if they don't already exist in the area. This would be done every time the player enters the area.


void main() {
if (GetEnteringObject() != GetFirstPC())
return;

object oRespawn;
location lLoc;

int i;
for (i = 1; i <= 4; i++) {
oRespawn = GetObjectByTag("st_respawn" + IntToString(i));
if (!GetIsObjectValid(oRespawn)) {
switch (i) {
// X Y Z Facing
// --- --- --- ------
case 1: lLoc = Location(Vector(1.0, 2.0, 3.0), 90.0); break;
case 2: lLoc = Location(Vector(1.0, 2.0, 3.0), 90.0); break;
case 3: lLoc = Location(Vector(1.0, 2.0, 3.0), 90.0); break;
case 4: lLoc = Location(Vector(1.0, 2.0, 3.0), 90.0); break;
}

CreateObject(OBJECT_TYPE_CREATURE, "st_respawn" + IntToString(i), lLoc);
}
}
}

Maxstate
08-13-2005, 05:12 PM
If the areas in question have OnEnter event scripts assigned this would be fairly easy to do.

Create your creature templates for the respawning monsters. Grab the coordinates where you wish the creatures to spawn. Then modify the OnEnter script to check if the creatures are present. If not, spawn them.

For example this script would spawn 4 creatures with the Tag and Resref set to st_respawn1, st_respawn2, st_respawn3 and st_respawn4 set in their templates, at the specified coordinates. But only if they don't already exist in the area. This would be done every time the player enters the area.


void main() {
if (GetEnteringObject() != GetFirstPC())
return;

object oRespawn;
location lLoc;

int i;
for (i = 1; i <= 4; i++) {
oRespawn = GetObjectByTag("st_respawn" + IntToString(i));
if (!GetIsObjectValid(oRespawn)) {
switch (i) {
// X Y Z Facing
// --- --- --- ------
case 1: lLoc = Location(Vector(1.0, 2.0, 3.0), 90.0); break;
case 2: lLoc = Location(Vector(1.0, 2.0, 3.0), 90.0); break;
case 3: lLoc = Location(Vector(1.0, 2.0, 3.0), 90.0); break;
case 4: lLoc = Location(Vector(1.0, 2.0, 3.0), 90.0); break;
}

CreateObject(OBJECT_TYPE_CREATURE, "st_respawn" + IntToString(i), lLoc);
}
}
}


Thanks for answering my question, but i dont know sh*t about scripting and/or coding. I dont know what to say, my brain feels like a big box of distortion. Ill come up with a witty reply tomorrow, thanks stoffe