my first jassing ;]

Komaqtion

You can change this now in User CP.
Reaction score
469
Go into the Trigger Editor, make a new trigger and convert it to custom text.
Then there should be a small bar in the trigger window, and a button saying "Function List", click that and there it should be ;)
 

ironfist19

New Member
Reaction score
3
I have used the tesh thing and the function list but i need some help ;]

JASS:
function superman takes player id, integer unitid, location mc, real face returns unit
return unit //whenever i save this gets an error saying that undeclared variable 
endfunction

function summonunit takes nothing returns nothing
     call superman ( player (0) , 'hfoo' , GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING)
endfunction

function InitTrig_Practice_02 takes nothing returns nothing
     set gg_trg_Practice_02 = CreateTrigger()
     call TriggerRegisterTimerEventSingle ( gg_trg_Practice_02 , 3)
     call TriggerAddAction ( gg_trg_Practice_02 , function summonunit)
endfunction


the thing i want to do is when the game time is 3 seconds it will spawn a footman in the center of the map..
 

tooltiperror

Super Moderator
Reaction score
231

ironfist19

New Member
Reaction score
3
I have copied that but I have a problem in my Newgen.. i think.. whenever i start my map there is an error War3.exe thingy.. is there any way i can solve this problem?

Edit:

JASS:

//Warning: Freehand
 library Lib initializer onInit
   private function callback takes nothing returns nothing
      call CreateUnit(Player(0),'hfoo',0.00,0.00,270.00)
   endfunction

   private function onInit takes nothing returns nothing
      local trigger t=CreateTrigger()
      call TriggerRegisterTimerEventSingle(t,3.00)
      call TriggerAddAction (t,function callback)
   endfunction
 endlibrary
 

jig7c

Stop reading me...-statement
Reaction score
123
if you just want to create 1 footman at 3 seconds after game time... you don't need to create a trigger, but a timer instead

JASS:
library Lib initializer onInit
 private function callback takes nothing returns nothing
  call CreateUnit(Player(0),'hfoo',0.00,0.00,270.00)
 endfunction
 
 private function onInit takes nothing returns nothing
  call TimerStart (CreateTimer(), 3.00, false, function callback)
 endfunction
 

tooltiperror

Super Moderator
Reaction score
231
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top