Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Remote Self Switch Conditional Branch Issue

Status
Not open for further replies.

BlacksmithMV

Villager
Xy$
0.00
Good day to you, MV.co! I've got a problem that I've been struggling with for hours, to no avail.

I'm in the market for using a conditional branch to determine whether or not the self switch of another event is on or off. So I used the following in the conditional branch:

$gameSelfSwitches.setValue[1, 3, 'A'], true == true

Else, $gameSelfSwitches.setValue([1, 3, 'A'], false);

But the conditional branch does not react even when the Self Switch of that event is ON. If I write the conditional branch as follows:

$gameSelfSwitches.setValue[1, 3, 'A'], true == false

Then it thinks that the switch is ON, even though it's actually OFF.

My analysis is that I'm inputting the conditions incorrectly. But since I don't know much about Javascript and pretty much scavenged information from things like the script call, I can't fix it on my own. Someone please enlighten me ASAP. I'd like to get this issue done with so I can move on with the critical game aspect it's involved with- not to mention several important concepts revolving around remote Self Switch control.
 

Robert Lee

Villager
Xy$
0.00
Please understand that I know nothing about Script programming but I think I might see a problem simply by relying on my english.....

you are using code which includes setValue, I think you need something like checkValue..... the word set says to me that this is how you change the value and not how you look it up!

Of course I could be completely wrong. Things aren't always logical.
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
$gameSelfSwitches.setValue[1, 3, 'A'], is setting the value not checking what it is, in order to see what the current value is you need to use
JavaScript:
$gameSelfSwitches.value([mapId, eventId, switchLetter])
Which should return true or false.
 

BlacksmithMV

Villager
Xy$
0.00
$gameSelfSwitches.setValue[1, 3, 'A'], is setting the value not checking what it is, in order to see what the current value is you need to use
JavaScript:
$gameSelfSwitches.value([mapId, eventId, switchLetter])
Which should return true or false.
Ah! Thank you so much; I needed this. Because as Robert pointed out, "setValue" wasn't what I was supposed to use. I've run a test on it and it seems it works! Perfectly. I'm so glad!
 

Dad3353

Praised Adventurer
$gameSelfSwitches.setValue[1, 3, 'A'], is setting the value not checking what it is, in order to see what the current value is you need to use
JavaScript:
$gameSelfSwitches.value([mapId, eventId, switchLetter])
Which should return true or false.

Is it worth pointing out, for us beginners, that the map id is its number, not its name, as is the event id. The switch letter is between inverted commas. An example could be: $gameSelfSwitches.value([1, 2, 'A'])
It took me several goes to get this right; my very first script call. An example is always helpful when one is starting out in these giddy spheres.
Just sayin'.
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
My next tutorial is all about script calls and understanding them, I'm glad you brought this up. I usually do give out some examples when answering a support question but I've been so busy lately. I'm glad you figured it out though lol.
Just to add some more info about this, whenever something in MV is requesting an 'id' it will always be a number, eg itemId, skillId, etc will be the number the item is in the database.
 
Status
Not open for further replies.
Top