Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, a)How do I make a health system where when a my player gets hit a 2D overlay updates its health. And also what are all my players modifications so they be more functional? |
||||
|
Easy - when you get hit by another enemy, its auto updated against your "player" health - called ' player.health Its updated via 2d overlay via a command every few seconds (100ms or something) with this: $player.health$ the '$' signs always start and end the variable. In this case the variable is a system variable so you have a hash in front, not one you created yourself. If you created a variable like 'hunger' then the command would be just: $hunger$ |
||||
|
NOTE: in front of: player.health put a hash symbol also note its all case sensative also so just match whatever you have used as your player name exactly. |
||||
|
So where should I put the behavior on the enemy or 2D overlay? |
||||
|
And am sorry to bother again but may I also have the behavior I should put on the enemy, the player and the overlay text. |
||||
|
start with the default enemy AI CopperCube has by adding an animated mesh with animations setup already. Set the enemy behavior to: Game actor with health: - change setup of this as needed, either stationary, walking a path or patrolling randomly. - Change AttacksActorwithTags to: YourPlayerName (ie Player1 or whatever your player is called) - add the rest in as you like and add the existing animations attached to walk, attack, die etc - add 'shoot' to 'ActionsOnAttack' and say whether shooting a gun or up close and attacking via melee - can add in shooting sounds as you like etc - may as well add 'Collide when moved' also with collision sized accordingly. - add walking sounds if you like and time the change in sound to match walking speed desired and setup already. Once setup then once in the activation radius the enemy will attack you. Have fun. Check my existing setup if you like here (early days so far): http://lasttrump.net/gamedev.html |
||||
|
Thanks. |
|