[Suggestion] Switch Statement

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

jan12342203
Posts: 65
Joined: Sat, 14. May 16, 22:13
x4

[Suggestion] Switch Statement

Post by jan12342203 »

can we get the c++ like switch statement for modding?
would be a really nice addition.. thanks for the great work..

Greetings...
kuertee
EGOSOFT
EGOSOFT
Posts: 818
Joined: Sun, 14. Dec 03, 13:05
x4

Re: [Suggestion] Switch Statement

Post by kuertee »

i think we can simulate it as such:

Code: Select all

<cue name="switch">
    <conditions>
        <event_cue_signalled />
    </conditions>
    <cues>
        <cue name="case_a">
            <conditions>
                <check_value value="$var == $a" />
            </conditions>
            <actions>
                <debug_text text="$var" />
            </actions>
        </cue>
        <cue name="case_b">
            <conditions>
                <check_value value="$var == $b" />
            </conditions>
            <actions>
                <debug_text text="$var" />
            </actions>
        </cue>
    </cues>
</cue>
jan12342203
Posts: 65
Joined: Sat, 14. May 16, 22:13
x4

Re: [Suggestion] Switch Statement

Post by jan12342203 »

looks interesting.. but i work with these ai scripts..
but for md..

Return to “X4: Foundations - Scripts and Modding”