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

RPG Question.....

Status
Not open for further replies.
Level 5
Joined
Jun 10, 2010
Messages
145
Hello, I bring a question, I think it is simple but i don't found a way to solve it....:ogre_rage:
So here is the question:

- In my RPG, the player must choose a hero, so I create a place with the camera angled. To the player chose a hero he need select it. So can't be with the user control off. But if the user control is on, the player can move the camera. I need a trigger to the camera be locked on that place angled and the player must select a hero so, can't be with user control off. Can someone help me???
- Reward: + Reputation :)
Thanks.
 
Level 15
Joined
Oct 16, 2010
Messages
941
  • Camera - Lock camera target for Player 1 (Red) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
I'm sure theres a more direct way to do what you'r asking, but the above is all I could find. You'd have to apply the camera object and then focus it on one of the units (so you'd have to player around with it for a bit but it wouldn't be too hard).

I also checked for Vjass functions but couldn't find any that would help
 
Level 9
Joined
Jul 4, 2007
Messages
130
if you want your camera to be "locked" at a point you can use this:
  • Camera - Set camera bounds for [PLAYER] to (Region(X,Y,X,Y))
You can find the X and Y by putting your cursor on the point you wanna lock on the map view, coordinates are on bottom-left.
And when ur finished (so when the hero is picked) do this:
  • Camera - Set camera bounds for [PLAYER] to (Initial camera bounds)
by using this players won't be able to fuck the camera with CTRL + C or something, slightly longer but clean.
 
Level 5
Joined
Jun 10, 2010
Messages
145
Camera - Lock camera target for Player 1 (Red) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
If I use this trigger the rotation will be wrong....
if you want your camera to be "locked" at a point you can use this:

Camera - Set camera bounds for [PLAYER] to (Region(X,Y,X,Y))
If I use this option the camera not will be angled....
Still thanks(from both)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
What do you mean by Odd ?
Explain
OR you can use this action:
  • Select Hero
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Camera - Apply Select Hero <gen> for Players over 0.00 seconds
      • Camera - Lock camera target for Players to TheUnitThatIsCenter, offset by (0.00, 0.00) using Default rotation
The thing I changed in here is the Event, which is Map Initialization
I didn't use Periodic Timer anymore because Locking a camera would be permanent (well you can remove the lock by using another action)
And 1 more thing, TheUnitThatIsCenter
This unit refers to the position of the unit in the middle of the position of the lineup heroes
Example:
HERO1 , HERO2 , HERO3 , HERO4 , HERO5
Okay, the Locking Camera would be done to the HERO3 position as it is in the middle, making it suitable and perfect for camera
If you have even numbers of Hero, that could be problem BUT it's not problem at all
Just create "dummy" unit at the center of the location of lineup heroes and lock it
Example:
HERO1 , HERO2 , DUMMY , HERO3 , HERO4
Understand ?
 
Level 5
Joined
Jun 10, 2010
Messages
145
Well...I means Rotation....Sorry.
Lock camera target for Players to TheUnitThatIsCenter, offset by (0.00, 0.00) using Default rotation
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Do you worry about the Unit Facing Angle according to the Camera Facing Angle ?
LoL, this camera is ONLY for Selection, after you click on the Hero, load the hero on somewhere else and reset the camera back to the normal way
Here is the test map, but it looks weird because I locked it at even numbers of lineup heroes
 

Attachments

  • Camera Select Hero.w3x
    12.5 KB · Views: 82

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
You have to lock and perodically reset the camera until the player makes his selection.

Locking can be broken by hitting Control + C if I remember correctly. Reseting the lock and camera perodically will prevent any possible abuse. After the selection is made, you can turn off the perodic camera lock and free any resources it used.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
That is why Lock Camera To Unit has better efficiency
Just that, the player will try to press CTRL + C, LOL
You can make it like Every X Seconds, Lock The Camera To Unit, that won't share the camera?
I think
You SHOULD use 0.03 seconds as the Event values in Periodic Timer BUT in this case, mostly Hero Selection will be held at the START of the game, where no units/spells/quests/etc are even created yet
So, using 0.01 won't hurt I think =D
But if it meant for Spells, better use 0.03 seconds okay dude ?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Use 0.016, it is more efficent.
Just reset the lock onto the unit every time.

Also once the selection is done you kill the trigger to save resources so the loop rate does not mater much as it will be happening only at the start of the map before any real activity occurs.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
I do not think so, it is entirly down to what sort of numeric system is used.

I know for a fact that people used to encode whole handle numbers onto timeouts for timers so it definatly is possible.

Whether the actual time keeping of timers is that accurate is another question
 
Status
Not open for further replies.
Top