• 🏆 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!

Moving Cameras - Key Press

Status
Not open for further replies.
Level 10
Joined
Apr 3, 2006
Messages
535
I would like to do a map that uses key presses during the hero selection part to scroll through camera's what is a basic trigger for doing this? so the player can view the hero types?

Player - Player 1 (Red) Presses the Left Arrow key
 
Level 10
Joined
Apr 3, 2006
Messages
535
what i meant was how do i go from camera 1 ->2 ->3->1 etc by pressing the left/right key and scrolling through
 
Level 4
Joined
Aug 18, 2011
Messages
73
it seems to be easy you can create variables type of Camera object then set them and next create a trigger with
  • Player - Player 1 (Red) Presses the Left Arrow key
event finally if you already in Camera object 1 then switch you to Camera object 2
 
Level 10
Joined
May 21, 2006
Messages
323
Enable Player control when in Letterbox mode

Set CamInteg = 1

Set Cam[1] = Cam 1
Set Cam[2] = Cam 2
Set Cam[3] = Cam 3

If Keyboard Event Up = Caminteg = Caminteg + 1
If Keyboard Event Down = Caminteg = Caminteg - 1

Trigger2:
Every 0.20 sek.

Apply Cam[Caminteg] for Player 1

...
 
Level 10
Joined
Apr 3, 2006
Messages
535
could someone create a sample map, im mainly stuck on the array side of things. I can change camera pressing different buttons just not scroll through the same cameras
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Use a state machine with edges being triggered by the keyboard arrow events.

When in a state the camera behaves in a certain way. This is usually done by disabling the systems of the other camera states and turning on the system of the camera state you have just changed to.

Unlike VHDL where all statements in a process are performed instantaneously, JASS executes statements sequentially so it is very inefficient to reset all state logic at the start of a state transition event. You should instead model each edge of the state machine as a separate case making sure to change only the necessary to go from one state to another. Especially if one of the state edges requires changing of settings of a single camera system it can save on re-loading the entire system.
 
Status
Not open for further replies.
Top