- Joined
- Jan 9, 2016
- Messages
- 1,487
Is there any way to use a custom script as a condition? Leave JASS out of this.I just need a GUI trigger but with a custom script condition.Can any help?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Custom Script /w Conditions

Events

Conditions

Actions


Custom script: if (GetTriggerUnit() == "What Unit") then


Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees


Custom script: else


Unit - Create 1 Rifleman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees


Custom script: endif
(required)
if + boolean(-expression) + then
code
(optional)
else
code
(optional)
elseif + boolean(-expression)
code
(required)
endif
true or false,does that work?
Custom script: if (GetTriggerUnit() == 'hfoo') and UnitAlive(GetTriggerUnit()) then
-------- Your Actions Here --------
Custom script: endif
Custom script: if (Condition1) or (Condition2) then
-------- Your Actions here --------
Custom script: elseif (Condition3) or (Condition4) then
-------- Your Actions here --------
Custom script: endif
-------- Or this?? --------
Custom script: if (Condition1) or (Condition2) or (Condition3) then //I'm not sure if this actually worked since I haven't tested on this one.
-------- Your Actions here --------
Custom script: endif
Well that was very ambiguously worded. Could be taken in 2 ways, not to mention you tend to phrases your questions in rather ambiguous ways to begin withBut I need to know if its possible to create multiple or custom script conditions.
Is this it?
Custom script: if (Condition1) or (Condition2) then
-------- Your Actions here --------
Custom script: elseif (Condition3) or (Condition4) then
-------- Your Actions here --------
Custom script: endif
-------- Or this?? --------
Custom script: if (Condition1) or (Condition2) or (Condition3) then //I'm not sure if this actually worked since I haven't tested on this one.
-------- Your Actions here --------
Custom script: endif
Well that was very ambiguously worded. Could be taken in 2 ways, not to mention you tend to phrases your questions in rather ambiguous ways to begin with
Juts replace and with or
EDIT: looks like bear_369 gotchu![]()
Yes,like that.But,I need all the conditions to do the same actions.I don't wanna use way too long triggers.
Custom script: local boolean b = false
Custom script: if (b == false) and (Condition1) then
Custom script: set b = true
Custom script: endif
Custom script: if (b == false) and (Condition2) then
Custom script: set b = true
Custom script: endif
Custom script: if (b == false) and (Condition3) or (Condition4) then
Custom script: set b = true
Custom script: endif
Custom script: if (b == false) and (Condition5) or (Condition6) or (Condition7) then
Custom script: set b = true
Custom script: endif
Custom script: if (b == true) then

-------- Your Actions here --------
Custom script: endif
Conditions

Or - Any (Conditions) are true


Conditions



(Unit-type of (Constructed structure)) Equal to Building1



(Unit-type of (Constructed structure)) Equal to Building2



(Unit-type of (Constructed structure)) Equal to Building3



(Unit-type of (Constructed structure)) Equal to Building4



(Unit-type of (Constructed structure)) Equal to Building5



(Unit-type of (Constructed structure)) Equal to Building6



(Unit-type of (Constructed structure)) Equal to Building7



(Unit-type of (Constructed structure)) Equal to Building8
Actions

Unit - Add a 0.01 second Generic expiration timer to unit
function IsVarTrue takes unit u returns boolean
if ((Condition1(u)) or (Condition2(u)) ) then
return true
elseif ((Condition3(u)) or (Condition4(u)) or (Condition5(u)) ) then
return true
//And so on
endif
return false
endfunction
Custom script: local boolean b = IsVarTrue(GetConstructedUnit())
Custom script: if (b == true) then
-------- Your actions here --------
Custom script: endif
-------- Some pratically bad If/Or statements.. --------
Custom script: if (Condition1) or (Condition2) or (Condition3) *and so on* then
-------- Your actions here --------
Custom script: endif
Derp

Events

Conditions


-------- You cannot put Custom Scripts here in GUI, forget this block ---------

Actions


Custom script: if OrderID == (integer1) or OrderID == (integer2) or OrderID == (integer3) or then


-------- Actions --------


Custom script: endif
Derp

Events

Conditions

Actions


Custom script: if OrderID == (integer1) or /*


Custom script: */ OrderID == (integer1) or /*


Custom script: */ OrderID == (integer1) /*


Custom script: */ then


-------- Actions --------


Custom script: endif
