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

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
teleport to leader script modification problem
« on: October 20, 2011, 09:26:01 pm »


               Ok, as a background, I'm trying to have 3 versions of atlantis (before, during, and after the fall) available to pc adventurers, but do not want to have them able to go back and forth between versions...they can only progress.  I have most of this figured out, but am unsure of how to modify the basic bioware teleport to leader script to do what I need.  Here is the requirements, as far as I can tell:

If Party Leader has atlantisc variable on their panic buttons, *and* pc in question has the same variable, they can teleport to leader as usual...
If party leader has atlantisb (but not atlantisc) *and* pc has the same or higher variable, they can teleport as usual...
if party leader has atlantisa (but not higher) *and* pc has the same variable or higher, they can port...
if the party leader, however, has a higher variable than the pc trying to port, the porting won't go through and there will be a message saying why...
And, of course, if neither party has any of the atlantis variables, they can port as usual.

This is kinda a complex if/and script, and I'm not sure I know how to code it myself...can someone help me with that?

Alassirana
               
               

               
            

Legacy_SuperFly_2000

  • Hero Member
  • *****
  • Posts: 1292
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #1 on: October 20, 2011, 09:39:51 pm »


               I'm not so super good with scripting. I usually avoid it as much as possible so you should probably wait for some of the other gurus to post here.

Meanwhile I'll just write what I would do and that is not very complex.

Just use the normal TP script....but then also a conversation where you check for which of the three versions it is....

...but again...if you want something more complex...hopefully someone else can help you...
               
               

               
            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #2 on: October 20, 2011, 09:46:37 pm »


               This is all supposed to be in the teleport to leader option of the existing nexus conversation...so I can't really add in another conversation, unfortunately...But thanks for trying to help.

Alassirana
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #3 on: October 20, 2011, 11:57:07 pm »


               It's really pretty easy you just have to compare two things, the variables on the party leader and the activator of the device or the conversation speaker.  What do you have so far for a script?
So panic buttons indicate the variables on an item in the PC's possesson,or a converstion node? Just wondering since panic button just is not enough of a definition, as conversations cannot be started while in combat, which might be one reason to panic.  Anyway probably easier to use something like my teleport to party leader method and alter it, then put it into a conversation node.
http://nwvault.ign.c....detail&id=2345

Oh, and just pointing out what may be obvious and abundantly clear to you is not necessarily so to others.
but you could probably do it with just a few lines.

        object  oPC =  GetPCSpeaker();
        object oPCL = GetFactionLeader(oPC);
        //object oItem ToCheck = GetItemPossessedBy(oPC, "tagofitem"); if the varibles are on an item. then  instead you would have to add one for each the oPC and the oPCL and check them against eachother.
 if (((GetLocalInt(oPCL, "variable")==TRUE) && (GetLocalInt(oPC, "variable")==TRUE) || (GetLocalInt(oPC, "variableA")==TRUE)))//just add or for additional varibles
         {
         AssignCommand(oPC, JumpToObject(oPCL));
         }
        else if //restate the case for other variable on leader etc...
//if failure occurs, the variables don't allow the teleportation
  {
               SendMessageToPC(oPC, "You can't teleport to your leader with the current configuration of the atlantis pr-gression.");
               return;
                }
               
               

               


                     Modifié par ffbj, 20 octobre 2011 - 11:28 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #4 on: October 21, 2011, 12:31:15 am »


               

Alassirana wrote...

 If Party Leader has atlantisc variable on their panic buttons, *and* pc in question has the same variable, they can teleport to leader as usual...
If party leader has atlantisb (but not atlantisc) *and* pc has the same or higher variable, they can teleport as usual...

 This is kinda a complex if/and script, and I'm not sure I know how to code it myself...can someone help me with that?

Alassirana


Hmm,  It sounds like you have crafted your own complexity.    If I am reading what you are saying correctly you have three different varaiavbles on your PC's  atlantisa atlantisb   and atlantisc,   instead of just having one variable 'atlantis' set to state 1, 2, or 3.    With the last  [1,2,3] states set on the same varaiable all you would have to do is make sure that they are the same.   

