Using Player(Integer A) in JASS

LearningCode

New Member
Reaction score
24
I'm gonna' go to bed now..
3.41PM here..

Damn tired..
Spent 12hours trying to learn this incredibly tough shit..
*snores*

Well, that's Day1 of my learning over.
 

LearningCode

New Member
Reaction score
24
Haiz.

When I try to null and destroy a trigger, it fails horribly.
The trigger ends up destroyed before it even completes its task.

=.=

This example:
JASS:
function Trig_InitAHSMaul_Actions takes nothing returns nothing
   local integer i= 0
   local player p
   call SetMapFlag(MAP_FOG_ALWAYS_VISIBLE, true) //-- This code is supposed to make the whole map visible, but failed
   loop
   set p=Player(i)
   call SetPlayerState( p, PLAYER_STATE_RESOURCE_GOLD, 100 )
   call SetPlayerState( p, PLAYER_STATE_RESOURCE_LUMBER, 1 )
   call ForceAddPlayer( udg_Defenders, p )
   set i = i+1
   exitwhen i == 11
   endloop
   call SetGameSpeed( MAP_SPEED_FASTEST )
   call LockGameSpeedBJ(  )
   call SetTimeOfDayScale( 9.00 )
   call SuspendTimeOfDay(true)
   call ForceRemovePlayer( udg_Defenders, Player(11) )
   call SetPlayerState( Player(11), PLAYER_STATE_GIVES_BOUNTY, 1 )
   call SetUnitInvulnerable( gg_unit_nbsp_0009, true )
   call DestroyTimer(GetExpiredTimer())
endfunction

//===========================================================================
function InitTrig_InitAHSMaul takes nothing returns nothing
    local trigger u 
    set u = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( u, 0.10 )
    call TriggerAddAction( u, function Trig_InitAHSMaul_Actions )
endfunction


Adding null and Destroy trigger makes the trigger not work at all.
 

LearningCode

New Member
Reaction score
24
oo..
Testing it now.

then how do I make it NOT night time in the map?

JASS:
   call SetTimeOfDayScale( 9.00 )
   call SuspendTimeOfDay(true)


That was what I used to make it sunny morning, but it isn't.
It shows night time.

I tried 14.00, too.
2pm, and it's night time =.=

[Edit]
Woah, your suggestion to destroy the trigger with (GetTriggeringTrigger) worked.

The code I posted up previously was without my attempt.

My attempt was at the bottom function =x

Attempt failed:
JASS:
   call RemoveTrigger(u)
   set u = null
 

LearningCode

New Member
Reaction score
24
I'll keep that in mind =x
so..

Any idea how to go about fixing this?

JASS:
   call SetTimeOfDayScale( 9.00 )
   call SuspendTimeOfDay(true)


I want the lighting to be around 9am..
But even with the trigger setting it to 9am and suspending it, the map ends up at night time =/
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top