Name | Type | is_array | initial_value |
Ability | abilcode | No | |
AoE | real | Yes | |
Caster | unit | No | |
CasterPosition | location | No | |
Charge_Dummy | unit | Yes | |
Charge_Effects | effect | Yes | |
Charge_Point | location | Yes | |
Charge_Real | real | Yes | |
Charge_Unit | unit | Yes | |
ChargeTimer | timer | No | |
CI_Dummies | group | No | |
CI_Frozen | group | No | |
CI_Group | group | No | |
CI_Hash | hashtable | No | |
CI_Reals | real | Yes | |
CI_SFX_Group | group | No | |
CI_Terrain_Types | terraintype | Yes | |
CInteger | integer | No | |
Damage | real | Yes | |
DamagesShown | boolean | Yes | |
DamagesTaken | integer | No | |
dialogAreyouready | dialog | No | |
DL_i | integer | Yes | |
DL_i_last | integer | No | |
DL_Max_Size | integer | No | |
DL_TEMP | integer | No | |
DL_TEMP_LOOP | integer | No | |
DR_Dummy_Group | group | No | |
DR_Group | group | No | |
DR_Hash | hashtable | No | |
DR_Reals | real | Yes | |
DW_Effects | group | No | |
DW_Group | group | No | |
DW_Hash | hashtable | No | |
DW_Reals | real | Yes | |
FH_Charge_Group | group | No | |
FH_Group | group | No | |
FH_Hash | hashtable | No | |
FH_Knockback_Group | group | No | |
FH_Loop_Group_1 | group | No | |
FH_Loop_Group_2 | group | No | |
FH_Reals | real | Yes | |
FH_Unit_Type | unitcode | No | |
GameValue | integer | No | |
GDD__Integers | integer | Yes | |
GDD__LeftMapGroup | group | No | |
GDD__TriggerArray | trigger | Yes | |
GDD__UnitArray | unit | Yes | |
GDD_Damage | real | No | |
GDD_DamagedUnit | unit | No | |
GDD_DamageSource | unit | No | |
GDD_Event | real | No | |
GroupForward | group | No | |
GroupLeft | group | No | |
GroupRight | group | No | |
IAoE | real | Yes | |
Item_CanBeDisassemble | boolean | Yes | |
Item_Check | integer | No | |
Item_Count | integer | No | |
Item_CustomValue | integer | No | |
Item_DisassembleAbility | abilcode | No | |
Item_DisassembleEffect | string | No | |
Item_DisassemblePoint | location | Yes | |
Item_Effect | string | No | |
Item_EnableOS | boolean | No | |
Item_Fake | itemcode | Yes | |
Item_LoopA | integer | No | |
Item_LoopB | integer | No | |
Item_LoopC | integer | No | |
Item_Mat1 | itemcode | Yes | |
Item_Mat1Amount | integer | Yes | |
Item_Mat2 | itemcode | Yes | |
Item_Mat2Amount | integer | Yes | |
Item_Mat3 | itemcode | Yes | |
Item_Mat3Amount | integer | Yes | |
Item_Mat4 | itemcode | Yes | |
Item_Mat4Amount | integer | Yes | |
Item_Mat5 | itemcode | Yes | |
Item_Mat5Amount | integer | Yes | |
Item_MatMax | integer | Yes | |
Item_Max | integer | No | |
Item_Owner | player | Yes | |
Item_OwneredItem | item | Yes | |
Item_OwnershipException | group | No | |
Item_Point | location | Yes | |
Item_Real | itemcode | Yes | |
Item_RecipeMax | integer | No | |
Item_Result | itemcode | Yes | |
kb_angle | real | Yes | |
kb_bolean | boolean | Yes | |
kb_caster | unit | Yes | |
kb_distance | real | Yes | |
kb_lighting | lightning | Yes | |
Laser_Hidden | unit | Yes | |
Laser_Taker | unit | No | |
Level | integer | No | |
Loop | integer | No | |
loopA | integer | No | |
LoopInt | integer | No | |
MI_Group | group | No | |
MI_Hash | hashtable | No | |
MI_Lightning | string | No | |
MI_Reals | real | Yes | |
MI_Unit_Type | unitcode | No | |
no | dialog | No | |
NW_Dummies | group | No | |
NW_Hash | hashtable | No | |
NW_Lightning | string | No | |
NW_Loop | group | No | |
NW_Reals | real | Yes | |
Offset | location | No | |
PDM_Caster | ubersplat | Yes | |
PDM_CasterCount | integer | No | |
PDM_Distance | real | Yes | |
PDM_Dummy | ubersplat | Yes | |
PDM_Group | group | Yes | |
PDM_IndexBoolean | boolean | Yes | |
PDM_IndexCount | integer | No | |
PDM_IndexLoop | integer | No | |
PDM_IndexNew | integer | No | |
point | location | No | |
Rager | unit | No | |
RC_ButtonNo | button | No | |
RC_ButtonYes | button | No | |
RC_Dialog | dialog | No | |
real | real | No | |
Repeats | integer | Yes | |
SpecialFX | string | Yes | |
string | string | No | |
Teleporter | unit | No | |
Temp_Group_1 | group | No | |
Temp_Group_2 | group | No | |
Temp_Integer_1 | integer | No | |
Temp_Integer_2 | integer | No | |
Temp_Lightning_1 | lightning | No | |
Temp_Loc_1 | location | No | |
Temp_Loc_2 | location | No | |
Temp_Loc_3 | location | No | |
Temp_Loc_4 | location | No | |
Temp_Real_1 | real | No | |
Temp_Real_2 | real | No | |
Temp_Real_3 | real | No | |
Temp_Real_4 | real | No | |
Temp_Real_5 | real | No | |
Temp_Real_6 | real | No | |
Temp_String_1 | string | No | |
Temp_Unit_1 | unit | No | |
Temp_Unit_2 | unit | No | |
Temp_Unit_3 | unit | No | |
TempGroup | group | No | |
TempInt | integer | No | |
TempItem | item | No | |
TempPoint | location | No | |
TempPoint2 | location | No | |
TempReal | real | No | |
TempUnit | unit | No | |
TempValue | integer | No | |
Terrain_Hash | hashtable | No | |
Timed_POINT | location | No | |
TriggerPlayer | player | No | |
u | unit | No | |
unit | unit | No | |
UnitOfPlayer | unit | Yes | |
Units | unitcode | Yes | |
Wcrt_A_not_critical | boolean | No | |
Wcrt_A_size | real | No | 10.00 |
Wcrt_A_size_final_multiplier | real | No | 1.50 |
Wcrt_A_size_max_multiplier | real | No | 2.50 |
Wcrt_A_text | string | No | |
Wcrt_A_text_after | string | No | |
Wcrt_A_text_before | string | No | |
Wcrt_B_angle | real | No | 90.00 |
Wcrt_B_fading_age | real | No | 4.00 |
Wcrt_B_life_span | real | No | 5.00 |
Wcrt_B_towards | real | No | 64.00 |
Wcrt_B_transparecy | real | No | |
Wcrt_B_z_offset | real | No | |
Wcrt_C_time_dicrease | real | No | 0.05 |
Wcrt_C_time_increase | real | No | 0.10 |
Wcrt_Color | string | No | |cffffcc00 |
Wcrt_Color_Blue | string | No | |cffffcc00 |
Wcrt_Color_Green | string | No | |cffffcc00 |
Wcrt_Color_Red | string | No | |cffffcc00 |
Wcrt_Color_White | string | No | |cffffcc00 |
Wcrt_Color_Yellow | string | No | |cffffcc00 |
Wcrt_floating_text | texttag | Yes | |
Wcrt_increasing_boolean | boolean | Yes | |
Wcrt_LOOP_TRIGGER_INTERVAL | real | No | 0.05 |
Wcrt_size | real | Yes | |
Wcrt_size_current | real | Yes | |
Wcrt_size_final | real | Yes | |
Wcrt_size_max | real | Yes | |
Wcrt_step1 | real | Yes | |
Wcrt_step2 | real | Yes | |
Wcrt_text_ex | string | Yes | |
Wcrt_time_dicrease | real | Yes | |
Wcrt_time_increase | real | Yes | |
Wcrt_time_operating | real | Yes | |
yes | dialog | No | |
yess | button | Yes |
// GUI-Friendly Damage Detection -- v1.2.1 -- by Weep
// http:// www.thehelper.net/forums/showthread.php?t=137957
//
// Requires: only this trigger and its variables.
//
// -- What? --
// This snippet provides a leak-free, GUI-friendly implementation of an "any unit takes
// damage" event. It requires no JASS knowledge to use.
//
// It uses the Game - Value Of Real Variable event as its method of activating other
// triggers, and passes the event responses through a few globals.
//
// -- Why? --
// The traditional GUI method of setting up a trigger than runs when any unit is damaged
// leaks trigger events. This snippet is easy to implement and removes the need to do
// you own GUI damage detection setup.
//
// -- How To Implement --
// 0. Before you copy triggers that use GDD into a new map, you need to copy over GDD
// with its GDD Variable Creator trigger, or there will be a problem: the variables
// won't be automatically created correctly.
//
// 1. Be sure "Automatically create unknown variables while pasting trigger data" is
// enabled in the World Editor general preferences.
// 2. Copy this trigger category ("GDD") and paste it into your map.
// (Alternately: create the variables listed in the globals block below, create a
// trigger named "GUI Friendly Damage Detection", and paste in this entire text.)
// 3. Create your damage triggers using Game - Value Of Real Variable as the event,
// select GDD_Event as the variable, and leave the rest of the settings to the default
// "becomes Equal to 0.00".
// The event responses are the following variables:
// GDD_Damage is the amount of damage, replacing Event Response - Damage Taken.
// GDD_DamagedUnit is the damaged unit, replacing Event Response - Triggering Unit.
// Triggering Unit can still be used, if you need to use waits.
// Read the -- Notes -- section below for more info.
// GDD_DamageSource is the damaging unit, replacing Event Response - Damage Source.
//
// -- Notes --
// GDD's event response variables are not wait-safe; you can't use them after a wait in
// a trigger. If you need to use waits, Triggering Unit (a.k.a. GetTriggerUnit()) can
// be used in place of GDD_DamageSource. There is no usable wait-safe equivalent to
// Event Damage or Damage Source; you'll need to save the values yourself.
//
// Don't write any values to the variables used as the event responses, or it will mess
// up any other triggers using this snippet for their triggering. Only use their values.
//
// This uses arrays, so can detect damage for a maximum of 8190 units at a time, and
// cleans up data at a rate of 33.33 per second, by default. This should be enough for
// most maps, but if you want to change the rate, change the value returned in the
// GDD_RecycleRate function at the top of the code, below.
//
// By default, GDD will not register units that have Locust at the moment of their
// entering the game, and will not recognize when they take damage (which can only
// happen if the Locust ability is later removed from the unit.) To allow a unit to have
// Locust yet still cause GDD damage events if Locust is removed, you can either design
// the unit to not have Locust by default and add it via triggers after creation, or
// edit the GDD_Filter function at the top of the code, below.
//
// -- Credits --
// Captain Griffin on wc3c.net for the research and concept of GroupRefresh.
//
// Credit in your map not needed, but please include this README.
//
// -- Version History --
// 1.2.1: Minor code cleaning. Added configuration functions. Updated documentation.
// 1.2.0: Made this snippet work properly with recursive damage.
// 1.1.1: Added a check in order to not index units with the Locust ability (dummy units).
// If you wish to check for damage taken by a unit that is unselectable, do not
// give the unit-type Locust in the object editor; instead, add the Locust ability
// 'Aloc' via a trigger after its creation, then remove it.
// 1.1.0: Added a check in case a unit gets moved out of the map and back.
// 1.0.0: First release.
//===================================================================
// Configurables.
function GDD_RecycleRate takes nothing returns real //The rate at which the system checks units to see if they've been removed from the game
return 0.03
endfunction
function GDD_Filter takes unit u returns boolean //The condition a unit has to pass to have it registered for damage detection
return GetUnitAbilityLevel(u, 'Aloc') == 0 //By default, the system ignores Locust units, because they normally can't take damage anyway
endfunction
//===================================================================
// This is just for reference.
// If you use JassHelper, you could uncomment this section instead of creating the variables in the trigger editor.
// globals
// real udg_GDD_Event = 0.
// real udg_GDD_Damage = 0.
// unit udg_GDD_DamagedUnit
// unit udg_GDD_DamageSource
// trigger array udg_GDD__TriggerArray
// integer array udg_GDD__Integers
// unit array udg_GDD__UnitArray
// group udg_GDD__LeftMapGroup = CreateGroup()
// endglobals
//===================================================================
// System code follows. Don't touch!
function GDD_Event takes nothing returns boolean
local unit damagedcache = udg_GDD_DamagedUnit
local unit damagingcache = udg_GDD_DamageSource
local real damagecache = udg_GDD_Damage
set udg_GDD_DamagedUnit = GetTriggerUnit()
set udg_GDD_DamageSource = GetEventDamageSource()
set udg_GDD_Damage = GetEventDamage()
set udg_GDD_Event = 1.
set udg_GDD_Event = 0.
set udg_GDD_DamagedUnit = damagedcache
set udg_GDD_DamageSource = damagingcache
set udg_GDD_Damage = damagecache
set damagedcache = null
set damagingcache = null
return false
endfunction
function GDD_AddDetection takes nothing returns boolean
// if(udg_GDD__Integers[0] > 8190) then
// call BJDebugMsg("GDD: Too many damage events! Decrease number of units present in the map or increase recycle rate.")
// ***Recycle rate is specified in the GDD_RecycleRate function at the top of the code. Smaller is faster.***
// return
// endif
if(IsUnitInGroup(GetFilterUnit(), udg_GDD__LeftMapGroup)) then
call GroupRemoveUnit(udg_GDD__LeftMapGroup, GetFilterUnit())
elseif(GDD_Filter(GetFilterUnit())) then
set udg_GDD__Integers[0] = udg_GDD__Integers[0]+1
set udg_GDD__UnitArray[udg_GDD__Integers[0]] = GetFilterUnit()
set udg_GDD__TriggerArray[udg_GDD__Integers[0]] = CreateTrigger()
call TriggerRegisterUnitEvent(udg_GDD__TriggerArray[udg_GDD__Integers[0]], udg_GDD__UnitArray[udg_GDD__Integers[0]], EVENT_UNIT_DAMAGED)
call TriggerAddCondition(udg_GDD__TriggerArray[udg_GDD__Integers[0]], Condition(function GDD_Event))
endif
return false
endfunction
function GDD_PreplacedDetection takes nothing returns nothing
local group g = CreateGroup()
local integer i = 0
loop
call GroupEnumUnitsOfPlayer(g, Player(i), Condition(function GDD_AddDetection))
set i = i+1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
call DestroyGroup(g)
set g = null
endfunction
function GDD_GroupRefresh takes nothing returns nothing
// Based on GroupRefresh by Captain Griffen on wc3c.net
if (bj_slotControlUsed[5063] == true) then
call GroupClear(udg_GDD__LeftMapGroup)
set bj_slotControlUsed[5063] = false
endif
call GroupAddUnit(udg_GDD__LeftMapGroup, GetEnumUnit())
endfunction
function GDD_Recycle takes nothing returns nothing
if(udg_GDD__Integers[0] <= 0) then
return
elseif(udg_GDD__Integers[1] <= 0) then
set udg_GDD__Integers[1] = udg_GDD__Integers[0]
endif
if(GetUnitTypeId(udg_GDD__UnitArray[udg_GDD__Integers[1]]) == 0) then
call DestroyTrigger(udg_GDD__TriggerArray[udg_GDD__Integers[1]])
set udg_GDD__TriggerArray[udg_GDD__Integers[1]] = null
set udg_GDD__TriggerArray[udg_GDD__Integers[1]] = udg_GDD__TriggerArray[udg_GDD__Integers[0]]
set udg_GDD__UnitArray[udg_GDD__Integers[1]] = udg_GDD__UnitArray[udg_GDD__Integers[0]]
set udg_GDD__UnitArray[udg_GDD__Integers[0]] = null
set udg_GDD__Integers[0] = udg_GDD__Integers[0]-1
endif
set udg_GDD__Integers[1] = udg_GDD__Integers[1]-1
endfunction
function GDD_LeaveMap takes nothing returns boolean
local boolean cached = bj_slotControlUsed[5063]
if(udg_GDD__Integers[2] < 64) then
set udg_GDD__Integers[2] = udg_GDD__Integers[2]+1
else
set bj_slotControlUsed[5063] = true
call ForGroup(udg_GDD__LeftMapGroup, function GDD_GroupRefresh)
set udg_GDD__Integers[2] = 0
endif
call GroupAddUnit(udg_GDD__LeftMapGroup, GetFilterUnit())
set bj_slotControlUsed[5063] = cached
return false
endfunction
// ===========================================================================
function InitTrig_GUI_Friendly_Damage_Detection takes nothing returns nothing
local region r = CreateRegion()
call RegionAddRect(r, GetWorldBounds())
call TriggerRegisterEnterRegion(CreateTrigger(), r, Condition(function GDD_AddDetection))
call TriggerRegisterLeaveRegion(CreateTrigger(), r, Condition(function GDD_LeaveMap))
call GDD_PreplacedDetection()
call TimerStart(CreateTimer(), GDD_RecycleRate(), true, function GDD_Recycle)
set r = null
endfunction
//TESH.scrollpos=68
//TESH.alwaysfold=0
//======================================================================================
Dynamic Index by Hanky
//======================================================================================
I just can recommend using a dynamic index system if you are using GUI for looping stuff.
Because of the following reasons you should use this kind of dynamic indexing:
- It_s faster than the "paladon indexing system" or however you want to call
that indexing (and btw it_s even shorter than the "paladon indexing system")
- I think it_s easy to understand and it just need 3 variables
//--------------------------------------------------------------------------------------
This map is an example map for dynamic indexing. Demo made by Hanky.
Well dynamic indexing is pretty easy but it_ll still save much performance. Basicly it_s
just an integer array which keep all index positions. Just as an example:
//--------------------------------------------------------------------------------------
We got 3 index entries:
- The first entry get the index 1
- The second entry get the index 2
- The third entry get the index 3
Then suddenly index 2 expired and going to be recycled.
- Index[Current Loop Integer] = Index[Last Position Index]
- Index[Last Position Index] = Index[Current Loop Integer]
Basicly this is just an exchange of the last position and the current loop position. That means:
2 [2] = 3 [3]
3 [3] = 2
Another example with 3 indexes which expire in the order of 1,2 and 3:
=> Index 1 get recycled
1 [1] = 3 [3]
3 [3] = 1
=> Index 2 get recycled
2 [2] = 2 [2]
2 [2] = 2
=> Index 3 get recycled
3 [1] = 3 [1]
3 [1] = 3
And a last example with 3 indexes which expire in the order of 2,3 and 1:
=> Index 2 get recycled
2 [2] = 3 [3]
3 [3] = 2
=> Index 3 get recycled
3 [2] = 3 [2]
3 [2] = 3
=> Index 1 get recycled
1 [1] = 1 [1]
1 [1] = 1
//--------------------------------------------------------------------------------------
Hint:
If you are using IntegerA oder IntegerB in the motion loop the whole recycle process have to look
like this:
If you are using IntegerA it should look like this:
-------- RecycleIndex --------
Set EXAMPLE_Index[bj_forLoopAIndex] = EXAMPLE_Index[EXAMPLE_Index_Size]
Set EXAMPLE_Index[EXAMPLE_Index_Size] = TempInt
Custom Script: set bj_forLoopAIndexEnd = (bj_forLoopAIndexEnd - 1)
Custom Script: set bj_forLoopAIndex = (bj_forLoopAIndex - 1)
If you are using IntegerB it should look like this:
-------- RecycleIndex --------
Set EXAMPLE_Index[bj_forLoopBIndex] = EXAMPLE_Index[EXAMPLE_Index_Size]
Set EXAMPLE_Index[EXAMPLE_Index_Size] = TempInt
Custom Script: set bj_forLoopBIndexEnd = (bj_forLoopBIndexEnd - 1)
Custom Script: set bj_forLoopBIndex = (bj_forLoopBIndex - 1)
//--------------------------------------------------------------------------------------
// Last words...
Why did I made this map?
Im sick of all those GUI spell maps using ineffective indexing systems.
Greetz fly out to:
Paladon, Darkt3mpl3r, JonNny, WaRadius, Toadcop, Deuterium, Eccho, Berzeker, xxdingo93xx
Yixx, Dark Dragon, TDG, NgO ...
Also thanks to D4RK_G4ND4LF for telling me stuff I just forgot to add...s
Well I hope that you guys understood what I mean. If not Im free for questions.