Growing different vine ropes seperate

I am trying to make vines that can grow a 2 space rope up a wall. I have set it so you interact with bottom plant and it should only grow the vine above it. But it grows the vine to the side two.
1669143992820.png

Currently the event coding on the base plant is:
1669143897871.png

Then the 2nd page turns itself off via self switch A and and the plant turns into the base of the vine so you climb up.
The event above it turns onto 2nd event page since the Plant rope switch has been turned on, so it is part of the climbable vine, but so does the one next to it on the right and I dont want that to trigger unless it from the plant below it.
How can I make it that the plant on the left only triggers the vine event above it and not the one at the top right?
How can I make it that the plant on the left only triggers the vine event above it and not the one at the top right?
It's impossible for us to say for sure without actually seeing the event that's malfunctioning.

But my presumption is that you've used the same switch 9 to control both of those upper-level vines.

Logically, if you don't want them to do the same things, you need to make them controlled by two different switches.
It's impossible for us to say for sure without actually seeing the event that's malfunctioning.

But my presumption is that you've used the same switch 9 to control both of those upper-level vines.

Logically, if you don't want them to do the same things, you need to make them controlled by two different switches.
I do want avoid making copies of the same switch in the list if I can help it. Below is the event that is the problem. As I said. I want Plant A to only trigger Vine A to change event page so it can be climbed and it always triggers Vine B while still using the same Switch 9.
1669145737875.png
Below is the event that is the problem.
As you can see, it's exactly what I suggested - it's triggered by switch 9.

I do want avoid making copies of the same switch in the list if I can help it.
If you want two different events to do things at different times, they have to have different conditions. That's just fundamental programming logic.

There's a script call you can use to set each event's self-switch and avoid using any of your global switches, but I'd recommend you get more fluent with the basic eventing functionality before you start throwing in more advanced things.
Code:
$gameSelfSwitches.setValue([mapId, eventId, 'letter'], true/false)
I have a free lesson about switches on my game tutorial, which you can play for free in the browser.

It explains everything you need to know about how switches and self switches do in-game.

ATT_Turan have explained everything. You need to check which switch is being activated by which event and which event is being affect by this switch. You can also use the script call if you prefer, but it's not recommended for complete beginners.
I have a free lesson about switches on my game tutorial, which you can play for free in the browser.

It explains everything you need to know about how switches and self switches do in-game.

ATT_Turan have explained everything. You need to check which switch is being activated by which event and which event is being affect by this switch. You can also use the script call if you prefer, but it's not recommended for complete beginners.
Appreciate the vid and will watch sometime. I can understand that the 2 different vines are on same switch, and I have tried messing with it but didn't know how to make Vine part A different from Vine part B

1669148052870.png

From what I am understanding this does work. The code I think is rightly changed from ATT_Turan provided, but I don't know how to make Vine grow1 know it is being triggered. If that makes sense?
I can understand that the 2 different vines are on same switch, and I have tried messing with it but didn't know how to make Vine part A different from Vine part B
By making them not use the same switch! You make Vine part A have a condition of, say, switch 9, and Vine part B have a condition of switch 10. Then the events underneath them, Base A and Base B, refer to the appropriate switch.

The code I think is rightly changed from ATT_Turan provided, but I don't know how to make Vine grow1 know it is being triggered.
That's misusing that script call. You've typed in names where it says to put IDs and you also have the switch 9 being used above it.

I only included the code alternative for sake of giving a complete answer - I recommend again that you delete it and just very simply use two different switches for the two different vines. There's no way that using one more of your global switches is going to have any negative effect on your game project.

But anyway, I've contributed what help I can...good luck with your project.
There is an in-between option open to you but it's also getting into more advanced concepts, and as ATT_Turan said you may want to avoid such things until you have a fuller understanding of them.

What you could do is store your vine states in the variable as an *array*, so you'd only need one game variable to track every vine in the game. That would require remembering which index goes with which vine, though.
By making them not use the same switch! You make Vine part A have a condition of, say, switch 9, and Vine part B have a condition of switch 10. Then the events underneath them, Base A and Base B, refer to the appropriate switch.


That's misusing that script call. You've typed in names where it says to put IDs and you also have the switch 9 being used above it.

I only included the code alternative for sake of giving a complete answer - I recommend again that you delete it and just very simply use two different switches for the two different vines. There's no way that using one more of your global switches is going to have any negative effect on your game project.

But anyway, I've contributed what help I can...good luck with your project.
I appreciate the help greatly and mean no disrespect to the time you spent for it. I do struggle with programming at times and learning hands on in trial and error/research is how I learn. Making seperate switches would likely be easier, just wished to see if there were other ways aswell to reduce cluttering the list of switches.

Thanks again and good luck with your own work!
There is an in-between option open to you but it's also getting into more advanced concepts, and as ATT_Turan said you may want to avoid such things until you have a fuller understanding of them.

What you could do is store your vine states in the variable as an *array*, so you'd only need one game variable to track every vine in the game. That would require remembering which index goes with which vine, though.
If I may ask; how would that look in the event pages of the Vine base trigger and the event it triggers? Sorry if that is asking a bit much, I just struggling to understand a bit.
As Trihan said above, if you don't already know what an array is then DON'T use them.

Arrays are an advanced form of mathematics and programming, and if you already have problems understanding that you need two different switches for two different events, then you will never get arrays right.

Because you would use arrays to hide the fact that you are using two different switches - which is where the comment that you have to remember which switch has which index comes from.

