[UPDATE] Pathing is fixed 100%. Check it out and try to prove me wrong so I can fix it if I am. I playtested the FPS demo map a whole bunch tho and I think it's spot on. Also, within a few hours I should have a generic traceline library up and then also a version of the FPS camera system that has a fully implemented weapon traceline with four different weapon trace types (projectile ie rocketlauncher, instant ie sniper rifle, AOE constant ie flamethrower, linear constant ie gatling gun).
Here's a WASD library as well as an FPS camera library which utilizes the wasd. There's also a demo map for each, showing what they're capable right out of the box. All I did was import the libraries. Then for the WASD I created a single trigger to turn the direction key booleans into a moving hellion, and for the FPS replaced the placeholder variable 'Camera' in the initialization trigger with a camera object I set to look like an FPS view. I admit both maps are sloppy, but the libraries are the important things here, I only made the maps so that you could see an example of each library implemented to give you an idea of how you can integrate them into a map. In the Wasd map, use wasd to move and turn the hellion along a little racecourse thingy. For the FPS, try running into a cliff, and then try running into a unit, and then finally try climbing onto a cliff by use of a ramp.This will demonstrate my custom function for FPS pathing: no dummy units necessary.
Realized I didn't really explain what they do or how they work.
WASD - This sets the values of four booleans, one for each of the keys. To determine if a variable should be true or false if looks for a key pressed type variable with a predetermined value (W, A, S, D or the arrow keys etc). That way you can change keysets for movement in the map as a sort of player preference option. To use it you'd need a trigger that periodically checks to see if the four direction variables are true, meaning the key is down, and then doing some action in response.
FPS - This is primarily an FPS camera set up. It has TPS capabilities but it's geared towards FPS. By that I mean that there's pathing in it, to keep the player from walking up a cliff or through a unit. TPS doesn't really need pathing that way because there's a unit involved, and that keeps it from making illegal movements. Anyway the only thing you need to do to make it work is replace a field in the map initialization trigger action where it sets the player view to a camera. You need to make a camera in the map window and set its properties to those acceptable for an FPS (height around 0.6, distance low, angle of view 20 to 30ish, my settings in my map). Then in the map init trigger replace the camera field. It is currently occupied by a placeholder variable unsurprisingly named 'Camera'. Replace that variable with your camera listed in the 'value' tab, and there you go.
I walked into a cliff and went straight to the top on your FPS demo map. Looking around with mouse is smooth, but running around feels very rough. Just some feedback from a noobie.
The FPS one was very rough as noted and I walked to the top of the ramp and got stuck on a wall.
In the Hellion one the camera was really jerky. You can just set the camera to follow that unit in the map init trigger so there's no need to constantly update its location (Which seems to be creating the jerkiness).
The control system was smooth though and making the Hellion move and turn faster could make for a bit of fun.
Like I noted in the vaeats, the demo maps are rather rough. Basically all they are is just the library imported into a map. in the WASD one the camera's jerky, but the wasd library isn't. It does its job so I figure eh, good enough to demonstrate the library.
The new version of the FPS w/pathing also has a new demo map. Check it out and see if you can find any pathing bugs, because I playtested it to death and AFAIK the pathing is fuly working now.
@ M1n1sh4
I don't know quite what you mean by the libraries don't work. Can you be more specific? All you do with the FPS camera map is import the library, create your FPS camera object in the terrain tab, and then follow the instructions in the 'Map Init' trigger.
To summarize:
1 - Go to the terrain window an make a new camera. Set it to a FPS-like camera. Example would be distance of 1, field of view around 25 to 30. Pitch to 0. Z offset to 0.6.
2 - Now, go to the action in the 'Map init' trigger that sets player 1's view to a camera. The camera field is currently occupied by a variable 'camera'.
3 - Click that field. It will open a window which will open with the 'variables' tab selected. Select the 'value' tab instead. Your camera you made will be listed there. Select it an then hit okay to close the field edit window.
4 - Now the field should say 'camera 001' or whatever the name of your camera object. It should not be a variable named 'camera'.
5 - Lastly, delete the variable named 'camera', as it's a placeholder. Nothing will go wrong if you don't delete it, but for tidyness sake why not.
Don't know how much simpler to put the instructions. Let me know if you still can't get it working.
Finally, how to make attacking AI? Simply make a trigger like this
EVENT: every 0.0 sec
CONDITION: movement enable = true
ACTION: move unit instantly to point: unit field should be 'invisible dummy unit' and point should be 'Camera location'
The invisible dummy unit would be whatever dummy you either place in the map terrain window, or create through triggers. as for making the dummy unit, that is done in the data editor.
I looked at your Triggers and have a few question.
Only 2 Triggersevents for the Button (up&down) is because of the network traffic is clear but why do you use so many variables (boolsche operators)?
Is it good to make only ONE Big Trigger with a lot of commands and a refresh in 0.0 Realtime or is it better to make 4 Triggers (maximal 2 at the same time) and only with 1/3 or 1/4 size? In the case that only 1 button is pushed the "perfomance" will be better or?
Do you know a way to measure the efficience of a trigger method like a runtest or something?
Only 2 Triggersevents for the Button (updown) is because of the network traffic is clear but why do you use so many variables (boolsche operators)?
I'm assuming you're talking about the WASD triggering. I'll list each variable in the WASD trigger set and what it does:
Forward
Left
Right
Back
These four are true if the key is down. The reason the 'if' statements have two actions instead of just setting the variable to true or false is because it sets the variable corresponding to the key that's down as true. Secondarily, it also sets the opposing direction to be false. This ensures that there can never be a situation where the boolean for a direction and the boolean for the opposite direction are both true. I don't know what my camera update function would do if it detected opposite variables both being true, but I doubt it would do anything useful. So, I set the opposing variable to false so that situation can't ever happen anyway. Those are the only booleans thre are in the WASD system.
Movement enable?
This is a boolean which is required to be true if movement is going to take place. Purpose of that is to allow you to momentarily take movement away from the player during the game. An example of a use in that fashion is this: Player gets into a vehicle. The camera pans from the current FPS view to a TPS camera centered on the vehicle over one second. For that second you'd set movement enable to be false, so that while the camera pans and you enable the third person triggers in the library the player doesn't accidentally move the camera target with a WASD press.
Forward key
Right Key
Left Key
Back Key
These are letter variables. This lets you set what letters are used for movement. An example of a trigger using these can be found in my FPS/TPS map itself which can in turn be found in the thread linked to in my signature. The use I put it to is giving the player an options menu that allows them to set what they want to use for moving and shooting. Movement in that case in my map can be WASD or arrow keys depending on player preference. The shooting command can be the left mouse button or the spacebar.
Is it good to make only ONE Big Trigger with a lot of commands and a refresh in 0.0 Realtime or is it better to make 4 Triggers (maximal 2 at the same time) and only with 1/3 or 1/4 size? In the case that only 1 button is pushed the "perfomance" will be better or? Do you know a way to measure the efficience of a trigger method like a runtest or something?
I'm gonna get on this right away and try to find an answer to yer question.
There's a performance window in the debug window that I'll use to find out.
The weapons library is on the way, ad almost ready.
I modified a little and deleted a lot of variables etc. because i have only interest in a fps mode.
I build 4 Triggers for every direction one.
The Main Problem is, which map is not important, that the last command for the new camera position is instant so i have everytime a non smooth movement. When i use the another camera command over x seconds with speed... its very smooth but in the movement time i lose mouse control ...
[UPDATE] Pathing is fixed 100%. Check it out and try to prove me wrong so I can fix it if I am. I playtested the FPS demo map a whole bunch tho and I think it's spot on. Also, within a few hours I should have a generic traceline library up and then also a version of the FPS camera system that has a fully implemented weapon traceline with four different weapon trace types (projectile ie rocketlauncher, instant ie sniper rifle, AOE constant ie flamethrower, linear constant ie gatling gun).
Here's a WASD library as well as an FPS camera library which utilizes the wasd. There's also a demo map for each, showing what they're capable right out of the box. All I did was import the libraries. Then for the WASD I created a single trigger to turn the direction key booleans into a moving hellion, and for the FPS replaced the placeholder variable 'Camera' in the initialization trigger with a camera object I set to look like an FPS view. I admit both maps are sloppy, but the libraries are the important things here, I only made the maps so that you could see an example of each library implemented to give you an idea of how you can integrate them into a map. In the Wasd map, use wasd to move and turn the hellion along a little racecourse thingy. For the FPS, try running into a cliff, and then try running into a unit, and then finally try climbing onto a cliff by use of a ramp.This will demonstrate my custom function for FPS pathing: no dummy units necessary.
Realized I didn't really explain what they do or how they work.
WASD - This sets the values of four booleans, one for each of the keys. To determine if a variable should be true or false if looks for a key pressed type variable with a predetermined value (W, A, S, D or the arrow keys etc). That way you can change keysets for movement in the map as a sort of player preference option. To use it you'd need a trigger that periodically checks to see if the four direction variables are true, meaning the key is down, and then doing some action in response.
FPS - This is primarily an FPS camera set up. It has TPS capabilities but it's geared towards FPS. By that I mean that there's pathing in it, to keep the player from walking up a cliff or through a unit. TPS doesn't really need pathing that way because there's a unit involved, and that keeps it from making illegal movements. Anyway the only thing you need to do to make it work is replace a field in the map initialization trigger action where it sets the player view to a camera. You need to make a camera in the map window and set its properties to those acceptable for an FPS (height around 0.6, distance low, angle of view 20 to 30ish, my settings in my map). Then in the map init trigger replace the camera field. It is currently occupied by a placeholder variable unsurprisingly named 'Camera'. Replace that variable with your camera listed in the 'value' tab, and there you go.
I walked into a cliff and went straight to the top on your FPS demo map. Looking around with mouse is smooth, but running around feels very rough. Just some feedback from a noobie.
@BacklitAvenger: Go
Love how smooth the camera is
I love this system BUT, how can i put a dummy in the camera? I mean, I need an attacking AI ;) Thanks.
EDIT: Solved ^^
JESUS!! That libraries don't works, I tried 12 times to import them in a map and set a camera but that don't sets.. WTF
The FPS one was very rough as noted and I walked to the top of the ramp and got stuck on a wall.
In the Hellion one the camera was really jerky. You can just set the camera to follow that unit in the map init trigger so there's no need to constantly update its location (Which seems to be creating the jerkiness).
The control system was smooth though and making the Hellion move and turn faster could make for a bit of fun.
V2.0
K so here we go. Pathing is fixed.
Like I noted in the vaeats, the demo maps are rather rough. Basically all they are is just the library imported into a map. in the WASD one the camera's jerky, but the wasd library isn't. It does its job so I figure eh, good enough to demonstrate the library.
The new version of the FPS w/pathing also has a new demo map. Check it out and see if you can find any pathing bugs, because I playtested it to death and AFAIK the pathing is fuly working now.
@ M1n1sh4
I don't know quite what you mean by the libraries don't work. Can you be more specific? All you do with the FPS camera map is import the library, create your FPS camera object in the terrain tab, and then follow the instructions in the 'Map Init' trigger.
To summarize: 1 - Go to the terrain window an make a new camera. Set it to a FPS-like camera. Example would be distance of 1, field of view around 25 to 30. Pitch to 0. Z offset to 0.6.
2 - Now, go to the action in the 'Map init' trigger that sets player 1's view to a camera. The camera field is currently occupied by a variable 'camera'.
3 - Click that field. It will open a window which will open with the 'variables' tab selected. Select the 'value' tab instead. Your camera you made will be listed there. Select it an then hit okay to close the field edit window.
4 - Now the field should say 'camera 001' or whatever the name of your camera object. It should not be a variable named 'camera'.
5 - Lastly, delete the variable named 'camera', as it's a placeholder. Nothing will go wrong if you don't delete it, but for tidyness sake why not.
Don't know how much simpler to put the instructions. Let me know if you still can't get it working.
Finally, how to make attacking AI? Simply make a trigger like this EVENT: every 0.0 sec CONDITION: movement enable = true ACTION: move unit instantly to point: unit field should be 'invisible dummy unit' and point should be 'Camera location' The invisible dummy unit would be whatever dummy you either place in the map terrain window, or create through triggers. as for making the dummy unit, that is done in the data editor.
Hope that explains things.
I looked at your Triggers and have a few question.
Only 2 Triggersevents for the Button (up&down) is because of the network traffic is clear but why do you use so many variables (boolsche operators)?
Is it good to make only ONE Big Trigger with a lot of commands and a refresh in 0.0 Realtime or is it better to make 4 Triggers (maximal 2 at the same time) and only with 1/3 or 1/4 size? In the case that only 1 button is pushed the "perfomance" will be better or?
Do you know a way to measure the efficience of a trigger method like a runtest or something?
I'm assuming you're talking about the WASD triggering. I'll list each variable in the WASD trigger set and what it does:
Forward Left Right Back
These four are true if the key is down. The reason the 'if' statements have two actions instead of just setting the variable to true or false is because it sets the variable corresponding to the key that's down as true. Secondarily, it also sets the opposing direction to be false. This ensures that there can never be a situation where the boolean for a direction and the boolean for the opposite direction are both true. I don't know what my camera update function would do if it detected opposite variables both being true, but I doubt it would do anything useful. So, I set the opposing variable to false so that situation can't ever happen anyway. Those are the only booleans thre are in the WASD system.
Movement enable?
This is a boolean which is required to be true if movement is going to take place. Purpose of that is to allow you to momentarily take movement away from the player during the game. An example of a use in that fashion is this: Player gets into a vehicle. The camera pans from the current FPS view to a TPS camera centered on the vehicle over one second. For that second you'd set movement enable to be false, so that while the camera pans and you enable the third person triggers in the library the player doesn't accidentally move the camera target with a WASD press.
Forward key Right Key Left Key Back Key
These are letter variables. This lets you set what letters are used for movement. An example of a trigger using these can be found in my FPS/TPS map itself which can in turn be found in the thread linked to in my signature. The use I put it to is giving the player an options menu that allows them to set what they want to use for moving and shooting. Movement in that case in my map can be WASD or arrow keys depending on player preference. The shooting command can be the left mouse button or the spacebar.
That's it.
I'm gonna get on this right away and try to find an answer to yer question.
There's a performance window in the debug window that I'll use to find out.
The weapons library is on the way, ad almost ready.
I modified a little and deleted a lot of variables etc. because i have only interest in a fps mode.
I build 4 Triggers for every direction one.
The Main Problem is, which map is not important, that the last command for the new camera position is instant so i have everytime a non smooth movement. When i use the another camera command over x seconds with speed... its very smooth but in the movement time i lose mouse control ...