Mandalore_The_Great Posted December 8, 2008 Share Posted December 8, 2008 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 More sharing options...
Robespierre Posted December 8, 2008 Share Posted December 8, 2008 Shouldn't the 'object oNPC = GetObjectByTag("n_sithsoldier004");' line go before everything else? Link to comment Share on other sites More sharing options...
Istorian Posted December 8, 2008 Share Posted December 8, 2008 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! Hope this helps! EDIT: Awwh, Robespierre cauht me on this one! EDIT 2 : Such eyes, glovemaster! How could we miss that? I take a deep bow for you! |I| Link to comment Share on other sites More sharing options...
Mandalore_The_Great Posted December 9, 2008 Author Share Posted December 9, 2008 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? Link to comment Share on other sites More sharing options...
Star Admiral Posted December 9, 2008 Share Posted December 9, 2008 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 More sharing options...
Mandalore_The_Great Posted December 9, 2008 Author Share Posted December 9, 2008 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 Link to comment Share on other sites More sharing options...
glovemaster Posted December 9, 2008 Share Posted December 9, 2008 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 More sharing options...
Mandalore_The_Great Posted December 10, 2008 Author Share Posted December 10, 2008 thank you, glovemaster Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.