If in thyme ?
4 posts • Page 1 of 1
If in thyme ?
I want to create a script that when a value of a variable x is > 3 move the variable y to 5.
- Skrubs
- Posts: 16
- Joined: Tue Mar 06, 2018 7:36 pm
Re: If in thyme ?
{condition} ? {then code} : {else code}
x > 3 ? {y = 5} : {};
x > 3 ? {y = 5} : {};
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: If in thyme ?
You can combine conditions using && and ||. && means "And", || means "or".
pos(1)>3 && vel(1)<0 ? {}: {}
This means if pos(1) is > 3 AND vel(1) is < 0 THEN do stuff.
vel(0) > 10 || color(3)<=0.1 ? {}: {}
if vel(0) is greater 10 OR color(3) is less or equal 0.1, THEN do stuff.
pos(1)>3 && vel(1)<0 ? {}: {}
This means if pos(1) is > 3 AND vel(1) is < 0 THEN do stuff.
vel(0) > 10 || color(3)<=0.1 ? {}: {}
if vel(0) is greater 10 OR color(3) is less or equal 0.1, THEN do stuff.
- FRA32
- Posts: 229
- Joined: Wed Dec 03, 2014 9:51 pm
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests