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.
Upgrade Timer 150

Events


Time - Every 155.00 seconds of game time

Conditions

Actions


Set AI_Upgrade_Counter = (AI_Upgrade_Counter + 1)


Game - Display to Player Group - Player 1 (Red) for 2.00 seconds the text: (String(AI_Upgrade_Counter))


Trigger - Run AI_Upgrade_Triggers[AI_Upgrade_Counter] (checking conditions)
Upgarde 2

Events

Conditions

Actions


Player Group - Pick every player in AI_CompsGroup_NonEasy and do (Actions)



Loop - Actions




Player - Set the current research level of Iron Forged Weapons to 2 for (Picked player)




Player - Set the current research level of Iron Plating to 2 for (Picked player)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Player 1 (Red) controller) Equal to User




(Player 2 (Blue) slot status) Equal to Is unused




(Player 3 (Teal) slot status) Equal to Is unused



Then - Actions




Set Temp_UnitGroup2 = (Units in (Playable map area) matching ((((Owner of (Matching unit)) controller) Equal to Computer) and ((Unit-type of (Matching unit)) Equal to Scout Tower)))




Unit Group - Pick every unit in Temp_UnitGroup2 and do (Actions)





Loop - Actions






Set Temp_Integer = (Random integer number between 1 and 10)






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








Temp_Integer Greater than 4







Then - Actions








Unit - Order (Picked unit) to train/upgrade to a Arcane Tower







Else - Actions




Custom script: call DestroyGroup (udg_Temp_UnitGroup2)



Else - Actions
native DestroyTimer takes timer whichTimer returns nothing
Upgarde 15

Events

Conditions

Actions


Game - Display to Player Group - Player 1 (Red) for 10.00 seconds the text: Desync?


Player Group - Pick every player in AI_CompsGroup_NonEasy and do (Actions)



Loop - Actions




Player - Set the current research level of Iron Forged Weapons to 15 for (Picked player)
Those are safe to destroy unless you destroy them from another thread that can fire randomly. As far as people have reported, the fault is with events that are in the process of firing getting destroyed by their bound trigger's destruction.Oh also i wasnt talking about destroying timers i was talking about destroying triggers with timing events. like this: Time - Every 90.00 seconds of game time
that kinda thing.. those arnt safe to destroy eh?
I would like to point out that once a trigger has become unreachable (eg a trigger that only is able to fire once) it is classed as a memory leak.You can destroy it from another trigger, but it useless really, you won't increase performance so much or things like that. Also if you remove some functions used by other triggers you can crush game later or create bugs.
Also destroy trigger will just remove some code from your map, effects and actions created with that trigger will still remain.
function InitTrig_Setup takes nothing returns nothing
set gg_trg_Setup = CreateTrigger( )
call TriggerAddAction( gg_trg_Setup, function Trig_Setup_Actions )
endfunction
Setup

Events

Conditions

