GetCameraField()?

WilliamPa

Active Member
Reaction score
51
Soo, I'm trying to make a smooth camera which follows the hero around. However, i got a problem with getting camera fields. I need to get the current camera rotation of the player i want to. GetCameraField only takes the camerafield and not a player.

Soo, how to use it, or is it possible?

Do i need to use variables instead of GetCameraField()?
 

Nestharus

o-o
Reaction score
84
When using cameras, you always do something like this : )

JASS:
if GetLocalPlayer() == whichPlayer then
endif


GetLocalPlayer() returns the player for a given machine. What happens is the host machine runs code and sends out commands to all the other machines to run the code. It also sends out data for all related information for that code (like a player).

GetLocalPlayer() is the current player of the machine. whichPlayer would be data sent out by the host.


In essence, if whichPlayer is Player(0), then only the machine that Player(0) is on will return true. The others will return false.


Be warned that because of this, you can easily desync maps. Only use this on things that can be unique to each computer, like strings or player windows or camera setups for a player : ).


If you wanted to use it with the CameraField-

JASS:
if GetLocalPlayer() == whichPlayer then
    set var = GetCameraField(whichfield)
endif


If you would like more information on GetLocalPlayer, go ahead and google it. Here's the first result from a google search-
http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=89207

Good luck and Have fun : D.
 

Viikuna

No Marlo no game.
Reaction score
265
Using GetCameraField natives without GetLocalPlayer works too.

JASS:

set var=GetCameraField(whichfield)
call DoSomething(var)


Just remember that [lJASS]var[/lJASS] now holds different values in different machines, so you should not use it for anything else but stuff that can be unique for different computers ( For example this kind of camera stuff ), like Nestharus mentioned.

Also, if you are interested about camera systems, you should check OppiCam, since its pretty cool. It would be a good reference when making your own system.
 
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