• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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