I have began to learn Vjass yesterday, and i know pretty much, but when i tried to apply my knowledge i find i do not know where to insert libraries and structs, if i insert them at the top of trigger it just gives me tons of errors.
For example:
Does not work and gives about 30 errors(sintax, statement out of function , etc...).
For example:
JASS:
struct unitcustomvalues
integer customvalue1 = 0
endstruct
globals
integer unitcount =0
unitcustomvalues array units
endglobals
function Trig_Custom_Values_Assignment_Actions takes nothing returns nothing
call SetUnitUserData(GetEnteringUnit(), unitcount)
set units[unitcount] = unitcustomvalues.create()
set unitcount =unitcount+1
endfunction
//===========================================================================
function InitTrig_Custom_Values_Assignment takes nothing returns nothing
set gg_trg_Custom_Values_Assignment = CreateTrigger( )
call TriggerAddAction( gg_trg_Custom_Values_Assignment, function Trig_Custom_Values_Assignment_Actions )
call TriggerRegisterEnterRectSimple( gg_trg_Custom_Values_Assignment, GetPlayableMapRect())
endfunction