View Single Post
Old 05-18-2012, 12:34 AM   #195
Fallen Guardian
@Fallen Guardian
Wandering the Galaxy...
Fallen Guardian's Avatar
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,294
Current Game: XCOM 2
Veteran Modder  Helpful! 
I've brought more scripting woes. Anyway, here's a long userdefined script of mine (Ignore the poor spacing... please.):

void main()
	object oNPC = GetObjectByTag("n_comm");

	object oNPC1 = GetObjectByTag("n_merc01");

     object oNPC2 = GetObjectByTag("n_merc02");

     object oNPC3 = GetObjectByTag("n_laz");

     object oNPC4 = GetObjectByTag("n_kar");

     object oPM1 = GetPartyMemberByIndex(1);

     object oPM2 = GetPartyMemberByIndex(2);

     object oPM3 = GetPartyMemberByIndex(0);

    object oPC = GetFirstPC();

    int nCurrentHP;
    int nUser = GetUserDefinedEventNumber();
    if(nUser == 1006)
       if (nCurrentHP<2) {

           ChangeToStandardFaction(OBJECT_SELF, 9);
      AssignCommand(OBJECT_SELF, ClearAllActions());
           CancelCombat (oNPC);
      AssignCommand(OBJECT_SELF, ClearAllEffects());
          SetLocalBoolean(OBJECT_SELF, 21, TRUE);
     AssignCommand(oNPC, ActionPlayAnimation(26, 1.0, (145.0)));
  AssignCommand(oNPC, SetLockOrientationInDialog(oNPC, TRUE));
   DelayCommand(0.2, SetCommandable(FALSE, oNPC));

	GetIsDead(oNPC1) &&
	GetIsDead(oNPC2) ) {

 ExecuteScript("dt_fadeout", OBJECT_SELF);


  DelayCommand(2.0, AssignCommand((GetObjectByTag("n_ethan")), ActionDoCommand(ActionStartConversation(oPC))));

   DelayCommand(0.2, SetCommandable(FALSE, oNPC));


if (GetIsDead(oNPC1))

 AssignCommand(oNPC3, ActionAttack(oNPC2));
 AssignCommand(oNPC4, ActionAttack(oNPC2));
 AssignCommand(oPM1, ActionAttack(oNPC2));
 AssignCommand(oPM2, ActionAttack(oNPC2));
 AssignCommand(oPM3, ActionAttack(oNPC2));


 AssignCommand(oNPC3, ActionAttack(oNPC1));
 AssignCommand(oNPC4, ActionAttack(oNPC1));
 AssignCommand(oPM1, ActionAttack(oNPC1));
 AssignCommand(oPM2, ActionAttack(oNPC1));
 AssignCommand(oPM3, ActionAttack(oNPC1));


The main issue with this lies in the last conditional at the bottom. The compiler tells me I have a syntax error at else.

Any ideas?

The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,