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

vJASS Camera System

Status
Not open for further replies.
Level 6
Joined
Feb 5, 2012
Messages
1,685
I really don't know much about vJASS but i am requesting a vJASS Camera system.. Why?

Because it cause lag if in GUI and i heard vJASS is effecient..


Heres the vJASS Camera

Up - Zoom Out
Down - Zoom In
Left - Rotate Left
Right - Rotate Right

The most important thing is

Make the camera not lock on the position of the unit. I mean the camera locks only to the position of the player's hero when the player use the left/right/up/down

It must be MUI/MPI cause it will be used by 1 - 12 Players.
The code must be configrable..


I don't know about vJASS but i understand a little so i can understand your code just make it clear ok?..

So this system is for this map : http://www.hiveworkshop.com/forums/maps-564/accuracy-strike-v1-1b-ai-239180/?prev=status=p
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Hey i got your message. I'm not sure if i have time to do this. A camera system would have to be MPI since there is only one camera per player. Is there only one hero per player or is it multiple heroes ?

So up locks onto that players main hero then zooms out ?
Down locks onto that players main hero and zooms in ?

Is the camera locked onto one unit at all times or does it lock onto the closest hero or a specific hero when the button is pressed ?

Explain exactly how you want it to work so i can make it as close as possible to your needs.

If I do this i will most likely put in the options for players to invert the up and down with a command and invert the left and right with a command so they can use it to their liking. It will give more control to the players playing your game. I will also most likely upload this into spells section if I do this is that ok ?

I won't be able to give an exact date on when I will have this done. It may take a while as i don't have a lot of time. Is that ok ? Also if this turns out to be easier I might make this in jass rather than vJass or maybe both so you can have a choice. I don't believe that vJass will make it faster in this case but i will be able to better tell when i am making it.

It's weird that you asked me as i was just about to rate your map lol. Although i think i stopped because it was protected lol. I like to rate maps with triggers that i can see as i can more easily see what that person's goal was for their map.
 
Level 6
Joined
Feb 5, 2012
Messages
1,685
Hey i got your message. I'm not sure if i have time to do this. A camera system would have to be MPI since there is only one camera per player. Is there only one hero per player or is it multiple heroes ?

So up locks onto that players main hero then zooms out ?
Down locks onto that players main hero and zooms in ?

Is the camera locked onto one unit at all times or does it lock onto the closest hero or a specific hero when the button is pressed ?

Explain exactly how you want it to work so i can make it as close as possible to your needs.

If I do this i will most likely put in the options for players to invert the up and down with a command and invert the left and right with a command so they can use it to their liking. It will give more control to the players playing your game. I will also most likely upload this into spells section if I do this is that ok ?

I won't be able to give an exact date on when I will have this done. It may take a while as i don't have a lot of time. Is that ok ? Also if this turns out to be easier I might make this in jass rather than vJass or maybe both so you can have a choice. I don't believe that vJass will make it faster in this case but i will be able to better tell when i am making it.

It's weird that you asked me as i was just about to rate your map lol. Although i think i stopped because it was protected lol. I like to rate maps with triggers that i can see as i can more easily see what that person's goal was for their map.

Thanks for responding..

Each Player controls 1 Hero. Which it will make you to code the camera system.

If you think JASS will make it easy for you then go for it. But please use JESP cause i don't understand the normal jass coding like i can't identify the variables while on JESP i can understand and maybe do some modification to fit in my game.


Ok it would be better to try this map http://www.hiveworkshop.com/forums/...mate-v1-1-ai-237163/?prev=status=a&u=neo_sluf it uses the camera system that i wanted to.. but it is in GUI so it is not effecient but the way how the camera works is on the map so try playing it.. press LEFT / RIGHT / UP / DOWN

But if you won't i will explain it to you...

In Hero Arenas it would be bad if you lock to the position of the hero all the time right?..

But you can't rotate or zoom up the camera if it is not lock right?

So if the player press LEFT/RIGHT/UP/DOWN you will lock the camera while the camera is rotating or zooming. After the player release either of the four arrows the camera will UNLOCK..

Ok about the triggers in my map it is GUI and the spells are not MUI/MPI.. so if i rate the trigger in my map it would be 3/5


Ok about the system yes you can release it.

It will be the most helpful camera system to most hero arenas..
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
If i can't see triggers when rating map i just leave it as N/A also if spells aren't MUI/MPI i rate triggers as 1/5

