~GaLs~
† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
- Reaction score
- 180
Greetz Everyone,
Well, this thread is also comes with question related to vjass syntax...My VJASS thread was a messy....and i decided to start a new thread to overcome..
Now here is my problem....i had 3 trigger with the same purpose...but only the trigger that uses struct fail....any would help?
This is the STRUCT METHODED trigger
This is the GLOBAL METHODED trigger
This is LOCAL HANDLES VARS METHODED trigger
Now all those 3 trigger works as i want...but there is still question down there....see the last post of this thread.
Well, this thread is also comes with question related to vjass syntax...My VJASS thread was a messy....and i decided to start a new thread to overcome..
Now here is my problem....i had 3 trigger with the same purpose...but only the trigger that uses struct fail....any would help?
This is the STRUCT METHODED trigger
JASS:
struct words
string entered = ""
trigger Test2
endstruct
globals
words Gword
endglobals
function test2act takes nothing returns nothing
local words CS2 = Gword
local string xx = ""
local integer start = 1
set xx = CS2.entered
loop
exitwhen start >5
call DisplayTimedTextToPlayer(Player(0), 0,0,5,xx)
set start = start +1
endloop
set xx = ""
call Gword.destroy()
call DestroyTrigger(GetTriggeringTrigger())
endfunction
function Trig_Test1_Actions takes nothing returns nothing
local words CS = words.create()
set CS.Test2 = CreateTrigger()
set CS.entered = GetEventPlayerChatString()
set Gword = CS
call TriggerAddAction(CS.Test2, function test2act)
call TriggerExecute(CS.Test2)
endfunction
//===========================================================================
function InitTrig_Test1 takes nothing returns nothing
set gg_trg_Test1 = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Test1, Player(0), "struct", true )
call TriggerAddAction( gg_trg_Test1, function Trig_Test1_Actions )
endfunction
This is the GLOBAL METHODED trigger
JASS:
globals
string entered2
trigger Test22
endglobals
function test2act takes nothing returns nothing
local integer start = 1
loop
exitwhen start >5
call DisplayTimedTextToPlayer(Player(0), 0,0,5,entered2)
set start = start +1
endloop
call DisableTrigger(GetTriggeringTrigger())
call DestroyTrigger(GetTriggeringTrigger())
endfunction
function Trig_Test1_Actions takes nothing returns nothing
set Test22 = CreateTrigger()
call DisableTrigger(Test22)
set entered2 = GetEventPlayerChatString()
call TriggerAddAction(Test22, function test2act)
call TriggerExecute(Test22)
endfunction
//===========================================================================
function InitTrig_Test2 takes nothing returns nothing
set gg_trg_Test2 = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Test2, Player(0), "struct", true )
call TriggerAddAction( gg_trg_Test2, function Trig_Test1_Actions )
endfunction
This is LOCAL HANDLES VARS METHODED trigger
JASS:
function test2act takes nothing returns nothing
local timer t = GetExpiredTimer()
local string enter = GetHandleString(t, "Ent")
local integer start = 1
loop
exitwhen start >5
call DisplayTimedTextToPlayer(Player(0), 0,0,5,enter)
set start = start +1
endloop
call FlushHandleLocals(t)
call DestroyTimer(t)
set t = null
endfunction
function Trig_Test1_Actions takes nothing returns nothing
local string entered3 = GetEventPlayerChatString()
local timer t = CreateTimer()
call SetHandleString(t, "Ent", entered3)
call TimerStart(t, 0.1, false, function test2act)
endfunction
//===========================================================================
function InitTrig_Test3 takes nothing returns nothing
set gg_trg_Test3 = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Test3, Player(0), "struct", true )
call TriggerAddAction( gg_trg_Test3, function Trig_Test1_Actions )
endfunction
Now all those 3 trigger works as i want...but there is still question down there....see the last post of this thread.