Using Number Variables Inside Conditional Branches

I'm having problems with trying to use a number variable to add to a global variable inside of conditional branches. It breaks my game every time I try and I have no clue what's going wrong. If I remove the number variable, everything plays smoothly. Is there something special I have to do?

Like, let's say that it's a situation where your character is trying to raise the affection of an NPC. So you come to a choice of giving this NPC a rose or a teddy bear. The rose is worth +5 affection points and the teddy bear is worth +3. You can only give one of each item to this NPC. So you set up the choices for Rose and Bear, with the jump to labels and all of that. We'll use rose in this example. So you click rose and it will perform a Jump to Label: Rose. This is how I would set up everything within that label:

label: Rose
Condition: If Switch L:0001 Rose = ON
Show Message: You already gave her a rose!
Else
Switch L:0001 Rose On
Show Message: You give her a rose.
NV: Variable G:0001 Affection Add Value 5
Jump To Label: Continue

Why does this break my game? If I remove the Number Variable bit, it will work perfectly. Am I doing something wrong or is it just not a capability of VN Maker to use Number Variables within Conditional Branches?
Are you using any extensions? I tried this and it works as expected (you can copy commands via right click -> copy as text too for forum posts. But with stuff like conditions put it inside a code bbcode):
Code:
Show Text | Number: 0 | Position: Predefined | Top-Left | Duration: 0ms | Continue
==========================
Label | Name: rose
==========================
Show Message | Character: Kaede | Voice: None | Expression Change: No Change | 250ms | Wait
--------------------------
Begin rose experiment
==========================
Condition | If: Switch | Variable: L[0001: Rose] | Is: Equal to | Value: ON
==========================
    Show Message | Character: Kaede | Voice: None | Expression Change: No Change | 250ms | Wait
    --------------------------
    You already gave her a rose
    ==========================
Else |
==========================
    Switch | Target: Switch | Switch: L[0001: Rose] | Value: ON
    ==========================
    Show Message | Character: Kaede | Voice: None | Expression Change: No Change | 250ms | Wait
    --------------------------
    You give her a rose
    ==========================
    Number Variable | Target: Variable | Variable: G[0001: Affection] | Operation: Add | Source: Value | Value: 5 |
    ==========================
    Show Message | Character: Kaede | Voice: None | Expression Change: No Change | 250ms | Wait
    --------------------------
    affection + 5
    ==========================
    Refresh Text | Number: 0
    ==========================
    Jump to Label | Name: rose
    ==========================
I have VN Maker and the DLC that came bundled with it (if you purchased it that way, which I did). I haven't downloaded any extensions, engines, etc. for it. And nothing I do works. Every time I hit the green play button to test it, as soon as I get to my choices, I pick one and the screen just goes black and the game won't proceed beyond that point.
I have VN Maker and the DLC that came bundled with it (if you purchased it that way, which I did). I haven't downloaded any extensions, engines, etc. for it. And nothing I do works. Every time I hit the green play button to test it, as soon as I get to my choices, I pick one and the screen just goes black and the game won't proceed beyond that point.

Show me the entire event code.
This is something similar to a bastardized version of getting the hookshot from the treasure chest (example from the VN Maker guide). It loops back through on itself to let you play with the choices. It works as well as the example does (which is to say, not perfectly, but well enough for its purpose) right up until I add in the Number Variable. Then it breaks as soon as I make a selection.
Code:
Show Message | Character: Unnamed | Voice: None | Expression Change: No Change | 250ms | Wait
--------------------------
Let's test this out.
==========================
Show Message | Character: Unnamed | Voice: None | Expression Change: No Change | 250ms | Wait
--------------------------
NPC's current affection level is {GN:1}.
==========================
Label | Name: Start
==========================
Show Message | Character: Unnamed | Voice: None | Expression Change: No Change | 250ms | Wait
--------------------------
We will now present you with some choices that will affect this variable in different, favorable ways.
==========================
Add Choice | Description: Choice 1 | On Select: Jump To | Label: Choice1 | Position: Auto | Default: No | Enabled: Yes
==========================
Add Choice | Description: Choice 2 | On Select: Jump To | Label: Choice2 | Position: Auto | Default: No | Enabled: Yes
==========================
Show Choices |
==========================
Label | Name: Choice1
==========================
Condition | If: Switch | Variable: L[0001: Choice1] | Is: Equal to | Value: ON
==========================
    Show Message | Character: Unnamed | Voice: None | Expression Change: No Change | 250ms | Wait
    --------------------------
    You already chose Choice 1.
    ==========================
Else |
==========================
    Switch | Target: Switch | Switch: L[0001: Choice1] | Value: ON
    ==========================
    Show Message | Character: Unnamed | Voice: None | Expression Change: No Change | 250ms | Wait
    --------------------------
    NPC likes choice 1!
    ==========================
    Number Variable | Target: Variable | Variable: G[0001: Affection] | Operation: Add | Source: Value | Value: 10 |
    ==========================
    Show Message | Character: Unnamed | Voice: None | Expression Change: No Change | 250ms | Wait
    --------------------------
    NPC's affection is now {GN:1}!
    ==========================
    Jump to Label | Name: Start
    ==========================
Label | Name: Choice2
==========================
Condition | If: Switch | Variable: L[0002: Choice2] | Is: Equal to | Value: ON
==========================
    Show Message | Character: Unnamed | Voice: None | Expression Change: No Change | 250ms | Wait
    --------------------------
    You already chose Choice 2.
    ==========================
Else |
==========================
    Switch | Target: Switch | Switch: L[0002: Choice2] | Value: ON
    ==========================
    Show Message | Character: Unnamed | Voice: None | Expression Change: No Change | 250ms | Wait
    --------------------------
    NPC loves choice 2!
    ==========================
    Number Variable | Target: Variable | Variable: G[0001: Affection] | Operation: Add | Source: Value | Value: 15 |
    ==========================
    Show Message | Character: Unnamed | Voice: None | Expression Change: No Change | 250ms | Wait
    --------------------------
    NPC's affection is now {GN:1}!
    ==========================
    Jump to Label | Name: Start
    ==========================

I'll be the first to admit that I could be missing something simple here, but it's driving me crazy that everything works until I put in a number variable and then the whole thing just dies.

Also, sorry, I have no idea how to put it into a code bbcode. :-/ I desperately avoid forums and posting on them, unless it's a last resort.
Okay, give me some time to figure this out.
I also merged your posts since we don't allow double posting.

EDIT:
@Soulfires
I found the problem. Basically click the Number Variable and Set Global Variable 1. It looks like it's selected by default and it's actually not. Once you do that on both choices it will work. This is a bug and I'll report it. 👋
2017-12-12_3-48-47.png
Ah! Something so simple! Thank you very much. 😀 This was driving me mad.
No worries! Glad it finally worked for you 😍

Original thread: https://forums.rpgmakerweb.com/threads/using-number-variables-inside-conditional-branches.88357/