Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Creating a player health system.

expertjim
Registered User
Quote
2019-06-13 09:50:32

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?


Robo
Guest
Quote
2019-06-13 12:19:10

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$


Robo
Guest
Quote
2019-06-13 12:20:56

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.


expertjim
Registered User
Quote
2019-06-13 13:12:52

So where should I put the behavior on the enemy or 2D overlay?


expertjim
Registered User
Quote
2019-06-13 13:17:48

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.


Robo
Guest
Quote
2019-06-14 14:17:57

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


expertjim
Registered User
Quote
2019-06-14 21:42:15

Thanks.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internat?onal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact