Name | Type | is_array | initial_value |
local_Ability | abilcode | No | |
local_Attack_Type | attacktype | No | |
local_Boolean | boolean | No | |
local_Buff | buffcode | No | |
local_Camera_Object | camerasetup | No | |
local_Combat_Sound | weapontype | No | |
local_Damage_Type | damagetype | No | |
local_Defeat_Condition | defeatcondition | No | |
local_Destructible | destructable | No | |
local_Destructible_Type | destructablecode | No | |
local_Dialog | dialog | No | |
local_Dialog_Button | button | No | |
local_Effect_Type | effecttype | No | |
local_Floating_Text | texttag | No | |
local_Game_Cache | gamecache | No | |
local_Game_Speed | gamespeed | No | |
local_Handle | handle | No | |
local_Hashtable | hashtable | No | |
local_Image | image | No | |
local_Image_Type | imagetype | No | |
local_Integer | integer | No | |
local_Item | item | No | |
local_Item_Class | itemtype | No | |
local_Item_Type | itemcode | No | |
local_Leaderboard | leaderboard | No | |
local_Lightning | lightning | No | |
local_Lightning_Type | lightningtype | No | |
local_Multiboard | multiboard | No | |
local_Order | ordercode | No | |
local_Pathing_Type | pathingtype | No | |
local_Player | player | No | |
local_Player_Color | playercolor | No | |
local_Player_Group | force | No | |
local_Point | location | No | |
local_Quest | quest | No | |
local_Quest_Requirement | questitem | No | |
local_Race | race | No | |
local_Real | real | No | |
local_Region | rect | No | |
local_Sound | sound | No | |
local_Sound_Type | soundtype | No | |
local_Special_Effect | effect | No | |
local_String | string | No | |
local_Tech_Type | techcode | No | |
local_Terrain_Deformation | terraindeformation | No | |
local_Terrain_Shape | terrainshape | No | |
local_Terrain_Type | terraintype | No | |
local_Timer | timer | No | |
local_Timer_Window | timerdialog | No | |
local_Trigger | trigger | No | |
local_Ubersplat | ubersplat | No | |
local_Ubersplat_Type | ubersplattype | No | |
local_Unit | unit | No | |
local_Unit_Group | group | No | |
local_Unit_Type | unitcode | No | |
local_Visibility_Modifier | fogmodifier | No | |
local_Weather_Effect | weathereffect | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
/**************************************************************************
*
* Local variable shadowing was problem in the past and I highly
* recommend making backup of your map from time to time.
* I never had errors some people mentioned, mostly because I used
* this method only in GUI blocks where it's correctly scoped.
*
* After all you use Custom Script, it will write code exactly the way
* you write it, it won't create anything extra like GUI blocks do. If
* you don't follow proper syntax you won't be able to play your map.
*
* This is warning so please don't cry if you broke your map.
*
* Finally Even for GUI users I must highly recommend Jass New Gen it
* has many features that even GUI users can benefit from.
*
* -Kobas-
*
***************************************************************************/
//TESH.scrollpos=0
//TESH.alwaysfold=0
local integer udg_local_Ability = GetSpellAbilityId()
local attacktype udg_local_Attack_Type = ATTACK_TYPE_MELEE
local boolean udg_local_Boolean = false
local integer udg_local_Buff = 'BNab'
local camerasetup udg_local_Camera_Object = GetCurrentCameraSetup()
local weapontype udg_local_Combat_Sound = WEAPON_TYPE_METAL_LIGHT_CHOP
local damagetype udg_local_Damage_Type = DAMAGE_TYPE_NORMAL
local defeatcondition udg_local_Defeat_Condition = GetLastCreatedDefeatConditionBJ()
local destructable udg_local_Destructible = GetLastCreatedDestructable()
local integer udg_local_Destructible_Type = GetDestructableTypeId(GetLastCreatedDestructable())
local dialog udg_local_Dialog = GetClickedDialogBJ()
local button udg_local_Dialog_Button = GetLastCreatedButtonBJ()
local effecttype udg_local_Effect_Type = EFFECT_TYPE_EFFECT
local texttag udg_local_Floating_Text = GetLastCreatedTextTag()
local gamecache udg_local_Game_Cache = GetLastCreatedGameCacheBJ()
local gamespeed udg_local_Game_Speed = GetGameSpeed()
local handle udg_local_Handle = udg_local_Handle //<- You will hardly ever need this in GUI
local hashtable udg_local_Hashtable = GetLastCreatedHashtableBJ()
local image udg_local_Image = GetLastCreatedImage()
local integer udg_local_Image_Type = 0
local integer udg_local_Integer = 0
local item udg_local_Item = GetLastCreatedItem()
local itemtype udg_local_Item_Class = GetItemType(GetLastCreatedItem())
local integer udg_local_Item_Type = GetItemTypeId(GetLastCreatedItem())
local leaderboard udg_local_Leaderboard = GetLastCreatedLeaderboard()
local lightning udg_local_Lightning = GetLastCreatedLightningBJ()
local string udg_local_Lightning_Type = "CLPB"
local multiboard udg_local_Multiboard = GetLastCreatedMultiboard()
local integer udg_local_Order = String2OrderIdBJ("stop")
local pathingtype udg_local_Pathing_Type = PATHING_TYPE_ANY
local player udg_local_Player = GetOwningPlayer(GetLastCreatedUnit())
local playercolor udg_local_Player_Color = GetPlayerColor(GetOwningPlayer(GetLastCreatedUnit()))
local force udg_local_Player_Group = GetPlayersAll()
local location udg_local_Point = GetRectCenter(GetPlayableMapRect())
local quest udg_local_Quest = GetLastCreatedQuestBJ()
local questitem udg_local_Quest_Requirement = GetLastCreatedQuestItemBJ()
local race udg_local_Race = RACE_HUMAN
local real udg_local_Real = 0.00
local rect udg_local_Region = GetPlayableMapRect()
local sound udg_local_Sound = GetLastPlayedSound()
local soundtype udg_local_Sound_Type = SOUND_TYPE_EFFECT
local effect udg_local_Special_Effect = GetLastCreatedEffectBJ()
local string udg_local_String = ""
local integer udg_local_Tech_Type = GetResearched()
local terraindeformation udg_local_Terrain_Deformation = GetLastCreatedTerrainDeformation()
local integer udg_local_Terrain_Shape = 0
local integer udg_local_Terrain_Type = 'Ldrt'
local timer udg_local_Timer = GetLastCreatedTimerBJ()
local timerdialog udg_local_Timer_Window = GetLastCreatedTimerDialogBJ()
local trigger udg_local_Trigger = GetTriggeringTrigger()
local ubersplat udg_local_Ubersplat = GetLastCreatedUbersplat()
local string udg_local_Ubersplat_Type = "TEST"
local unit udg_local_Unit = GetLastCreatedUnit()
local group udg_local_Unit_Group = GetLastCreatedGroup()
local integer udg_local_Unit_Type = GetUnitTypeId(GetLastCreatedUnit())
local fogmodifier udg_local_Visibility_Modifier = GetLastCreatedFogModifier()
local weathereffect udg_local_Weather_Effect = GetLastCreatedWeatherEffect()
//TESH.scrollpos=9
//TESH.alwaysfold=0
/**************************************************************************
*
* New local variables won't have their initial values set
* for example local group udg_local_Unit_Group if used will
* crush trigger at that place. I highly recommend copy pasting
* whole jass code if you don't know what you are doing.
*
* For those experienced, you can go with your own initialization
*
* Example: local group g = CreateGroup()
* local hashtable h = InitHashtable()
*
* Care about memory leaks, all variables that extends handle will
* leak, those are unit, group, effect and so on, it's recommended
* to destroy objects and null them once you finish using them.
*
* Example: call DestroyGroup( udg_local_Unit_Group )
* set udg_local_Unit_Group = null
*
* Notice 1: You are free to create your own custom variables with
* your own custom names. All you need to do is to care
* about GUI -> jass variable conversion where some
* variables like BUFF convert into INTEGER
*
* Example: Int1 -> Custom script: local integer udg_Int1
*
* Notice 2: Trigger Conditions, Pick Every Unit and Do Actions
* and such code will break local variables, because those
* are presented only in this function, not in ones that
* those mentioned create all call. You should just set
* values of globals before you call those functions and
* clean them after you finish.
*
* Example: set udg_local_Unit = SOME_HERO_1
* if (udg_local_Unit == SOME_HERO_2) then
* -> here you use udg_local_Unit
* endif
* set udg_local_Unit = SOME_HERO_1
*
* You can always use another variable to store unit if it's not
* Trigger Unit or Dying Unit, because those 2 act like local variables
*
* Example: set udg_local_Unit2 = udg_local_Unit1
* if (udg_local_Unit2 == SOME_HERO) then
* -> here you use udg_local_Unit2
* endif
* set udg_local_Unit2 = null
* -> here you keep using udg_local_Unit1
*
***************************************************************************/
//TESH.scrollpos=16
//TESH.alwaysfold=0
/**************************************************************************
*
* You can create your own functions and call them using custom script
* There are few things you need to know here:
*
* Trigger when converted to jass will have minimum 2 (3 if with condition)
* functions. One is used for initialization (creating trigger, registering
* event and so on), another handle your GUI actions.
* We need to close that GUI trigger action function with simple command
*
* Custom script: endfunction
*
* This here close function block.
* Now we have this endfunction generated as well so if we try to save map
* it will throw error. So we need to define our own function that will
* match generated endfunction block.
* It should look like this (in jass):
*
* function Trig_Untitled_Trigger_000_Actions takes nothing returns nothing
* endfunction
* endfunction
*
* into ->
*
* function Trig_Untitled_Trigger_000_Actions takes nothing returns nothing
* endfunction
* function OUR_FUNCTION_NAME takes nothing returns nothing
* endfunction
*
* We do that with another simple custom script command.
* Custom script: function OUR_FUNCTION_NAME takes nothing returns nothing
*
* This new function can have it's own local variables that go just below
* this line.
*
* function Trig_Untitled_Trigger_000_Actions takes nothing returns nothing
* endfunction
* function OUR_FUNCTION_NAME takes nothing returns nothing
* local player udg_local_Player = GetOwningPlayer(GetLastCreatedUnit())
* endfunction
*
* This can be useful if we want to reduce code size or do all crazy things
* just like we do them in pure jass code. Functions can take variables or
* return just one variable as well.
*
* We can create simple systems with it.
*
* Example: System that will for our example here display some text
* to player with last created unit and add some gold to him.
*
* function Trig_Untitled_Trigger_000_Actions takes nothing returns nothing
* endfunction
* function OUR_FUNCTION_NAME takes string txt returns nothing
* local player udg_local_Player = GetOwningPlayer(GetLastCreatedUnit())
* local string udg_local_String = txt //<- initialization from function
* Game - Display to (All players) the text: local_String //<- GUI action
* Player - Add 1000 to local_Player Current gold //<- GUI action
* endfunction
*
* Here it is our GUI trigger:
*
* Untitled Trigger 000
* Events
* Conditions
* Actions
* Custom script: endfunction
* Custom script: function OUR_FUNCTION_NAME takes string txt returns nothing
* Custom script: local player udg_local_Player = GetOwningPlayer(GetLastCreatedUnit())
* Custom script: local string udg_local_String = txt
* Game - Display to (All players) the text: local_String
* Player - Add 1000 to local_Player Current gold
*
* Finally we use those functions again using Custom script like this:
*
* Untitled Trigger 001
* Events
* Time - Elapsed game time is 5.00 seconds
* Conditions
* Actions
* Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
* Custom script: call OUR_FUNCTION_NAME( "Red player got 1000 gold" )
*
* And there you have it. Note, functions you call must always be defined
* above code that calls them. test5 custom function trigger is placed above
* test5 code trigger because of this. Now go check it. ;)
*
***************************************************************************/