• 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.

Code Error

Status
Not open for further replies.
Level 9
Joined
Oct 17, 2007
Messages
547
Anyone know why this line of code is an error? WE says it has syntax error, can someone point out to me why?

call CamSwitch(GetPlayerId(GetForLoopIndexA()))
 
Level 6
Joined
Mar 20, 2008
Messages
208
constant native GetPlayerId takes player whichPlayer returns integer

You need to put in a player, not an integer

Try this
call CamSwitch(GetPlayerId(Player(GetForLoopIndexA())))

Probably be more efficient if your camswitch took in a playeri nstead of an integer

call CamSwitch(Player(GetForLoopIndexA()))
 
Level 11
Joined
Apr 29, 2007
Messages
826
constant native GetPlayerId takes player whichPlayer returns integer

You need to put in a player, not an integer

Try this
call CamSwitch(GetPlayerId(Player(GetForLoopIndexA())))

Probably be more efficient if your camswitch took in a playeri nstead of an integer

call CamSwitch(Player(GetForLoopIndexA()))

Wow really, that isn't any more efficient. Its just luxury to use a player instead. :p

well
JASS:
    call CamSwitch(GetPlayerId(Player(bj_forLoopAIndex)))
Should work.
 
Level 6
Joined
Mar 20, 2008
Messages
208
Wow really, that isn't any more efficient. Its just luxury to use a player instead. :p

well
JASS:
    call CamSwitch(GetPlayerId(Player(bj_forLoopAIndex)))
Should work.

Except....all the native camera commands take in players as arguments, not an integer. It was under the assumption that CamSwitch standsfor camera switch.

Regardless, if substituting in the variable does not work, I suggest you post your actual camswitch function
 
Level 9
Joined
Oct 17, 2007
Messages
547
I just do this to the main system instead earlier and it seem to work.

JASS:
 local integer i = 0
         loop            
         exitwhen i > 11            
         call Cam.create(i)
         call CamSwitch(i)
         set i = i+1        
         endloop
 
Status
Not open for further replies.
Top