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
Shouldn't the 'object oNPC = GetObjectByTag("n_sithsoldier004");' line go before everything else?
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|
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?
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
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
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()));