• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Converting from GUI to JASS not working

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2011
Messages
460
Hi. I'm fairly new to Jass, and im trying to make a simple minigame type map and I'm unfamiliar with all the function translations and such, so i make them in GUI, and convert to custom text, and try to make it fit into my functions. But i script checked the conversion, and it had syntax errors. How is this possible? I think in the GUI i fixed all the leaks, and then i convert and its leaking in Jass. I don't understand. Please do note. I'm just now trying to learn Jass with a headon approach. If you think there is a tutorial that would benefit me, please by all means post it.

  • BeginGUI
    • Events
    • Conditions
    • Actions
      • Set temp_Loc = (Center of (Playable map area))
      • Player Group - Pick every player in Players and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Wisp for (Picked player) at temp_Loc facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_tempLoc)
JASS:
function Trig_BeginGUI_Func002A takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'ewsp', GetEnumPlayer(), udg_temp_Loc, bj_UNIT_FACING )
endfunction

function Trig_BeginGUI_Actions takes nothing returns nothing
    set udg_temp_Loc = GetRectCenter(GetPlayableMapRect())
    call ForForce( udg_Players, function Trig_BeginGUI_Func002A )
    call RemoveLocation(udg_tempLoc)
endfunction

//===========================================================================
function InitTrig_BeginGUI takes nothing returns nothing
    set gg_trg_BeginGUI = CreateTrigger(  )
    call TriggerAddAction( gg_trg_BeginGUI, function Trig_BeginGUI_Actions )
endfunction
 
Level 9
Joined
Apr 23, 2011
Messages
460
So like this?
JASS:
function Trig_gfg_Func002A takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'ewsp', GetEnumPlayer(), udg_temp_Loc, bj_UNIT_FACING )
endfunction
globals
      temp_Loc = GetRectCenter(GetPlayableMapRect())
      Players = GetPlayersAll()
endglobals
function Trig_gfg_Actions takes nothing returns nothing
    set udg_temp_Loc = GetRectCenter(GetPlayableMapRect())
    call ForForce( udg_Players, function Trig_gfg_Func002A )
    call RemoveLocation(udg_temp_Loc)
endfunction

//===========================================================================
function InitTrig_gfg takes nothing returns nothing
    set gg_trg_gfg = CreateTrigger(  )
    call TriggerAddAction( gg_trg_gfg, function Trig_gfg_Actions )
endfunction
 
Status
Not open for further replies.
Top