Trevliga Spel forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Scripting questions

2 posters

Go down

Scripting questions Empty Scripting questions

Post by jordikt Mon Jun 10, 2024 10:58 pm

1. I have seen that mixing ranges and specific values is not working in events. For example the following line should print the text if @myvariable is 1,2,3,4,6:

[(@myvariable:1-4,6) {text:hello}]

It would be possible to mix ranges and single values like this?

2. I miss to have the option to write long comments or sentences in the scripts, as they are getting more complex day after day. Could it be possible to write some sentences between two special characters? I mean something like this:

[(init){@myvariable:0}]
(*
this script is for …
the variable is for …
the press action makes that …
last modification: …
*)
[(press){@myvariable:1}]
jordikt
jordikt

Posts : 291
Join date : 2024-02-10

Back to top Go down

Scripting questions Empty Re: Scripting questions

Post by Admin Tue Jun 11, 2024 12:00 am

jordikt wrote:It would be possible to mix ranges and single values like this?

No, the script parser can currently only handle a single value, a range or a transition, not a combination. I have no immediate plans to change that. To solve the problem, the command in your example can be split into two commands.

jordikt wrote:I miss to have the option to write long comments or sentences in the scripts

If you remove the special characters you suggested as command markers, you can write comments exactly as you have done. The script parser ignores everything outside of the parentheses, so as long as you avoid using the characters [](){} in your comments, you can add whatever you like. You can even add free text inside a command if you keep it outside the (){} parentheses.
Admin
Admin
Admin

Posts : 1250
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

jordikt likes this post

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum