Hi all. So I've searched up and down and, perhaps due to not using the correct terminology, i haven't been able to find any information and hints on which direction to go in.
Basically what i'm trying to accomplish is having a series of static cameras that the player can push a key and cycle through them. I'm new to the galaxy editor and i have more of a creative mind than a logic one, so the struggle with triggers has been real. I've been able to set up the cameras and cycle through them by binding a separate keys to them, but obviously thats not very practical.
Any push in the right direction would be greatly appreciated!
If I understand correctly, a player that say, pushes the right direction key, it will change from camera 1 to camera 2 and if he presses it again from 2 to 3 and so on and backward if pressing left arrow key.
To do something like that you need a variable, such as an integer, and when the key is press, (say for right key) it adds 1 to the variable. If it was the left key it would remove 1. Then, you might want a bunch of if then else statement to say, if the variable is 1, then apply camera 1, if its 2, then apply camera 2 and so on.
You also need something to prevent going on forever with +1 or -1. Either by doing a math thing to keep the variable within bounds (like between 1 and 10 if you have 10 cameras) or an if then else after the set variable that checks if its "Or" ">10 then set variable 1" "<1 then set variable 10" so that would cycle.
If you need something more like triggers example just say it. But that's one way of doing it.
Sounds like i was pretty close to the mark from what you describe. Only thing different is i'd like it bound to only one key and have it rotate cameras based on room you are in.
So for example a room with two cameras what i've been trying is:
Camera integer = 1
---------------------------
Event:
-Player presses C
Condition:
-Unit is in room1 region
-Camera integer = 1
Action:
-Set room1 camera 1
-Set camera integer = 2
---------------------------
Event:
-Player presses C
Condition:
-Unit is in room1 region
-Camera integer =2
Action:
-Set room1 camera 1
-Set camera integer = 1
ect. ect.
Obviously this isnt working. I started to try the if/then/else statements but i was running into the same issue. It would go to first camera and not the second. Or it would go straight to the second and not the first. Or it would go to the first, then the second then not back to the first. Basically managed to accomplish everything except what i'm trying to do.
Create a variable of type camera, and set it as array, and set its size to the total amount of cameras you have got. Eg. Name it MyCameras.
Fill every index of the array with your cameras. MyCameras[0] will be set to your first camera, MyCameras[1] to the second and so on.
Create a variable of type integer. Eg name it CurrentCameraIndex. Set it initial value to 0.
Create a single trigger. I dont got the galaxy editor at hand, but the structure would be like:
Events:
Player presses C
Conditions:
None that are related to this excercise, add whichever related conditions you need.
Actions:
Set camera for player 1 to MyCameras[CurrentCameraIndex]
Set CurrentCameraIndex = CurrentCameraIndex + 1
if CurrentCameraIndex == (max number of cameras here)
then set CurrentCameraIndex = 0
My suggestion is to always display a message like "Setting camera to (value of CurrentCameraIndex here)" at the top of the trigger to see if it is behaving as intended or see where the issue is.
Just want to add that I'm pretty sure that there's a cycle command, that wraps when you exceed the bounds? I don't have my editor up, but I think that's the case.
Hi all. So I've searched up and down and, perhaps due to not using the correct terminology, i haven't been able to find any information and hints on which direction to go in.
Basically what i'm trying to accomplish is having a series of static cameras that the player can push a key and cycle through them. I'm new to the galaxy editor and i have more of a creative mind than a logic one, so the struggle with triggers has been real. I've been able to set up the cameras and cycle through them by binding a separate keys to them, but obviously thats not very practical.
Any push in the right direction would be greatly appreciated!
Hello Alcohealix,
If I understand correctly, a player that say, pushes the right direction key, it will change from camera 1 to camera 2 and if he presses it again from 2 to 3 and so on and backward if pressing left arrow key.
To do something like that you need a variable, such as an integer, and when the key is press, (say for right key) it adds 1 to the variable. If it was the left key it would remove 1. Then, you might want a bunch of if then else statement to say, if the variable is 1, then apply camera 1, if its 2, then apply camera 2 and so on.
You also need something to prevent going on forever with +1 or -1. Either by doing a math thing to keep the variable within bounds (like between 1 and 10 if you have 10 cameras) or an if then else after the set variable that checks if its "Or" ">10 then set variable 1" "<1 then set variable 10" so that would cycle.
If you need something more like triggers example just say it. But that's one way of doing it.
Good luck.
Working on projects:
@Scbroodsc2
Thanks for the tips!
Sounds like i was pretty close to the mark from what you describe. Only thing different is i'd like it bound to only one key and have it rotate cameras based on room you are in.
So for example a room with two cameras what i've been trying is:
Camera integer = 1
---------------------------
Event:
-Player presses C
Condition:
-Unit is in room1 region
-Camera integer = 1
Action:
-Set room1 camera 1
-Set camera integer = 2
---------------------------
Event:
-Player presses C
Condition:
-Unit is in room1 region
-Camera integer =2
Action:
-Set room1 camera 1
-Set camera integer = 1
ect. ect.
Obviously this isnt working. I started to try the if/then/else statements but i was running into the same issue. It would go to first camera and not the second. Or it would go straight to the second and not the first. Or it would go to the first, then the second then not back to the first. Basically managed to accomplish everything except what i'm trying to do.
Create a variable of type camera, and set it as array, and set its size to the total amount of cameras you have got. Eg. Name it MyCameras. Fill every index of the array with your cameras. MyCameras[0] will be set to your first camera, MyCameras[1] to the second and so on. Create a variable of type integer. Eg name it CurrentCameraIndex. Set it initial value to 0.
Create a single trigger. I dont got the galaxy editor at hand, but the structure would be like:
Events: Player presses C Conditions: None that are related to this excercise, add whichever related conditions you need. Actions: Set camera for player 1 to MyCameras[CurrentCameraIndex] Set CurrentCameraIndex = CurrentCameraIndex + 1 if CurrentCameraIndex == (max number of cameras here) then set CurrentCameraIndex = 0
My suggestion is to always display a message like "Setting camera to (value of CurrentCameraIndex here)" at the top of the trigger to see if it is behaving as intended or see where the issue is.
Go play Antioch Chronicles Remastered!
Also, coming soon, Antioch Episode 3: Thoughts in Chaos!
Dont like mapster's ugly white? Try Mapster's Classic Skin!
Well that was rough to wrap my head around but i think i finally got it working. Thanks a ton for your guys' guidance!
i really wish the forum didnt murder my formatting
Go play Antioch Chronicles Remastered!
Also, coming soon, Antioch Episode 3: Thoughts in Chaos!
Dont like mapster's ugly white? Try Mapster's Classic Skin!
@Alevice: Go
try using the
tags
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Just want to add that I'm pretty sure that there's a cycle command, that wraps when you exceed the bounds? I don't have my editor up, but I think that's the case.
@LucidIguana:
If i remember correctly was it something that cycled through automatically, and not per key command?
@Alcohealix: Go
It modifies an integer value by +1 maintaining it within in bounds, if it would exceed those bounds it then starts again from the bottom.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)