Variable Help-Elapsed Game Time

Undead_Lives

New Member
I need some help making a variable that is set to a certain amount of time. Now I tried making a real but it didn't seem to work with the event trigger..here, let me show you what I mean.
<div class='triggertop'>TRIGGER</div><div class='triggermain'> Spawn
Events
Time - Elapsed game time is (300.00 + 180.00) seconds
</div>
Now instead of 180 I want that to be a variable, but it says that no variables of this type exist...not even a real worked...
I want to do this for a game mode, if you were wondering.
So, can anyone help me out?

<strike>(Side note-the trigger tag is gone...)</strike>
 
Werbung:

PiRho

New Member
(Side note-the trigger tag is gone...)
[/b]
The trigger tag is still there, the images are just missing. :confused:
* sends a PM to Arkidas *

As for the time variable, I don't know the solution right off, but I'll load up world editor and look for a solution.

EDIT:
Well, I tried using the trigger GUI and didn't find a variable type that seemed to work out of the obvious choices. You could try converting your trigger to raw JASS, and it should work:
call TriggerRegisterTimerEventSingle( gg_trg_TriggerName, 300.00 + udg_TimeValue )[/b]
Where udg_TimeValue is an integer variable you want to use as the custom time value.

I don't know of an easier solution at the moment. :( Someone else may be able to post more ideas.
 

Undead_Lives

New Member
*Deleted old message (no double post :p)*
Hm, ok thanks. But wouldn't the variable have to be a real?
EDIT:
Here's my current trigger:
Code:
function Trig_Red_Spawn_2_Conditions takes nothing returns boolean
????if ( not ( GetPlayerSlotState(Player(0)) == PLAYER_SLOT_STATE_PLAYING ) ) then
????????return false
????endif
????return true
endfunction

function Trig_Red_Spawn_2_Func004002 takes nothing returns nothing
????call IssuePointOrderLocBJ( GetEnumUnit(), "attack", GetPlayerStartLocationLoc(Player(0)) )
endfunction

function Trig_Red_Spawn_2_Actions takes nothing returns nothing
????call CreateNUnitsAtLocFacingLocBJ( 6, 'uaco', Player(11), GetRectCenter(gg_rct_Player_1_Spawn), GetPlayerStartLocationLoc(Player(0)) )
????call CreateNUnitsAtLocFacingLocBJ( 6, 'ugho', Player(11), GetRectCenter(gg_rct_Player_1_Spawn), GetPlayerStartLocationLoc(Player(0)) )
????call ForGroupBJ( GetUnitsInRectAll(gg_rct_Player_1_Spawn), function Trig_Red_Spawn_2_Func004002 )
endfunction

//===========================================================================
function InitTrig_Red_Spawn_2 takes nothing returns nothing
????set gg_trg_Red_Spawn_2 = CreateTrigger(??)
????[b]call TriggerRegisterTimerEventSingle( gg_trg_Red_Spawn_2, 480.00 )[/b]
????call TriggerAddCondition( gg_trg_Red_Spawn_2, Condition( function Trig_Red_Spawn_2_Conditions ) )
????call TriggerAddAction( gg_trg_Red_Spawn_2, function Trig_Red_Spawn_2_Actions )
endfunction
Now I realize that the bolded part is where I have to implement your text. (Btw, converted this from GUI)
But I need to set the variable.
How do I do that? (Sorry, kinda new at JASS)
EDIT2: Bold didn't work. But you can see where I tried :p
 

PiRho

New Member
Yeah, that's where you would make the change.

The more I think about it though, the more it seems like it may not work. I've never actually tried using a variable in a trigger event.

It may be a better idea to just create a trigger that runs every 10 seconds or so and checks to see if the elapsed time has expired, then runs the event.
 
Werbung:
Top