- Joined
- Feb 28, 2016
- Messages
- 685
What's custom script trigger? This is the one that I have never knew. If you can tell me, i would be appreciated. And please give meet example of code and what they do.
Custom script is a way to use JASS (vJASS and other scripting languages as well) in GUI. Example:
That destroys the current trigger. We use custom script when we have a feature in JASS and we don't in GUI, and we want to use that feature in GUI.
Custom script - call DestroyTrigger(GetTriggeringTrigger())
So, what does this "leak" mean?
Memory leak is if you can't refer to a used part in the memory.
The memory part is occupied, but during runtime the user has no
possibility anymore to read or manipulate the said part in memory.
You can say that leaked memory is unuseable and will hold up space for just nothing.
So, custom scripts are only to remove leaks?
call RemoveLocation()
or set bj_wantDestroyGroup = true
. That is because the two examples I gave you is a native and constant only accessible via JASS script.So, the custom script is good for making what?
function Trig_Test_Trigger_Actions takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", GetRandomLocInRect(GetPlayableMapRect()) )
endfunction
//===========================================================================
function InitTrig_Test_Trigger takes nothing returns nothing
set gg_trg_Test_Trigger = CreateTrigger( )
call TriggerAddAction( gg_trg_Test_Trigger, function Trig_Test_Trigger_Actions )
endfunction
function CreateNUnitsAtLoc takes integer count, integer unitId, player whichPlayer, location loc, real face returns group
call GroupClear(bj_lastCreatedGroup)
loop
set count = count - 1
exitwhen count < 0
call CreateUnitAtLocSaveLast(whichPlayer, unitId, loc, face)
call GroupAddUnit(bj_lastCreatedGroup, bj_lastCreatedUnit)
endloop
return bj_lastCreatedGroup
endfunction
//===========================================================================
function GetRectCenter takes rect whichRect returns location
return Location(GetRectCenterX(whichRect), GetRectCenterY(whichRect))
endfunction
function GetPlayableMapRect takes nothing returns rect
return bj_mapInitialPlayableArea
endfunction
//===========================================================================
function IssuePointOrderLocBJ takes unit whichUnit, string order, location whichLocation returns boolean
return IssuePointOrderLoc( whichUnit, order, whichLocation )
endfunction
function GetLastCreatedUnit takes nothing returns unit
return bj_lastCreatedUnit
endfunction
function GetRandomLocInRect takes rect whichRect returns location
return Location(GetRandomReal(GetRectMinX(whichRect), GetRectMaxX(whichRect)), GetRandomReal(GetRectMinY(whichRect), GetRectMaxY(whichRect)))
endfunction
So, the custom script is good for making what?
"Wietlol mentioned some important things."
Thats new... not me mentioning important things, but people actually knowing they are important.
Fail Java ending tags![]()
If somebody doesn't know how to use parentheses correctly, he'll be unable to use math and code correctly. Almost all coding languages have a start and an ending tag.
HTML: [meh]something[/meh]
JASS: call meh(parameter, Func(parameter))
Java: System.out.printIn("still we have start and ending tags.")
C#: System.console.WriteLine("Still parentheses, not mentioning all {}[]/**/ things.")
They are indeed important.
System.out.println("I'm just a hero for fun");
It a programming language. Unlike natural languages, programming languages follow very strict syntaxes. If the syntax is not correct it throws a syntax error rather than even trying to run.Seems complicated. Because I still don't understand the "()()))(" like that.