• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Conditions when calling a TriggerRegisterBlab

Status
Not open for further replies.
Level 6
Joined
Jul 25, 2005
Messages
221
When I try to assign a condition manually

JASS:
call TriggerAddCondition(gg_trg_SpellTest, if (SomeVar)==somevalue)
it gives me a syntax error

the only way I know how to do it is

JASS:
function ConditionFunc takes nothing returns boolean
if (SomeVar)!=somevalue then
    return false
    endif
    return true
endfunction
 
function InitOrwhatever takes nothing returns nothing
call TriggerAddCondition(gg_trg_Whatver, Condition(function ConditionFunc ))
endfunction

my question is simple, are there any other way of doing this other than the latter? :cute:
 
Level 9
Joined
Mar 25, 2005
Messages
252
If you want to decide what 'somevalue' is dynamically when adding the condition you can store that value to the trigger by using a handle attachment system, and then retrieve it in your ConditionFunc later.

If you want to do so and can and want to use structs look for HSAS at the Jass Functions section of the Hive. If you don't know what structs are or don't want to use them try HAIL.
 
Status
Not open for further replies.
Top