Aller au contenu

Photo

teleport to leader script modification problem


  • Veuillez vous connecter pour répondre
22 réponses à ce sujet

#1
Alassirana

Alassirana
  • Members
  • 55 messages
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

#2
SuperFly_2000

SuperFly_2000
  • Members
  • 1 004 messages
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...

#3
Alassirana

Alassirana
  • Members
  • 55 messages
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

#4
ffbj

ffbj
  • Members
  • 593 messages
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 .


#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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.

#6
Alassirana

Alassirana
  • Members
  • 55 messages
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

#7
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
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.

#8
Alassirana

Alassirana
  • Members
  • 55 messages
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

#9
Alassirana

Alassirana
  • Members
  • 55 messages
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.

#10
Alassirana

Alassirana
  • Members
  • 55 messages
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

#11
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<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 .


#12
Alassirana

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

#13
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<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>

#14
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<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>

#15
Alassirana

Alassirana
  • Members
  • 55 messages
Yes.
{ AssignCommand (oPC, ActionJumpToObject(oLeader))};

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

#16
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<genuinely...>

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

<...perplexed>

#17
Alassirana

Alassirana
  • Members
  • 55 messages
*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;
}
}

#18
Alassirana

Alassirana
  • Members
  • 55 messages
Ok, found my problem..it was a set of parenthesis...got it working..thanks.

#19
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<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>

#20
ffbj

ffbj
  • Members
  • 593 messages
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 .


#21
Alassirana

Alassirana
  • Members
  • 55 messages
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.

#22
ffbj

ffbj
  • Members
  • 593 messages
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?

#23
Alassirana

Alassirana
  • Members
  • 55 messages
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.