• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Get A Player's Camera Values

Status
Not open for further replies.
Level 6
Joined
Sep 19, 2005
Messages
169
I want to be able to adjust a players camera through the use of an abilities.

I just don't know how to get the camera values for an individual player in jass.

Could someone give me the jass form of setting a camera value to a variable for triggering player?

For the camera values
angle, distance, rotation, and roll


I'll use as custom script to set as variables, and do the adjusting in GUi. The goal of this is to be able to allow players to customize the cameras to their liking.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Use arrays for each variable.
Example;
Angle[1] = Player 1 Angle
Distance[1] = Player 1 Distance

The maximum number in that array should be 12 because Warcraft III has limited the players to be at most, 12.

Example Usage:
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -angle as A substring
    • Conditions
    • Actions
      • Set Angle[(Player number of (Triggering player))] = (Real((Substring((Entered chat string), 8, 10))))
In this case, it uses Player number of (Triggering player)) inside the array to evaluate each variable setting unique, for that player only.

Wait, did you said you want in in JASS ?
 
Level 6
Joined
Sep 19, 2005
Messages
169
Hey, thanks for trying to help. My problem for not explaining better. I want aplayer to be able to take whatever their current camera is, and to be able to adjust it. So what I mean is, lets say the camera angle is 21. If he uses a ability, it detects what his current camera is and modifies the angle by 10, so that now it's 31.

I can easily just set the camera to something, but I'm trying to detect what the players X camera value currently is.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
constant native GetCameraField takes camerafield whichField returns real

Fields:
JASS:
CAMERA_FIELD_ANGLE_OF_ATTACK
CAMERA_FIELD_FARZ
CAMERA_FIELD_FIELD_OF_VIEW
CAMERA_FIELD_ROLL
CAMERA_FIELD_ROTATION
CAMERA_FIELD_TARGET_DISTANCE
CAMERA_FIELD_ZOFFSET

You will probably need to use the function within local player block to get values from the player you want.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
No, the value is already localized for each player, no need of GetLocalPlayer.
I mean it will already return a different value for each player's computer.

So just use it.

However if you want to change the camera only for one player you will have to use GetLocalPlayer for apply the cam, but i guess that GUI actions already give the possibility to change the camera for the player X, no ?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Hey, thanks for trying to help. My problem for not explaining better. I want aplayer to be able to take whatever their current camera is, and to be able to adjust it. So what I mean is, lets say the camera angle is 21. If he uses a ability, it detects what his current camera is and modifies the angle by 10, so that now it's 31.

I can easily just set the camera to something, but I'm trying to detect what the players X camera value currently is.
Does this not work ?
  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Change Angle
    • Actions
      • Set Angle[(Player number of (Triggering player))] = (Angle[(Player number of (Triggering player))] + 10.00)
      • Camera - Set (Triggering player)'s camera Angle of attack to Angle[(Player number of (Triggering player))] over 1.00 seconds
 
Status
Not open for further replies.
Top