Darth Essence Posted October 31, 2007 Share Posted October 31, 2007 void main() { object oStud1 = GetObjectByTag("n_dan_student1"); object oStud2 = GetObjectByTag("n_dan_student3"); object oPC = GetFirstPC(); SendMessageToPC(oPC, "Executed"); ChangeToStandardFaction(oStud1, 11); ChangeToStandardFaction(oStud2, 12); SendMessageToPC(oPC, IntToString(GetStandardFaction(oStud1))); } K1 ... This should change the Faction of oStud1 to 11 .. but the SendMessage gives me a mystical -1 Faction ... :S .. why ? Link to comment Share on other sites More sharing options...
tk102 Posted October 31, 2007 Share Posted October 31, 2007 // 713: GetStandardFaction // Find out which standard faction oObject belongs to. // * Returns a mystical INVALID_STANDARD_FACTION if oObject does not belong to // a Standard Faction, or an error has occurred. The only two things I can think of is that "n_dan_student1" isn't a valid tag or that the commands may need delaying. Try inserting this after you initialize oStud1 to test the validity of your tag. if (!GetIsObjectValid(oStud1)) SendMessageToPC(oPC, "oStud1 is not valid"); If that doesn't generate an message in your feedback, try a DelayCommand of 0.2 on the ChangeToStandardFaction and a delay of 0.4 on the GetStandardFaction message line. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.