Hello everyone, I'm new to the map editor and want to get a working camera that's locked and follows the player's unit properly. I was using OneTwo's Hero Revival tutorial to learn how to revive my unit when he showed the lock/camera system which I really like.
In my map I use a mounting system, so the main(and only) unit control jumps into "vehicles". I was able to get the camera to transfer over to the vehicles he jumps in, but when I unload him I get error's and the system stops working(unless I jump into another vehicles or get killed obviously). Like I said I'm new so I'm mostly experimenting to figure out how things work.
This is my load trigger
Events
Unit - (Triggering unit) Loads cargo
Local Variables
Starting Unit = (Triggering unit) <Unit>
Conditions
Actions
Unit - Change ownership of (Triggering unit) to player 1 and Change Color
Unit - Make (Triggering unit) Commandable
Unit - Unpause (Triggering unit)
Camera - Lock camera input for player (Owner of (Triggering unit))
Camera - Follow for player (Owner of Starting Unit) (Unit group(Starting Unit)) with the camera and Clear Current Target
This works correctly AFAIK, only tested it twice though
(EDIT: Okay I've found an issue, although it may be due to the unload trigger not working. Whenever I leave a vehicle and jump into another one my camera will follow between the vehicle I'm in as well as the vehicles I left.)
And this is my Unload trigger
Events
Unit - (Triggering unit) Unloads cargo
Local Variables
Leaving Unit = (Cargo unit in (Triggering unit) at slot 1) <Unit>
Conditions
Actions
Unit Selection - Deselect (Triggering unit) for player 1
Unit Selection - Select (Triggering cargo unit) for player 1
Unit - Make (Triggering unit) Uncommandable
Unit - Change ownership of (Triggering unit) to player 0 and Change Color
Unit - Pause (Triggering unit)
Camera - Lock camera input for player (Owner of Leaving Unit)
Camera - Follow for player (Owner of Leaving Unit) (Unit group(Leaving Unit)) with the camera and Clear Current Target
(EDIT: i just tried using
Camera - Unlock camera input for player (Owner of (Triggering unit))
Camera - Stop Following for player (Owner of Vehicle Unit) (Unit group(Vehicle Unit)) with the camera and Clear Current Target
Hoping that would fix the issue of the camera switching between vehicles I've been in but it doesn't. Used a global variable as Vehicle Unit)
(EDIT2: I'm not sure what I can do. I did a
Trigger - Stop all instances of Trigger
to see if I could get rid of the camera-ing on the old vehicle but even then the camera still wants to go over it.)
I guess "Cargo unit in (triggering unit) at slot #" isn't what I want for this, or I made a mistake with something else.
Can anyone give me a heads up on what I need to do?
Also, I can't for the life of me figure out how to make the camera system work at the start, only when the unit dies. I'd also like to eventually make this work as co-op or something multiplayer.
I hate to bump a thread but I really would like to get this figured out. I've tried a couple of different methods and they all lead back to the same issues as above.
If anyone needs more clarifications on the problem/s let me know.
Have you tried setting the camera to both the unit and vehicle. I ask because it seems you have a lot of triggers at work when you go in and out of a vehicle but if its possible to just set the same camera to both then there shouldn't be a problem.
How could I set them to both? I'm really new to the editor and learning as I go. I have multiple vehicles so maybe there's a way to set the camera to both the unit and "transport of unit"? I assume that would lock on to whatever vehicle the unit is cargo to? I'm just not sure how I'd do both at the same time. I'll tinker around with it.
Okay I'm pretty much stuck on what to do. I've tried to have it only follow the unit, then follow it as cargo in the vehicle but everything I try still ends up with the camera wanting to follow a vehicle I'm not in anymore. The stop following/unlock actions don't seem to do anything. Going to see if it works with specific units.
Alright I just tried this with actual units on the map and it's still not working. In my opinion it looks like the actions Unlock Camera and Unfollow aren't working how I want them to. I have it set so
Raynor has camera on him.
When Vulture loads Raynor, camera follows/locks vulture.
When Vulture unloads Raynor, camera unfollows/unlocks vulture and follow/locks Raynor.
But when I run as Raynor my camera isn't locked to Raynor. It's going between the vulture and Raynor. How can I completely remove the camera from the vulture?
Hrmmm the actions are working... I just made a key press trigger to stop the following and it worked... Why isn't this working...
Camera - Stop Following for player (Owner of (Triggering unit)) (Unit group((Triggering unit))) with the camera and Clear Current Target
to
Camera - Stop Following for player 1 Vehicles with the camera and Clear Current Target
This doesn't follow both for some reason, just the unit. I think it may deal with the ownership change when I load a vehicle. When not loaded they are neutral and then loaded they are whatever player that loaded in. Now, I really would like to eventually turn this into a multiplayer map, but I don't know what I would convert "player 1" to. Help?
You would just have to do the trigger for each player. Not sure if its a bug but most of the time when I run into triggers where a "all player" or "any player" it seems to mess up if they are the slightest complicated.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello everyone, I'm new to the map editor and want to get a working camera that's locked and follows the player's unit properly. I was using OneTwo's Hero Revival tutorial to learn how to revive my unit when he showed the lock/camera system which I really like.
In my map I use a mounting system, so the main(and only) unit control jumps into "vehicles". I was able to get the camera to transfer over to the vehicles he jumps in, but when I unload him I get error's and the system stops working(unless I jump into another vehicles or get killed obviously). Like I said I'm new so I'm mostly experimenting to figure out how things work.
This is my load trigger
Events Unit - (Triggering unit) Loads cargo Local Variables Starting Unit = (Triggering unit) <Unit> Conditions Actions Unit - Change ownership of (Triggering unit) to player 1 and Change Color Unit - Make (Triggering unit) Commandable Unit - Unpause (Triggering unit) Camera - Lock camera input for player (Owner of (Triggering unit)) Camera - Follow for player (Owner of Starting Unit) (Unit group(Starting Unit)) with the camera and Clear Current Target
This works correctly AFAIK, only tested it twice though
(EDIT: Okay I've found an issue, although it may be due to the unload trigger not working. Whenever I leave a vehicle and jump into another one my camera will follow between the vehicle I'm in as well as the vehicles I left.)
And this is my Unload trigger
Events Unit - (Triggering unit) Unloads cargo Local Variables Leaving Unit = (Cargo unit in (Triggering unit) at slot 1) <Unit> Conditions Actions Unit Selection - Deselect (Triggering unit) for player 1 Unit Selection - Select (Triggering cargo unit) for player 1 Unit - Make (Triggering unit) Uncommandable Unit - Change ownership of (Triggering unit) to player 0 and Change Color Unit - Pause (Triggering unit) Camera - Lock camera input for player (Owner of Leaving Unit) Camera - Follow for player (Owner of Leaving Unit) (Unit group(Leaving Unit)) with the camera and Clear Current Target
(EDIT: i just tried using
Camera - Unlock camera input for player (Owner of (Triggering unit)) Camera - Stop Following for player (Owner of Vehicle Unit) (Unit group(Vehicle Unit)) with the camera and Clear Current Target
Hoping that would fix the issue of the camera switching between vehicles I've been in but it doesn't. Used a global variable as Vehicle Unit)
(EDIT2: I'm not sure what I can do. I did a
Trigger - Stop all instances of Trigger
to see if I could get rid of the camera-ing on the old vehicle but even then the camera still wants to go over it.)
I guess "Cargo unit in (triggering unit) at slot #" isn't what I want for this, or I made a mistake with something else.
Can anyone give me a heads up on what I need to do?
Also, I can't for the life of me figure out how to make the camera system work at the start, only when the unit dies. I'd also like to eventually make this work as co-op or something multiplayer.
I hate to bump a thread but I really would like to get this figured out. I've tried a couple of different methods and they all lead back to the same issues as above.
If anyone needs more clarifications on the problem/s let me know.
Have you tried setting the camera to both the unit and vehicle. I ask because it seems you have a lot of triggers at work when you go in and out of a vehicle but if its possible to just set the same camera to both then there shouldn't be a problem.
How could I set them to both? I'm really new to the editor and learning as I go. I have multiple vehicles so maybe there's a way to set the camera to both the unit and "transport of unit"? I assume that would lock on to whatever vehicle the unit is cargo to? I'm just not sure how I'd do both at the same time. I'll tinker around with it.
Okay I'm pretty much stuck on what to do. I've tried to have it only follow the unit, then follow it as cargo in the vehicle but everything I try still ends up with the camera wanting to follow a vehicle I'm not in anymore. The stop following/unlock actions don't seem to do anything. Going to see if it works with specific units.
Alright I just tried this with actual units on the map and it's still not working. In my opinion it looks like the actions Unlock Camera and Unfollow aren't working how I want them to. I have it set so
Raynor has camera on him. When Vulture loads Raynor, camera follows/locks vulture. When Vulture unloads Raynor, camera unfollows/unlocks vulture and follow/locks Raynor.
But when I run as Raynor my camera isn't locked to Raynor. It's going between the vulture and Raynor. How can I completely remove the camera from the vulture?
Hrmmm the actions are working... I just made a key press trigger to stop the following and it worked... Why isn't this working...
Okay I found out where the issue lies.
If I change
Camera - Stop Following for player (Owner of (Triggering unit)) (Unit group((Triggering unit))) with the camera and Clear Current Target
to
Camera - Stop Following for player 1 Vehicles with the camera and Clear Current Target
This doesn't follow both for some reason, just the unit. I think it may deal with the ownership change when I load a vehicle. When not loaded they are neutral and then loaded they are whatever player that loaded in. Now, I really would like to eventually turn this into a multiplayer map, but I don't know what I would convert "player 1" to. Help?
You would just have to do the trigger for each player. Not sure if its a bug but most of the time when I run into triggers where a "all player" or "any player" it seems to mess up if they are the slightest complicated.