- Joined
- Apr 5, 2013
- Messages
- 154
If I were to learn jass, would learning other languages such as c++ or python be made easier? Are there any correlations between them? I'm going to start trying jass out in any case.
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
set gg_trg_Untitled_Trigger_001 = CreateTrigger( )
call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction
Yes, it's normal that there is a default code when you convert from GUI to custom script.Is the pre-existing code supposed to be there at all? This is really confusing.
function Trig_Trigger1 takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), "Test" )
endfunction
//===========================================================================
function InitTrig_Trigger1 takes nothing returns nothing
set gg_trg_Trigger1 = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Trigger1, Player(1), "Test", true )
endfunction
Hmm, sounds logical. I'll try it out soon.
Edit: So here's what I got
You can probably see what I tried to do, player 1 types "Test" and the game prints "Test". It's not working, though.Code:function Trig_Trigger1 takes nothing returns nothing call DisplayTextToForce( GetPlayersAll(), "Test" ) endfunction //=========================================================================== function InitTrig_Trigger1 takes nothing returns nothing set gg_trg_Trigger1 = CreateTrigger( ) call TriggerRegisterPlayerChatEvent( gg_trg_Trigger1, Player(1), "Test", true ) endfunction
SetUnitPosition(unit u, real x, real y)
, it makes absolute sense. This function grabs the unit you specify, and changes its coordinates to a (x,y) of your choice. From there to getting used to the traditional OOP dot notation is a very short distance.