• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Trying to convert parts of a map from gui to jass

Status
Not open for further replies.
Level 2
Joined
Mar 8, 2010
Messages
16
Just making my first map, its actually done but i'm optimising it since i want it to run smoothly for 12 players. I didn't discover Jass untill 85% through, so i've been going through the triggers that might get hit more than once a second to reduce the calls in them and i've done myself in a bit on this one.

TLDR:
If either the IF statement or Forgroup is uncommented the map fails to load.

JASS:
function gg_trg_PlayerDeadCheckLoop takes nothing returns nothing
  local group g = CreateGroup()
 //  if (udg_Life[GetEnumPlayer() + 1] <= 0) then //bugged
        call ForceRemovePlayer(udg_Players ,GetEnumPlayer())
        call DisplayTimedTextToForce( bj_FORCE_ALL_PLAYERS, 15.00, ( GetPlayerName(GetEnumPlayer()) + " is a giant FAILURE" ) )
        call GroupEnumUnitsOfPlayer(g,GetEnumPlayer(),null) //create group of the players units
//        call ForGroup(g,RemoveUnit(GetEnumUnit())) //destroy them
        call DestroyGroup(g)  
 //   endif
endfunction

function Trig_PlayerDeadCheck_Actions takes nothing returns nothing
    call ForForce(udg_Players, function gg_trg_PlayerDeadCheckLoop)
endfunction

//===========================================================================
function InitTrig_PlayerDeadCheck takes nothing returns nothing
    set gg_trg_PlayerDeadCheck = CreateTrigger(  )
    call TriggerAddAction( gg_trg_PlayerDeadCheck, function Trig_PlayerDeadCheck_Actions )
endfunction

whats the problem? and why is it that in some cases statements that work fine in one triggers stop the map from loading in another.
 
Last edited:
Level 2
Joined
Mar 8, 2010
Messages
16
managed to get it all working :) thanks, was a lot easier after reinstalling jasshelper,
Getting usefull errors makes debugging FUN

Also it seems you can't do anything but call a function inside ForGroup, which is a shame as theres a lot of one line functions i could scrap otherwise
 
Status
Not open for further replies.
Top