To better understand that comparison, just assume that the switches are two physical switches on the wall.
you will always use two different switches for those two events. By following Trihan's suggestion you would just put a blackk cloth over both switches, forcing you to blindly fumble for the right switch with your hand below the cloth where you can't see either switch.
It can be done that way and would hide the switch from yourself.

But since the players never see the internal switch, it would make no difference for them and only complicate your own work.
As Trihan said above, if you don't already know what an array is then DON'T use them.

Arrays are an advanced form of mathematics and programming, and if you already have problems understanding that you need two different switches for two different events, then you will never get arrays right.

Because you would use arrays to hide the fact that you are using two different switches - which is where the comment that you have to remember which switch has which index comes from.

To better understand that comparison, just assume that the switches are two physical switches on the wall.
you will always use two different switches for those two events. By following Trihan's suggestion you would just put a blackk cloth over both switches, forcing you to blindly fumble for the right switch with your hand below the cloth where you can't see either switch.
It can be done that way and would hide the switch from yourself.

But since the players never see the internal switch, it would make no difference for them and only complicate your own work.
Thanks for explaining it. Yes that sounds more complicated than what I needed, the goal I was trying to understand is if it was possible to use a single named switch for the same purpose across different events triggering only a selected receiver (This case, make wall above this event grow a vine.) But now I get that this is not possible, I was just wishing to understand if it WAS possible. But it seems easier just to make an extra switch instead with the same purpose.
Thanks for explaining it. Yes that sounds more complicated than what I needed, the goal I was trying to understand is if it was possible to use a single named switch for the same purpose across different events triggering only a selected receiver (This case, make wall above this event grow a vine.) But now I get that this is not possible, I was just wishing to understand if it WAS possible. But it seems easier just to make an extra switch instead with the same purpose.
Yeah, for sure the easiest option here is to just use an additional switch. You get enough of them for your game that it shouldn't make a huge difference to your overhead, but unfortunately a switch can only be either on or off, and if you have two different things that respond to the same switch, their state will always be the same as each other. That's just how binary logic works.
It feels like you're massively over complicating this, so I've done a diagram of the simplest way to do this:

1669158313460.png


Don't even use self switches. There's no point, if you're already using Switch 9 you may as well have both of them activated with this.

Then if you wanted to have the next vine over do the same thing you'd use a different switch (in this case, Switch 10)

1669158496807.png


Sure, it costs an extra switch, but it feels like keeping it simple might benefit you here. Anyway, I hope the above makes sense. Keep it simple until you're ready to progress beyond that point!
It feels like you're massively over complicating this, so I've done a diagram of the simplest way to do this:

View attachment 245696

Don't even use self switches. There's no point, if you're already using Switch 9 you may as well have both of them activated with this.

Then if you wanted to have the next vine over do the same thing you'd use a different switch (in this case, Switch 10)

View attachment 245697

Sure, it costs an extra switch, but it feels like keeping it simple might benefit you here. Anyway, I hope the above makes sense. Keep it simple until you're ready to progress beyond that point!
Thanks. Got that impression already from the ppl here, and seeming not possible to do what I was hoping to do from a single switch.
Thanks. Got that impression already from the ppl here, and seeming not possible to do what I was hoping to do from a single switch.

Not without adding a bunch of complication, and at this point if the saving is a single switch then I don't think it's worth the savings.
Not without adding a bunch of complication, and at this point if the saving is a single switch then I don't think it's worth the savings.
I can kind of see where the overhead concern was coming in if OP intends on having a bunch of these in the game, since each one will require its own switch.
I can kind of see where the overhead concern was coming in if OP intends on having a bunch of these in the game, since each one will require its own switch.

Even so, we don't have the full brief here - like, OP, should these be exclusive? Like you can't have them both grown at once?

I can see the issue with overheads, but at the same time we don't know how long the game is, how many of these there are gonna be, as such I figured I'd state the simplest way to do that, and if it's that much of a concern we can always sort him with a more finessed solution 🙂
If he does not want to use multiple Global Switches for this, than he could utilise
the Self Switches A to D of each Event. Like the others mentioned.
Every Event got its own set of those Switches, they are only for that Event.
But it is possible to Activate Self Switches of other Events with Scriptline,
thatway he could avoid Global Switches completely.

The following quick example Event is using the Eventcommand "Get Location Info" to Check
if an Event Id is 1 Maptile above the clicked Event and than activates the Self Switch A of that Event.

Code:
◆Control Variables:#0003 magic_x = Map X of This Event
◆Control Variables:#0004 magic_y = Map Y of This Event
◆Control Variables:#0004 magic_y -= 1
◆Control Variables:#0010 Var10_GetInfo = 0
◆Get Location Info:Var10_GetInfo, Event ID, ({magic_x},{magic_y})
◆If:Var10_GetInfo > 0
  ◆Script:$gameSelfSwitches.setValue(
  :      :[this._mapId, $gameVariables.value(10), 'A'], true);
  ◆
:End

The Variables 3, 4 and 10 can be reused for every Event of this kind.
You want 100 of those growing Plants, just copy paste it 100 times, no Editing needed.

Not sure if this kind of solution attempt is what you were looking for.

Edit:
Having less Switches is not the main Goal with this, having less to non Code to Edit while Level Building
is the awesome thing for me. And the workload for the Developer does not increase when he upscales it by using it very often and on many Maps.

Original thread: https://forums.rpgmakerweb.com/threads/growing-different-vine-ropes-seperate.152837/