[set_variables] not supported at scenario toplevel

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
Soshen_
Posts: 13
Joined: May 12th, 2020, 12:01 pm

[set_variables] not supported at scenario toplevel

Post by Soshen_ »

Hi, I encounter an error when i try to set my arrays that say in the debug console "Error : [set_variables] is not supported at scenario toplevel (3)"
I've search in the wiki but I can't figure out my problem

so my 3 set_variables don't work but it seems to be the correct syntax, my code here:

Code: Select all

#define PLAYERS_STATS

[set_variables]     # Stuffs 
    name=equipped
    mode=replace
    [value]         # 0 Placeholder
        helmet=""
        torso=""
        legs=""
        boots=""
        cape=""
        hand=""
    [/value]
    [value]         # Leader 1
        helmet="1"
        torso=""
        legs=""
        boots=""
        cape=""
        hand=""
    [/value]
    [value]         # Leader 2
        helmet="2"
        torso=""
        legs=""
        boots=""
        cape=""
        hand=""
    [/value]
    [value]         # Leader 3
        helmet="3"
        torso=""
        legs=""
        boots=""
        cape=""
        hand=""
    [/value]
    [value]         # Leader 4
        helmet=""
        torso=""
        legs=""
        boots=""
        cape=""
        hand=""
    [/value]
    [value]         # Leader 5
        helmet=""
        torso=""
        legs=""
        boots=""
        cape=""
        hand=""
    [/value]
    [value]         # Leader 6
        helmet=""
        torso=""
        legs=""
        boots=""
        cape=""
        hand=""
    [/value]
[/set_variables]

[set_variables]     # Upgrade Count
    name=upcount
    mode=merge
    [value]         # 0 Placeholder
        hp=0
        mvmt=0
        m_strike=0
        m_damage=0
        r_strike=0
        r_damage=0
    [/value]
    [value]         # Leader 1
        hp=0
        mvmt=0
        m_strike=0
        m_damage=0
        r_strike=0
        r_damage=0
    [/value]
    [value]         # Leader 2
        hp=0
        mvmt=0
        m_strike=0
        m_damage=0
        r_strike=0
        r_damage=0
    [/value]
    [value]         # Leader 3
        hp=0
        mvmt=0
        m_strike=0
        m_damage=0
        r_strike=0
        r_damage=0
    [/value]
    [value]         # Leader 4
        hp=0
        mvmt=0
        m_strike=0
        m_damage=0
        r_strike=0
        r_damage=0
    [/value]
    [value]         # Leader 5
        hp=0
        mvmt=0
        m_strike=0
        m_damage=0
        r_strike=0
        r_damage=0
    [/value]
    [value]         # Leader 6
        hp=0
        mvmt=0
        m_strike=0
        m_damage=0
        r_strike=0
        r_damage=0
    [/value]
[/set_variables]

[set_variables]     # Leader Location
    name=leader_pos
    mode=replace
    [value]         # 0 Placeholder
        x=""
        y=""
    [/value]
    [value]         # Leader 1
        x=5
        y=21
    [/value]        # Leader 2
    [value]
        x=28
        y=4
    [/value]        # Leader 3
    [value]
        x=30
        y=1
    [/value]        # Leader 4
    [value]
        x=3
        y=24
    [/value]        # Leader 5
    [value]
        x=1
        y=21
    [/value]        # Leader 6 
    [value]
        x=32
        y=4
    [/value]
[/set_variables]
#enddef
white_haired_uncle
Posts: 1226
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: [set_variables] not supported at scenario toplevel

Post by white_haired_uncle »

put them in a start or prestart or ??? event.
Speak softly, and carry Doombringer.
Soshen_
Posts: 13
Joined: May 12th, 2020, 12:01 pm

Re: [set_variables] not supported at scenario toplevel

Post by Soshen_ »

Oh, i try to use arrays, i actually use variable to store values and this don't need to be in an event to initialize values, so i've think than set_variables don't need to.
Thanks to the answer, i've start wml juste 2 days ago ^^'
User avatar
Ravana
Forum Moderator
Posts: 3018
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: [set_variables] not supported at scenario toplevel

Post by Ravana »

[scenario] should not recognize [set_variable] either. If it currently happens to support it thats bug.
Soshen_
Posts: 13
Joined: May 12th, 2020, 12:01 pm

Re: [set_variables] not supported at scenario toplevel

Post by Soshen_ »

Thanks's for the precision Ravana. It's always better to know why it don't work then only know the solution ^^
Post Reply