Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Scripts-Spawning & the like

Page: 1 of 1
 Mandalore_The_Great
12-07-2008, 10:27 PM
#1
Hi. I tried this script:

void main() {
CreateObject( OBJECT_TYPE_CREATURE,
"n_sithsoldier004", GetLocation(GetFirstPC()))
object oNPC = GetObjectByTag("n_sithsoldier004");
ChangeToStandardFaction(oNPC, STANDARD_FACTION_HOSTILE_1);
}

and when I go to compile, it says there's a syntax error at object.... do you see any problems with it? thanks
 Robespierre
12-08-2008, 2:50 AM
#2
Shouldn't the 'object oNPC = GetObjectByTag("n_sithsoldier004");' line go before everything else?
 Istorian
12-08-2008, 3:05 AM
#3
Well, you have to say for which game this is. If it is for TSL, try this one:

void main()
{
object oPC = GetFirstPC();
location lPC = GetLocation(oPC);
object oNPC = GetObjectByTag("n_sithsoldier004");

CreateObject(OBJECT_TYPE_CREATURE, oNPC, lPC);

ChangeToStandardFaction(oNPC, STANDARD_FACTION_HOSTILE);
}


I think it is correct. If it isn't, go easy on me, cause I'm scripting away from my PC!:xp:
Hope this helps!;)

EDIT: Awwh, Robespierre cauht me on this one!:p

EDIT 2 : Such eyes, glovemaster! How could we miss that? I take a deep bow for you!:xp:


|I|
 Mandalore_The_Great
12-08-2008, 11:39 PM
#4
actually for K1
I tested this on end_trask dialogue when you first meet Trask.
So it should look like:
void main() {
CreateObject( OBJECT_TYPE_CREATURE,
object oNPC = GetObjectByTag("n_sithsoldier004");
"n_sithsoldier004", GetLocation(GetFirstPC()))
ChangeToStandardFaction(oNPC, STANDARD_FACTION_HOSTILE_1);
} That?
 Star Admiral
12-09-2008, 12:25 AM
#5
Use the script provided by Istorian, except change the constant from STANDARD_FACTION_HOSTILE to STANDARD_FACTION_HOSTILE_1. I assume that the constant STANDARD_FACTION_HOSTILE_1 was used in K1?

The scripting methods for K1 and TSL are almost identical, except for some differing constants and functions.

- Star Admiral
 Mandalore_The_Great
12-09-2008, 12:52 AM
#6
I found an old .nss file from the Call of Aid mod. I just used that and it works here it is:
void main()

{

CreateObject( OBJECT_TYPE_CREATURE,
"n_sithsoldier004", GetLocation(GetFirstPC()));

}

this can be closed if necessary
 glovemaster
12-09-2008, 4:42 PM
#7
If your interested, the real problem was because your line:
CreateObject( OBJECT_TYPE_CREATURE, "n_sithsoldier004",
GetLocation(GetFirstPC()))
was missing the end semi-colon ( ; ) ;)
CreateObject( OBJECT_TYPE_CREATURE, "n_sithsoldier004",
GetLocation(GetFirstPC()));
 Mandalore_The_Great
12-10-2008, 6:07 PM
#8
thank you, glovemaster
Page: 1 of 1