View Single Post
Old 09-26-2011, 04:42 AM   #15
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,465
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Ok Fallen, I am still not sure what the problem was with our earlier stuff, so forgive me for just cut & pasting it here. Perhaps you have figured out what the problem was with the door itself.

While zbyl2 has presented you with a solid means to skin the cat, and one that I was not aware existed (thanks zbyl2!), here is another way. This compiles fine, I think the logic works, and except for the original problem this should, with minor tweaking, work for you.

What I would like to ask the more knowledgable - how would I subroutine-ize the repeated portion of the code, so that I could just have the main script call it twice rather than having the text there for both instances of use? I know I would need to consolidate variables by making oParty (or oParty2, being arbitrary) be assigned to the regular (non-custom) party member. I had tried to do just that, but I am doing something wrong when I try to make subroutines... I think it has to do with where I am declaring my variables

Anyway, here ya go!
Code:
void main()
{
   object oPC=GetFirstPC();
   object oCustom=GetObjectByTag("p_avix");
   object oParty=GetNextPC();
   object oParty2=GetNextPC();
   object oDoor=GetObjectByTag("man26ad_door02");

   if ((oParty != oCustom) && (oParty2 != oCustom))
   {
      SendMessageToPC(oPC,"Something's screwy around here");
   }
   else
   {
      if (oParty != oCustom)
      {
         ActionPauseConversation();
         SetCommandable(TRUE,oDoor);
         SetCommandable(TRUE,oCustom);
         SetCommandable(TRUE,oParty);
         SetCommandable(TRUE,oPC);
         AssignCommand(oDoor, ActionOpenDoor(oDoor));
         ActionWait(1.0);
         AssignCommand(oPC, ActionForceMoveToLocation (Location(Vector(420.65048, 164.75064, 8.00), 0.0)));
         AssignCommand(oCustom, ActionForceMoveToLocation (Location(Vector(423.07117, 163.83559, 8.00), 0.0)));
         AssignCommand(oParty, ActionForceMoveToLocation (Location(Vector(419.32086, 165.04903, 8.00), 0.0)));
         DelayCommand(5.0, AssignCommand(oDoor, ActionCloseDoor(oDoor)));
         ActionResumeConversation();   
      }
      else 
      {
         ActionPauseConversation();
         SetCommandable(TRUE,oDoor);
         SetCommandable(TRUE,oCustom);
         SetCommandable(TRUE,oParty2);
         SetCommandable(TRUE,oPC);
         AssignCommand(oDoor, ActionOpenDoor(oDoor));
         ActionWait(1.0);
         AssignCommand(oPC, ActionForceMoveToLocation (Location(Vector(420.65048, 164.75064, 8.00), 0.0)));
         AssignCommand(oCustom, ActionForceMoveToLocation (Location(Vector(423.07117, 163.83559, 8.00), 0.0)));
         AssignCommand(oParty2, ActionForceMoveToLocation (Location(Vector(419.32086, 165.04903, 8.00), 0.0)));
         DelayCommand(5.0, AssignCommand(oDoor, ActionCloseDoor(oDoor)));
         ActionResumeConversation();   

      }
   }
}


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa

Last edited by Qui-Gon Glenn; 09-26-2011 at 04:55 AM.
Qui-Gon Glenn is offline   you may: quote & reply,