If ( GetAtlantisState(oPC1) ==  GetAtlantisState(oPC2) )   AllowTransport();

With the three vars it just gets a little more messy;

if var one will always be set if var 2 is set and var2  will always be set if var two is set if  var 3 is set.  I think I would just added them all together for each PC then compair them to see if they are equal.  

if ( GetVar1(oPC1) +GetVar2(oPC1) + GetVar3(oPC1)  == GetVar1(oPC2) +GetVar2(oPC2) + GetVar3(oPC2) )  AllowTransport();

But is is hard to give advice when we do not really know what your vars are and what they are set to.   the Multi var line above only really works if you are only setting then to true or false.   and if that is what you are doing you may want to think about converting you system to the one var method,  but that could be a lot of work if you have already have a lot of scripts using the three vars.
               
               

               
            

Legacy_Alassirana

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


               I've only started working with 3 variables, it wouldn't be hard to change, but that's all I really know right now...the conversation node I'm in specifically is 'take pc to party leader'...with the script I'm wanting in the actions taken tab.  What ffbj has looks like I can use that fairly simply enough, just plug in the specific items/variables for everything, and it should work.  Thanks for the help.

Alassirana
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #6 on: October 21, 2011, 01:26:08 am »


               I hate to dissagree,  I fully respect ffbj's scripting,  But he had a brain fart on the logic here.  His conditional:
if (((GetLocalInt(oPCL, "variable")==TRUE) && (GetLocalInt(oPC, "variable")==TRUE) || (GetLocalInt(oPC, "variableA")==TRUE)...))

would return TRUE if both PC's have var 1 set on them reguardles of if either or both have the next var set.   His logic will only work if the PC can only have one of the vars set at a time.  I just do not know if that is the case in your system or not.
               
               

               
            

Legacy_Alassirana

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


               Ok...I wasn't entirely awake when I posted last time, however, first:  local variables are on panic buttons (an item in everyone's inventory)...second:  once you've been to the first atlantis (atlantisa) you get that variable..when you move to doing the quest for the fall, you get atlantisb in addition, and finally, when you've finished the fall, you get atlantisc in addition...I think that's what the script says...So, if I start with the highest variable ©, it should check first to see if those match, if neither has that variable, it goes to the next variable down, and so on until it either finds a match or a discrepency...that's the best way I know how to do this...if I knew how to do the states on local variables on an item in the players inventory, that may change it, but this is the best I know how at the moment..

Alassirana
               
               

               
            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #8 on: October 21, 2011, 05:33:57 pm »


               Ok, this is what I have, but I keep getting an invalid declaration type on the first part of the first if statement (which means that probably all parts of it have the same problem)...what am I doing 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, JumpToObject(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;
              }
              }



Thanks in advance for your help.
               
               

               
            

Legacy_Alassirana

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


               Actually, found the first error (the missing { ) but now I'm having a problem with any line that says !=TRUE....is there a better way to do that part?

Alassirana
               
               

               
            

Legacy_Rolo Kipp

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


               <shyly pointing to...>

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, JumpToObject(oLeader));
       }

Add another = ;-)

<...an empty spot>
               
               

               


                     Modifié par Rolo Kipp, 21 octobre 2011 - 04:43 .
                     
                  


            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
teleport to leader script modification problem
« Reply #11 on: October 21, 2011, 05:49:09 pm »


               Ok, got that....now I'm having problems with the { AssignCommand(oPC, JumpToObject(oLeader));
               
               

               
            

Legacy_Rolo Kipp

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


               <checking to see...>

Only thing I can think of at the moment is to put in a check to make sure oLeader is a valid object and that oPC is commandable.

I don't see anything wrong with the function call.

What do feedback do you get?

<...if the coin is wooden>
               
               

               
            

Legacy_Rolo Kipp

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


               <picking...>

Alassirana wrote...
 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);

You took out this semi-colon?

<...nits>
               
               

               
            

Legacy_Alassirana

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


               Yes.
               { AssignCommand (oPC, ActionJumpToObject(oLeader))};

This is giving me a (no right bracket on expression) error...