Author Topic: teleport to leader script modification problem  (Read 480 times)

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #15 on: October 21, 2011, 06:10:36 pm »


               <genuinely...>

Would you post the entire script as it now is, please?

<...perplexed>
               
               

               
            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #16 on: October 21, 2011, 06:15:51 pm »


               *decides she's made enough changes to post the whole thing again, so people can find out where she's going wrong*

  void main ()
      {

   object oPC = GetPCSpeaker();
   object oLeader = GetFactionLeader(oPC);
   object oPButton = GetItemPossessedBy(oPC, "panicbutton");
   object oPBL = GetItemPossessedBy(oLeader, "panicbutton");


  if (((GetLocalInt(oPBL, "atlantisc")) ==TRUE) && ((GetLocalInt(oPButton, "atlantisc"))==TRUE))
       || (((GetLocalInt(oPBL, "atlantisb"))==TRUE) && ((GetLocalInt(oPButton, "atlantisb"))==TRUE))
       || (((GetLocalInt(oPBL, "atlantisa"))==TRUE) && ((GetLocalInt(oPButton, "atlantisa"))==TRUE))
       || (((GetLocalInt(oPBL, "atlantisa"))!=TRUE) && ((GetLocalInt(oPButton, "atlantisa"))!=TRUE))
               { AssignCommand(oPC, ActionJumpToObject(oLeader))};


       else if (((GetLocalInt(oPBL, "atlantisc"))==TRUE) && ((GetLocalInt(oPButton, "atlantisc"))!=TRUE)) ||
           (((GetLocalInt(oPBL, "atlantisb"))==TRUE) && ((GetLocalInt(oPButton, "atlantisb"))!=TRUE))
           || (((GetLocalInt(oPBL, "atlantisa")==TRUE) && ((GetLocalInt(oPButton, "atlantisa"))!=TRUE))

       SendMessageToPC(oPC, "You can't teleport to your leader with the current configuration of the atlantis progression.");
              return;
              }
              }
               
               

               
            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #17 on: October 21, 2011, 06:40:51 pm »


               Ok, found my problem..it was a set of parenthesis...got it working..thanks.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #18 on: October 21, 2011, 06:42:18 pm »


               <rolls up...>

Alassirana wrote...
if (((GetLocalInt(oPBL, "atlantisc")) ==TRUE) && ((GetLocalInt(oPButton, "atlantisc"))==TRUE))
       || (((GetLocalInt(oPBL, "atlantisb"))==TRUE) && ((GetLocalInt(oPButton, "atlantisb"))==TRUE))
       || (((GetLocalInt(oPBL, "atlantisa"))==TRUE) && ((GetLocalInt(oPButton, "atlantisa"))==TRUE))
       || (((GetLocalInt(oPBL, "atlantisa"))!=TRUE) && ((GetLocalInt(oPButton, "atlantisa"))!=TRUE))
               { AssignCommand(oPC, ActionJumpToObject(oLeader))};

Try this; remove this semi-colon...

else if (((GetLocalInt(oPBL, "atlantisc"))==TRUE) && ((GetLocalInt(oPButton, "atlantisc"))!=TRUE)) ||
           (((GetLocalInt(oPBL, "atlantisb"))==TRUE) && ((GetLocalInt(oPButton, "atlantisb"))!=TRUE))
           || (((GetLocalInt(oPBL, "atlantisa")==TRUE) && ((GetLocalInt(oPButton, "atlantisa"))!=TRUE))

       SendMessageToPC(oPC, "You can't teleport to your leader with the current configuration of the atlantis progression.");
              return;
              }
              }

Change this part to:

else if (((GetLocalInt(oPBL, "atlantisc"))==TRUE) && ((GetLocalInt(oPButton, "atlantisc"))!=TRUE)) ||
(((GetLocalInt(oPBL, "atlantisb"))==TRUE) && ((GetLocalInt(oPButton, "atlantisb"))!=TRUE))
|| (((GetLocalInt(oPBL, "atlantisa")==TRUE) && ((GetLocalInt(oPButton, "atlantisa"))!=TRUE))
    {
        SendMessageToPC(oPC, "You can't teleport to your leader with the current configuration of the atlantis progression.");
        return;
    }


<...his sleeves>
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #19 on: October 21, 2011, 11:53:26 pm »


               Sorry if I wasn't spot on with that. I thought it might get some decent scripters in here to fix it all up. Apparently that worked. I was just tossing out the general structural idea. I think I divined correctly though that you were going to be using an item with the variables on it, really probably the best way to do it. So will the items have multiple variables on them, or just one of the above? That could cause some problems or unexpected results. So anytime a variable is progressed the old varible would be deleted, correct?  LF was asking that too. Just something to keep in mind.
Perhaps in the future you may want to consider just using a variables you can increment or decrement, say atlantis set to 1, then 2, then 3, etc...In this way you would be just checking the value of the variable, not comparing multiple variables with similar names, usually an easy way to make a mistake.
For instance in my notoriety system you gain/lose notoriety based on variious actions.  Npc's will respond to you differently based on that notoriety.  Not a perfect example as relates to this script problem. 

Oh I sort of liked the 'current configuration of the atlantis progression', it has a nice ring to it.  Don't know if that fits or not just off the top of  my head.
Yeah parenthesis and ellipsis, look similar.  
               
               

               


                     Modifié par ffbj, 21 octobre 2011 - 11:08 .
                     
                  


            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #20 on: October 22, 2011, 12:06:35 am »


               The item contains the variables for every city that you can teleport to (except the first, everyone can port there automatically)...you use the item to port to the nexus, and then you start a conversation with the portal, which offers what cities are available to you at that time, and ports you there, all controlled by the variables on the item.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #21 on: October 22, 2011, 12:11:48 am »


               Right but the specific ones for this script is what matters.  The ones where you are comparing the Leaders to your own, not the individual towns.  Just thinking for the atlantis part which in that case you would only have 1 atlantis variable at a time, or is that wrong.  Could you have more that 1 atlantis variable concurrently, at the same time?
               
               

               
            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #22 on: October 22, 2011, 12:21:08 am »


               I have it where you can have more than one...but the second and third one just supercede  on where you're being sent to.