In Hero Arenas it would be bad if you lock to the position of the hero all the time right?..
I'm not sure about this ? lol
I would think it would make it more interesting however i will make it so that you can easily choose between permanent lock on and only when rotating.

When i make any system in Jass i make it GUI friendly which means that the config trigger is in GUI. No need to know how jass works at all. It also uses all GUI variables so you don't have to copy anything except the GUI trigger ( config code ) and the jass trigger ( main code )
I do it this way to make it as easy as possible for GUIers to use my systems while the systems have jass speeds.

Ill see what i can do to make it as close to that game as you want. Make sure to give credits to that map for the idea when you use this though.
 
Level 6
Joined
Feb 5, 2012
Messages
1,685
If i can't see triggers when rating map i just leave it as N/A also if spells aren't MUI/MPI i rate triggers as 1/5

In Hero Arenas it would be bad if you lock to the position of the hero all the time right?..
I'm not sure about this ? lol
I would think it would make it more interesting however i will make it so that you can easily choose between permanent lock on and only when rotating.

When i make any system in Jass i make it GUI friendly which means that the config trigger is in GUI. No need to know how jass works at all. It also uses all GUI variables so you don't have to copy anything except the GUI trigger ( config code ) and the jass trigger ( main code )
I do it this way to make it as easy as possible for GUIers to use my systems while the systems have jass speeds.

Ill see what i can do to make it as close to that game as you want. Make sure to give credits to that map for the idea when you use this though.

Even though my spells are not MUI/MPI they don't leak at all and no bugs and this is intended since players can't have the same heroes. I am still learning vJASS so i can code spells more effecient.

Actually it is not needed to make players choose to lock or unlock all the time because you need to see the position of the other players in the map cause it is accuracy map

Ok so for more clarrification heres the code of my GUI Camera System

  • Rotate Start Left
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
      • Player - Player 2 (Blue) Presses the Left Arrow key
    • Conditions
      • Player_Ready[(Player number of (Triggering player))] Equal to True
    • Actions
      • Camera - Lock camera target for (Triggering player) to Player_Hero[(Player number of (Triggering player))], offset by (0.00, 0.00) using Default rotation
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 1 (Red)
        • Then - Actions
          • Trigger - Turn on Rotate Left P1 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 2 (Blue)
        • Then - Actions
          • Trigger - Turn on Rotate Left P2 <gen>
        • Else - Actions
  • Rotate Left P1
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Camera - Lock camera target for Player 1 (Red) to Player_Hero[1], offset by (0.00, 0.00) using Default rotation
      • Set Camera_Rotation[1] = (Camera_Rotation[1] + 10)
      • Camera - Set Player 1 (Red)'s camera Rotation to (Real(Camera_Rotation[1])) over 0.00 seconds
      • Camera - Set Player 1 (Red)'s camera Distance to target to (Real(Camera_Zoom[1])) over 0.00 seconds
  • Rotate End Left
    • Events
      • Player - Player 1 (Red) Releases the Left Arrow key
      • Player - Player 2 (Blue) Releases the Left Arrow key
    • Conditions
      • Player_Ready[(Player number of (Triggering player))] Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 1 (Red)
        • Then - Actions
          • Trigger - Turn off Rotate Left P1 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 2 (Blue)
        • Then - Actions
          • Trigger - Turn off Rotate Left P2 <gen>
        • Else - Actions
      • Camera - Reset camera for (Triggering player) to standard game-view over 0.00 seconds
      • Camera - Set (Triggering player)'s camera Rotation to (Real(Camera_Rotation[(Player number of (Triggering player))])) over 0.00 seconds
      • Camera - Set (Triggering player)'s camera Distance to target to (Real(Camera_Zoom[(Player number of (Triggering player))])) over 0.00 seconds
