Map Editor: Needing Help Regarding Variables

Report any bugs here or ask questions here!

Map Editor: Needing Help Regarding Variables

Postby Cemom » 23 January 2022, 00:08

Hello,
I wanted to create a template map where I allow any commands from the Campaign to work (except for "quick start" and a few others maybe, but I still included them).

The map is the following: cemom-test_9 (It's currently open-source, so you should be able to open it in the Editor)

But I already have problems making the very first command work. I tried to "build" the command "zoom 200" as the first one.
The variable input from the trigger #command is the input the user makes (e.g. "zoom 200"). I then included the normal executing trigger #zoom200 which does what it should do.

In between I have made a "check" statement, i.e. execute #zoom200 only if the player typed "zoom 200"; in the Editor, that means that the variable input contains the string "zoom 200".
If that is the case, then input gets set to value 1, and the following trigger execution will only work if input is 1.
But for some reason this doesn't seem to work.

I never bothered to work with variables in the Editor before because they are so complicated(*). But I need them now lol


The three relevant triggers are therefore: #console, #checkzoom200 and #zoom200


I would be happy if somebody could help me out


Thanks in advance


(*) = Probably vice-versa. Complicated because I don't have any experience with those in the Map Editor

Cemom
Recruit
 
Posts: 5
Joined: 25 October 2016, 11:00

Re: Map Editor: Needing Help Regarding Variables

Postby goder » 25 January 2022, 01:38

First, you need to set #console as a chat message receiver. You then need to make #console executes #zoom200.
The action 1 of #zoom200 should be "continue if VarA == ValueB ( "input", "zoom 200" );"
User avatar
goder
Recruit
 
Posts: 18
Joined: 19 October 2016, 13:40

Re: Map Editor: Needing Help Regarding Variables

Postby Cemom » 25 January 2022, 22:18

goder wrote:First, you need to set #console as a chat message receiver. You then need to make #console executes #zoom200.
The action 1 of #zoom200 should be "continue if VarA == ValueB ( "input", "zoom 200" );"



Oooh, that worked. Thank you so much!
It seems I generally used the wrong trigger action for the #console and chat, I didn't even know there is and alternate action to get the "chat data".
In order to do the other commands, I will have to use more than one "console" (as triggers can "only" perform a maximum of 10 actions), but that shouldn't cause any problems, I guess

Cemom
Recruit
 
Posts: 5
Joined: 25 October 2016, 11:00

Re: Map Editor: Needing Help Regarding Variables

Postby goder » 26 January 2022, 04:44

There would be a problem actually as there can be only one chat message receiver at once. You can make #console executes a trigger that executes 9 more commands. That trigger can then execute another trigger that executes 9 extra more commands. You can repeat the process to execute an unlimited amount of triggers using only one trigger action.
User avatar
goder
Recruit
 
Posts: 18
Joined: 19 October 2016, 13:40


Return to Bug Reporting, Help & Support

Who is online

Users browsing this forum: No registered users