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

[Trigger] Camera Distance Trigger Help

Status
Not open for further replies.
Level 3
Joined
Mar 24, 2015
Messages
43
*Note: I am new to WE, and this is my first map.

I am working on a map with some cliffs, and higher terrain.
The default camera distance is too far in, so I'm trying to make a trigger that will zoom it out for each player at the beginning of the game. I'm also going to add a trigger for "-zoom xxxx" but I have to figure this one out first.

This is my trigger that isn't working... What is wrong?
"Start Camera" (This trigger is both "Enabled" and "Initially On")
- Events
-- Time-Elapsed game time is 6.00 seconds
- Conditions
- Actions
-- Camera - Set Player 1 (Red)'s camera Distance to target to 1050.00 over 0.00 seconds

I un-checked the "Initially On" box, and with no other changes, that didn't work either.
Elapsed game time is only set to 6 seconds so I can watch it change. Once I know it works, I'll set it to 0.00 seconds (game start time). Again, I am new. It would really help for you to add all details, especially about any other settings I need to have correct in other parts of the WE.

EDIT: Menu - Layer - Cameras: I currently have no cameras on the camera tool palette. Not sure if that matters.
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,378
The camera palette is for placing camera objects - these are use for example in cinematics.
'Initially On' means that the trigger is switched on. If the box is not checked, the trigger won't fire no matter what (as it is in off state).

Are you playing as player 1 red? Try changing the value to for example 100 instead of 1050.
 
Level 3
Joined
Mar 24, 2015
Messages
43
Hmm interesting... I changed it to 100 like you said and it worked. Obviously, that's even more zoomed in, and I need to zoom out.

EDIT: I think what is happening is that I save the map with a new value (ex: 1000) and it takes the Warcraft 3 game some time to update the game list for when I create the custom game to test it. I think if I give it a few minutes (just a guess) then try the map, it will work with the new value.
*Note: I DL'd the NewGen editor, and I can no longer click "Test Map"... I have to manually start WC3, log into multiplayer, create the custom game, and start it to be able to test my game, as of right now... :(
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
Test map should be fine... ctrl+f9 also works.

What probably happened is that you set the distance to almost the same as the regular distance.
Try setting it to 1600 or 1800 or somewhere between those.

You also need something to reset the distance.
Every 0.03 seconds of gametime, check if the distance is not equal to your amount and set the camera to your amount.
When scrolling (changing angle) you automatically zoom back to the regular amount.
 
Level 3
Joined
Mar 24, 2015
Messages
43
Test map should be fine... ctrl+f9 also works.

What probably happened is that you set the distance to almost the same as the regular distance.
Try setting it to 1600 or 1800 or somewhere between those.

You also need something to reset the distance.
Every 0.03 seconds of gametime, check if the distance is not equal to your amount and set the camera to your amount.
When scrolling (changing angle) you automatically zoom back to the regular amount.

Test Map - Well I had a really hard time downloading the Jass New gen editor. Mainly trying to find a free program that would open a .7z file... The only thing I didn't do was update the JassHelper thing it was talking about. Is that why I can't test the map? When I click test, the new gen editor closes, I see the command prompt come up for a split second (not enough to read anything) and disappear. WC3 doesn't even attempt to start.

Regular distance - No, I've used several different values, and none change it. It still goes to the 100 value zoom, so I'm waiting for the WC3 game to recognize my new Map file in the "Test" folder. Once it shows up, I expect it will work :)

Reset distance - Very good idea, thank you! Could you link me or tell me how to do a trigger for that? I've found some triggers around the website, but I can't always find the option they choose. Sometimes I think they're using variables/etc and not mentioning it, leaving me lost.
 
Level 3
Joined
Mar 24, 2015
Messages
43

I already figured that out, thank you though.

Does anyone have a link on how to set up "-cam xxxx" or "-zoom xxxx" if a player wants to change the camera distance? I've found a few but they're from years ago, and I don't see some of those options for certain events or actions.

I made this one myself for Player 1 Red (remember, I'm new) and I think it will work:
Player Camera Zoom
-Events
--Player-Player 1 (Red) types a chat message containing -zoom(space) as A substring
-Conditions
-Actions
--Camera - Set Player 1 (Red)'s camera Distance to target to (Real((Substring((Entered chat string), 6, 9)))) over 0.00 seconds
 
Level 3
Joined
Mar 24, 2015
Messages
43
The trigger is pretty simple,
Event: Every 0.03 seconds of gametime.
Condition: If distance not equal to <value>
Action: Set distance to <value>

Thanks for your continued help.
If I wanted one constant camera distance for all players, that would work.

However, what we are looking for is to allow each player to be able to set their own camera distance. Some people like closer views, some like a much further zoomed out view. This type of camera is done in games like battleships and battletanks.

When my game starts, a trigger will set a default camera distance for all players. If they don't like that distance, I want them to be able to type "-cam xxxx" or "-zoom xxxx" and find a suitable camera distance that they personally prefer.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
make a variable array (real array)

Every 0.03 seconds of gametime
set the camera for every player to the amount in the array for that player.
Player 1 has Camera_Distance[1]
Player 2 has Camera_Distance[2]
etc

When a player types -zoom xxx, change the value to xxx and everything will work.
 
Level 3
Joined
Mar 24, 2015
Messages
43
make a variable array (real array)

Every 0.03 seconds of gametime
set the camera for every player to the amount in the array for that player.
Player 1 has Camera_Distance[1]
Player 2 has Camera_Distance[2]
etc

When a player types -zoom xxx, change the value to xxx and everything will work.

Not sure how to make a variable array.
I know how to do the .03 seconds game time.
I'm not sure if I'm choosing the right camera action. I picked "Set Camera Field (Timed)"... Presets do not have an option for "every player" so I assume I have to make a variable, but I don't know how.
The Action text for ^ is "Set (choose player)'s camera "Distance to target" to "Value" over "0.00" seconds

Could you somehow give me a picture of an exact trigger with this done?
I'll definitely add you to the special thanks section of my map if you want.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You create array variables by checking the array checkbox:
uGcjjJ7.png


In this map the camera is set up to update the camera every time.
 

Attachments

  • TestCamera.w3x
    16.8 KB · Views: 197
Level 3
Joined
Mar 24, 2015
Messages
43
In this map the camera is set up to update the camera every time.

Played around with it and changed some stuff to get a better idea how it works. It works great, I'm impressed!! If it's okay, I'll use this in my map and give you credit!

Only one other question... It's implied that the trigger fires off every .03 seconds. Will this cause any lag?
 
Level 3
Joined
Mar 24, 2015
Messages
43
The operation is too little to cause any lagg even if you call it 15000 times per second.
0.03 will only run 33 times per second.

You can use it and no need for credits. This is too basic.

Okay, Thank you!

All problems are solved. Let thread die :)
 
Status
Not open for further replies.
Top