It's such a simple thing but I haven't gotten it to work.
What I'm looking for is to define a variable number between 1 and 5, COMPLETELY random. So each time the variable is defined it picks out a random number between 1 and 5.
One small question; Which coding language do Variables take in? (JS, Python, etc?)
Probably something everyone already knows (I don't, I'm sorry xD)
(TIMEAXIS TO THE RESCUE, WHERES MY BOY)
Thank you. <3
Define a Variable to RANDOMLY select a number?
Moderator: EN - Forum Moderators
Define a Variable to RANDOMLY select a number?
Live life as you enjoy it, pal!-
I guess not...


I guess not...

- Enthalpy
- Community Manager
- Posts: 5144
- Joined: Wed Jan 04, 2012 4:40 am
- Gender: Male
- Spoken languages: English, limited Spanish
Re: Define a Variable to RANDOMLY select a number?
Go into advanced mode and mark the variable value as a runtime expression. Then set the variable value to .
Code: Select all
f:random_int(1, 5)
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
Re: Define a Variable to RANDOMLY select a number?
Oh, that's way easier than I thought it would be, thank you Enthalpy my friend!
(So PHP it is)
(So PHP it is)
Enthalpy wrote: ↑Fri Sep 15, 2023 3:55 pm Go into advanced mode and mark the variable value as a runtime expression. Then set the variable value to.Code: Select all
f:random_int(1, 5)
Live life as you enjoy it, pal!-
I guess not...


I guess not...

Re: Define a Variable to RANDOMLY select a number?
For your other question, it’s all technically within javascript, not PHP, but the expression system is sort of a custom scripting language designed by Unas, so you can’t necessarily rely on any knowledge of existing languages.
This thread, particularly the “Henke’s explanation of the expression engine” part, lists all the functions you can use. I recommend bookmarking it or something cause it’s a really useful thread.
This thread, particularly the “Henke’s explanation of the expression engine” part, lists all the functions you can use. I recommend bookmarking it or something cause it’s a really useful thread.
- Enthalpy
- Community Manager
- Posts: 5144
- Joined: Wed Jan 04, 2012 4:40 am
- Gender: Male
- Spoken languages: English, limited Spanish
Re: Define a Variable to RANDOMLY select a number?
I can heartily endorse that tutorial.TimeAxis wrote: ↑Fri Sep 15, 2023 8:53 pm For your other question, it’s all technically within javascript, not PHP, but the expression system is sort of a custom scripting language designed by Unas, so you can’t necessarily rely on any knowledge of existing languages.
This thread, particularly the “Henke’s explanation of the expression engine” part, lists all the functions you can use. I recommend bookmarking it or something cause it’s a really useful thread.
And yes, the expression system is a custom scripting language. Unas thought that letting users execute arbitrary code might be a security problem.
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
Re: Define a Variable to RANDOMLY select a number?
I SERIOUSLY never knew that! Ty for the link! Unas is one heck of a cool guy-
Oh my goodness. Thanks you two, that explains alot! <3
Oh my goodness. Thanks you two, that explains alot! <3
Enthalpy wrote: ↑Sat Sep 16, 2023 4:10 amI can heartily endorse that tutorial.TimeAxis wrote: ↑Fri Sep 15, 2023 8:53 pm For your other question, it’s all technically within javascript, not PHP, but the expression system is sort of a custom scripting language designed by Unas, so you can’t necessarily rely on any knowledge of existing languages.
This thread, particularly the “Henke’s explanation of the expression engine” part, lists all the functions you can use. I recommend bookmarking it or something cause it’s a really useful thread.
And yes, the expression system is a custom scripting language. Unas thought that letting users execute arbitrary code might be a security problem.
Live life as you enjoy it, pal!-
I guess not...


I guess not...
