• 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] Converting events to conditions?

Status
Not open for further replies.
Level 6
Joined
Aug 19, 2006
Messages
187
sorry if this is a double post, but the search shows nearly every thread when im searching for this question.

ok i have trigger like
event:
timer 1 expires
timer 2 expires
timer 3 expires

actions:
if <expired timer equal to timer 1>
set integer a equal to 1

and that is the problem because there isn't a condition like this one.

my question: is there a possibility to figur out which event started the trigger?
i want to know this because i can combine 8 triggers to 1 then.
 
Level 24
Joined
May 9, 2007
Messages
3,563
Yes. . .


It would be easy but would it be worth it to simply amalgamate eight triggers into one.

Sure it could be used later on in life (lol) but that is not necessarily where I would want to start learning JASS.

I think that this might be called a little "off-topic" but whatever.
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
Search the condition list for 10 minutes for a condition like this.
Search Google, Hive ~ 10 minutes.
Post on Hive, check it every now and then ~30 minutes.
Not to mention you might don't find an answer or find out that you can't do this in GUI, not to mention you have to wait for an answer for days.

Or

Read a tutorial on Jass ~ 8 minutes.
Tinker around in Jass ~ 25 minutes.

And you are ready to go and can refer to your expired timer :p

I would suggest the OP to start to learn Jass right now.
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
My suggestion was made of 100% helpfulness.
You have spent a day on solving this problem and you are going to spend more.
If you want to refer to expired timers use JASS.
After spending a few minutes looking around in the GUI trigger editor I came to the conclusion that it's very likely that you can not do this in GUI.
 
Level 6
Joined
Aug 19, 2006
Messages
187
ok i don't know much about jass and yeah there is no way to do this with gui.
so i have this trigger (its directly converted from the gui trigger so maybe it's not a good jass trigger at all) the only think which must be edited is the part where i wanna clarify P2. so i need something in this trigger like "if expired timer equal to timersolo[1] set P2 equal to 1". maybe someone could edit this trigger below?

function Trig_start_wave_solo_Kopieren_Func002Func005Func003C takes nothing returns boolean
if ( ( udg_LevelSolo[udg_P2] == 12 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 20 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 22 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 24 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 26 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 29 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 31 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 32 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 33 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 34 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 36 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 42 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 43 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 44 ) ) then
return true
endif
if ( ( udg_LevelSolo[udg_P2] == 47 ) ) then
return true
endif
return false
endfunction

function Trig_start_wave_solo_Kopieren_Func002Func005C takes nothing returns boolean
if ( not Trig_start_wave_solo_Kopieren_Func002Func005Func003C() ) then
return false
endif
return true
endfunction

function Trig_start_wave_solo_Kopieren_Func002Func006Func001C takes nothing returns boolean
if ( ( udg_LevelSolo[udg_P2] == 50 ) ) then
return true
endif
return false
endfunction

function Trig_start_wave_solo_Kopieren_Func002Func006C takes nothing returns boolean
if ( not Trig_start_wave_solo_Kopieren_Func002Func006Func001C() ) then
return false
endif
return true
endfunction

function Trig_start_wave_solo_Kopieren_Func002Func009C takes nothing returns boolean
if ( ( udg_LevelSolo[udg_P2] == ( udg_DoH[udg_P2] * 5 ) ) ) then
return true
endif
return false
endfunction

function Trig_start_wave_solo_Kopieren_Func002C takes nothing returns boolean
if ( not Trig_start_wave_solo_Kopieren_Func002Func009C() ) then
return false
endif
return true
endfunction

function Trig_start_wave_solo_Kopieren_Actions takes nothing returns nothing
set udg_P2 = 1
if ( Trig_start_wave_solo_Kopieren_Func002C() ) then
set udg_DoH[udg_P2] = ( udg_DoH[udg_P2] + 1 )
set udg_BossSolo[udg_P2] = ( udg_BossSolo[udg_P2] + 1 )
set udg_Masolo[udg_P2] = 25
call DisplayTextToForce( GetForceOfPlayer(udg_PArray[udg_P2]), udg_Wavemessage[udg_LevelSolo[udg_P2]] )
call DisplayTextToForce( GetForceOfPlayer(udg_PArray[udg_P2]), "TRIGSTR_4980" )
call TriggerSleepAction( 1.00 )
call EnableTrigger( udg_TArray2[udg_P2] )
call TriggerSleepAction( 10.00 )
call TriggerExecute( udg_TArray3[udg_P2] )
else
set udg_Masolo[udg_P2] = 50
call DisplayTextToForce( GetForceOfPlayer(udg_PArray[udg_P2]), udg_Wavemessage[udg_LevelSolo[udg_P2]] )
if ( Trig_start_wave_solo_Kopieren_Func002Func005C() ) then
set udg_Specialsolo[udg_P2] = ( udg_Specialsolo[udg_P2] + 1 )
call DisplayTextToForce( GetForceOfPlayer(udg_PArray[udg_P2]), udg_Wavespecial[udg_Specialsolo[udg_P2]] )
else
endif
if ( Trig_start_wave_solo_Kopieren_Func002Func006C() ) then
call DisplayTextToForce( GetForceOfPlayer(udg_PArray[udg_P2]), "TRIGSTR_4978" )
call DisplayTextToForce( GetForceOfPlayer(udg_PArray[udg_P2]), "TRIGSTR_4979" )
else
endif
call TriggerSleepAction( 1.00 )
call EnableTrigger( udg_TArray2[udg_P2] )
endif
endfunction

//===========================================================================
function InitTrig_start_wave_solo_Kopieren takes nothing returns nothing
set gg_trg_start_wave_solo_Kopieren = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_start_wave_solo_Kopieren, udg_TimerSolo[1] )
call TriggerRegisterTimerExpireEventBJ( gg_trg_start_wave_solo_Kopieren, udg_TimerSolo[2] )
call TriggerRegisterTimerExpireEventBJ( gg_trg_start_wave_solo_Kopieren, udg_TimerSolo[3] )
call TriggerRegisterTimerExpireEventBJ( gg_trg_start_wave_solo_Kopieren, udg_TimerSolo[4] )
call TriggerRegisterTimerExpireEventBJ( gg_trg_start_wave_solo_Kopieren, udg_TimerSolo[5] )
call TriggerRegisterTimerExpireEventBJ( gg_trg_start_wave_solo_Kopieren, udg_TimerSolo[6] )
call TriggerRegisterTimerExpireEventBJ( gg_trg_start_wave_solo_Kopieren, udg_TimerSolo[7] )
call TriggerRegisterTimerExpireEventBJ( gg_trg_start_wave_solo_Kopieren, udg_TimerSolo[8] )
call TriggerAddAction( gg_trg_start_wave_solo_Kopieren, function Trig_start_wave_solo_Kopieren_Actions )
endfunction
 
Level 17
Joined
May 6, 2008
Messages
1,598
One word: Variables.

I made a little template for you.
 

Attachments

  • Timer Variables Template.w3m
    17.3 KB · Views: 66
Level 17
Joined
May 6, 2008
Messages
1,598
I dont understand a freakin' word you say.

If i understood it right you want one timer to expire and add one plus to an integer.
 
Level 6
Joined
Aug 19, 2006
Messages
187
the problem is i dont want 8 timers starting 8 triggers. i want 8 timers to start 1 trigger. and the number of the expired timer shall be converted to the integer P2 in the trigger i posted above. so if trigger 4 expires P2 should be 4. but that is not possible with gui.
 
Status
Not open for further replies.
Top