Jump to content

Home

Scripts-Spawning & the like


Recommended Posts

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

Link to comment
Share on other sites

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|

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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()))[color=red];[/color]

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...