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.

Faction Help

Page: 1 of 1
 Darth Essence
10-31-2007, 2:50 PM
#1
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 ?
 tk102
10-31-2007, 7:13 PM
#2
// 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.

:confused:
Page: 1 of 1