Actions
True, you can't reduce/reset research level.
//==============================================================================
// Library creates invisible sun and moon units for all players.
// These units are then used as tech requirements for spells.
// If a player has a sun unit in his ownership than he can use sun spells.
// Same goes for moon ofc.
// Sun units are owned by players only during day time.
// Moon units are owned by players only during night time.
//==============================================================================
library Daytime initializer Init uses Trig
globals
private constant player NEUTRAL = Player(13)
private unit array sun
private unit array moon
endglobals
//==============================================================================
// For testing purposes
//==============================================================================
public function Off takes nothing returns nothing
local integer i = 0
loop
exitwhen i>=12
call SetUnitOwner(sun[i], NEUTRAL, false)
call SetUnitOwner(moon[i], NEUTRAL, false)
set i = i + 1
endloop
endfunction
//==============================================================================
private function Dawn takes nothing returns nothing
local integer i = 0
loop
exitwhen i>=12
call SetUnitOwner(sun[i], Player(i), false)
call SetUnitOwner(moon[i], NEUTRAL, false)
set i = i + 1
endloop
endfunction
//==============================================================================
private function Dusk takes nothing returns nothing
local integer i = 0
loop
exitwhen i>=12
call SetUnitOwner(moon[i], Player(i), false)
call SetUnitOwner(sun[i], NEUTRAL, false)
set i = i + 1
endloop
endfunction
//==============================================================================
public function isDay takes nothing returns boolean
return (GetTimeOfDay() >= 6.00) and (GetTimeOfDay() < 18.00)
endfunction
//==============================================================================
private function Actions takes nothing returns nothing
if isDay() then
call Dawn()
else
call Dusk()
endif
endfunction
//==============================================================================
private function Init takes nothing returns nothing
local trigger trig
local item it
local integer i = 0
loop
exitwhen i>=12
set sun[i] = CreateUnit(NEUTRAL, UID_sun, 0-i*100, 0, 0)
set moon[i] = CreateUnit(NEUTRAL, UID_moon, 0+i*100, 0, 0)
call PauseUnit(sun[i], true)
call PauseUnit(moon[i], true)
set i = i + 1
endloop
// empire sun gets all map regen aura, scourge moon gets all map regen aura
call UnitAddAbility(sun[Players_EMPIRE], AID_sun_aura)
call UnitAddAbility(moon[Players_SCOURGE], AID_moon_aura)
call Trig_TimeOfDay(function Dawn, 6.00)
call Trig_TimeOfDay(function Dusk, 18.00)
call Trig_TimerSingle(function Actions, 0.01)
endfunction
endlibrary
Sorry buddy but you are wrong.
It just add or remove REQUIREMENTS for some event created.
UPGRADES are totally different thing.
This is false. You didn't even run the map to see how this method works did you?It just add or remove REQUIREMENTS for some event created.
Example

Events


Map initialization

Conditions

Actions


-------- WORK --------


Player - Set the current research level of Iron Forged Swords to 1 for Player 1 (Red)


Wait 1.00 seconds


-------- WORK --------


Player - Set the current research level of Iron Forged Swords to 2 for Player 1 (Red)


Wait 1.00 seconds


-------- WORK --------


Player - Set the current research level of Iron Forged Swords to 3 for Player 1 (Red)


Wait 1.00 seconds


-------- DO NOT WORK --------


Player - Set the current research level of Iron Forged Swords to 2 for Player 1 (Red)


Wait 1.00 seconds


-------- DO NOT WORK --------


Player - Set the current research level of Iron Forged Swords to 1 for Player 1 (Red)


Wait 1.00 seconds


-------- DO NOT WORK --------


Player - Set the current research level of Iron Forged Swords to 0 for Player 1 (Red)
Example

Events


Map initialization

Conditions

Actions


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


Wait 1.00 seconds


Unit - Remove (Last created unit) from the game


Wait 1.00 seconds


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


Wait 1.00 seconds


Unit - Remove (Last created unit) from the game


Wait 1.00 seconds


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


Wait 1.00 seconds


Unit - Remove (Last created unit) from the game
^Setting an ugrade to a lower level is not possible.
True, you can't reduce/reset research level.
(talking obviously about researches not upgrades)Yes you can.
You obviously don't do you?I know what I'm saying, you are the one who act smart!
Untitled Trigger 017

Events


Unit - A unit Finishes research

Conditions


(Researched tech-type) Equal to Iron Forged Swords

Actions


Game - Display to Player Group - Player 1 (Red) the text: finish
My whole map is open-source, and you already posted the trigger yourself.Show us how then, triggers, script, test map, I don't care!

With my English knowledge this:My whole map is open-source, and you already posted the trigger yourself.
It even has comments jeez.
Your vJass is horrible, it look more like jass with some elements of vJass, like globals.I guess the problem here is that my whole map is in vJass while you people speak only in GUI language...
Well I make, and you know what, people appreciate that, tutorials are created so people can learn, if you understand idea, code shape isn't important, GUI, jass etc.I don't make tutorials for GUI so I guess you will have to Upgrade your mapmaking skills by Researching my map.
Yes you can.
Check Daytime trigger in this map:
https://www.hiveworkshop.com/forums/map-development-202/6-aos-priest-vs-necro-207129/