The concept is just the same as rotate right thought it is reverse instead of +10 it is -10

  • Zoom Start Up
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
      • Player - Player 2 (Blue) Presses the Up Arrow key
    • Conditions
      • Player_Ready[(Player number of (Triggering player))] Equal to True
    • Actions
      • Camera - Lock camera target for (Triggering player) to Player_Hero[(Player number of (Triggering player))], offset by (0.00, 0.00) using Default rotation
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 1 (Red)
        • Then - Actions
          • Trigger - Turn on Zoom Up P1 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 2 (Blue)
        • Then - Actions
          • Trigger - Turn on Zoom Up P2 <gen>
        • Else - Actions
  • Zoom Up P1
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Camera - Lock camera target for Player 1 (Red) to Player_Hero[1], offset by (0.00, 0.00) using Default rotation
      • Set Camera_Zoom[1] = (Camera_Zoom[1] + 10)
      • Camera - Set Player 1 (Red)'s camera Distance to target to (Real(Camera_Zoom[1])) over 0.00 seconds
      • Camera - Set Player 1 (Red)'s camera Rotation to (Real(Camera_Rotation[1])) over 0.00 seconds
  • Zoom End Up
    • Events
      • Player - Player 1 (Red) Releases the Up Arrow key
      • Player - Player 2 (Blue) Releases the Up Arrow key
    • Conditions
      • Player_Ready[(Player number of (Triggering player))] Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 1 (Red)
        • Then - Actions
          • Trigger - Turn off Zoom Up P1 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 2 (Blue)
        • Then - Actions
          • Trigger - Turn off Zoom Up P2 <gen>
        • Else - Actions
      • Camera - Reset camera for (Triggering player) to standard game-view over 0.00 seconds
      • Camera - Set (Triggering player)'s camera Distance to target to (Real(Camera_Zoom[(Player number of (Triggering player))])) over 0.00 seconds
      • Camera - Set (Triggering player)'s camera Rotation to (Real(Camera_Rotation[(Player number of (Triggering player))])) over 0.00 seconds
The concept is just the same as zoom down thought it is reverse instead of +100 is it -100



Don't worry i will give you credits and actually i will post in my map that your coding the camera system for me.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
no i meant ill put a boolean in there so you can choose whether you want to lock or unlock the camera to the hero.

I'm not sure what you mean by accuracy map ?

I think for the map you posted that it would be better if it was permanently locked to the unit as it is very jumpy.

I will put an option for that though.

I'll see what i can come up with for you. Hopefully you will like it. I'll try to keep it as close to what you requested as i can.

Also do you know that every time you use offset it leaks a location. That could be why it eventually gets laggy.
 
Level 6
Joined
Feb 5, 2012
Messages
1,685
no i meant ill put a boolean in there so you can choose whether you want to lock or unlock the camera to the hero.

I'm not sure what you mean by accuracy map ?

I think for the map you posted that it would be better if it was permanently locked to the unit as it is very jumpy.

I will put an option for that though.

I'll see what i can come up with for you. Hopefully you will like it. I'll try to keep it as close to what you requested as i can.

Also do you know that every time you use offset it leaks a location. That could be why it eventually gets laggy.

OFFSET CAUSE LEAKS LOCATION damn it! that's why my map is very laggy thanks to hear that next time i will not gonna do that again.

Nevermind the accuracy map just look to the concept of the trigger i post.

About IT IS VERY JUMPY.. yes it is very very jumpy. but the player will need to move around the camerea all over the map. even though his hero is not on that location he can move his camera into that location.

Well ok. make it choosable.. just add a warning message

"Remember that unlocking the camera will make the use of camera system unpleasant"

Hey may i ask it is possible if you can adjust the Angle of Attack of player's camera if he's camera is go outside the boundary of the arena?..

Like for example since the distance of the camera is 1500 and AoA is 100 degrees then when his hero is near on the arena boundary he can see the outside of the arena so if you make it possible to auto adjust AoA so he can't see outside the arena like making it to 90 degress in that way the player can't see the outside. When the camera system detects that the player is not near on the boundary of the map it will auto adjust AoA back to the normal.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Like for example since the distance of the camera is 1500 and AoA is 100 degrees then when his hero is near on the arena boundary he can see the outside of the arena so if you make it possible to auto adjust AoA so he can't see outside the arena like making it to 90 degress in that way the player can't see the outside. When the camera system detects that the player is not near on the boundary of the map it will auto adjust AoA back to the normal.

That would require a lot of hard coding. I don't think i will be able to do that.
I would need to know the exact boundary of the arena on the map with coordinates to detect if the player can see outside. I'll see what i can do.

Best way to do that is just make the arena farther away from anything else so it's not possible to see outside of it.
 
Level 6
Joined
Feb 5, 2012
Messages
1,685
That would require a lot of hard coding. I don't think i will be able to do that.
I would need to know the exact boundary of the arena on the map with coordinates to detect if the player can see outside. I'll see what i can do.

Best way to do that is just make the arena farther away from anything else so it's not possible to see outside of it.

Well its possible but very hard to code ok.. don't add it.. i will not make you to code a very hard request. Actually since i have 6 arenas and more arenas to come i think it will just make the matter worst so just don't add just focus on the main camera system.

Thank you for accepting my request +REP goodluck
 
Status
Not open for further replies.
Top