• 🏆 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!

[JASS] WE keeps crashing

Status
Not open for further replies.
Level 16
Joined
Oct 12, 2008
Messages
1,570
Sorry, solved
I made a mistake i made alot in the beginning
call TriggerAddCondition(t, function UnitisTrainer)
had to be
call TriggerAddCondition(t, Condition(function UnitisTrainer))
Sorry to take up THW's space


Heey guys,,

I am rewriting some code of my map (from GUI to Jass)
But when i implent this code, the map crashes
I can click 'Enable' twice (to check for any errors) but no errors, so the code is ok,, seems to me,,
But why does it keep crashing?
(The init trigger isnt finished yet,, need to add rects to regions and events and such)

This is normal Jass, no vJass (not needed for this, i think),,
JASS:
function G1F0D2 takes nothing returns nothing
   call DisplayTextToForce(GetPlayersAll(), "This door is locked")
endfunction
function G1F0D1 takes nothing returns nothing
   local real x = GetRectCenterX(gg_rct_Gym1_Door1)
   local real y = GetRectCenterY(gg_rct_Gym1_Door1)
   call HeaderHouseMove(x,y,0)
endfunction
function G1F1Enter takes nothing returns nothing
   local real x = GetRectCenterX(gg_rct_Gym1_Floor1Enter)
   local real y = GetRectCenterY(gg_rct_Gym1_Floor1Enter)
   call HeaderHouseMove(x,y,90)
endfunction
function G1F1Exit takes nothing returns nothing
   local real x = GetRectCenterX(gg_rct_Gym1_Floor1Exit)
   local real y = GetRectCenterY(gg_rct_Gym1_Floor1Exit)
   call HeaderHouseMove(x,y,270)
endfunction
function G1F2Enter takes nothing returns nothing
   local real x = GetRectCenterX(gg_rct_Gym1_Floor2Enter)
   local real y = GetRectCenterY(gg_rct_Gym1_Floor2Enter)
   call HeaderHouseMove(x,y,270)
endfunction
function G1F2Exit takes nothing returns nothing
   local real x = GetRectCenterX(gg_rct_Gym1_Floor2Exit)
   local real y = GetRectCenterY(gg_rct_Gym1_Floor2Exit)
   call HeaderHouseMove(x,y,270)
endfunction
function G1F3Enter takes nothing returns nothing
   local real x = GetRectCenterX(gg_rct_Gym1_Floor3Enter)
   local real y = GetRectCenterY(gg_rct_Gym1_Floor3Enter)
   call HeaderHouseMove(x,y,270)
endfunction
//===========================================================================
function InitTrig_Gym1 takes nothing returns nothing
   local trigger array t
   local region array r
   local integer i = 1
   loop
      exitwhen 1>= 7
      set t[i] = CreateTrigger()
      set r[i] = CreateRegion()
      call TriggerAddCondition(t[i], Condition(function UnitisTrainer))
   endloop
endfunction

Why does it crash?
Can anyone help?

-Yixx,,-

P.S. the function 'HeaderHouseMove' is a function which contains some actions that are applied alot, so i though it would be easy to make it a function,, it is in the header so that is no problem,, also the function 'UnitisTrainer' is in the header,,
 
Status
Not open for further replies.
Top