Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
ActionOnHit VS Action On Enemy Taking Damage...

beanshapedboat
Registered User
Quote
2023-04-11 03:53:17

Having an issue with creating logic to display a hitmarker 2d overlay when using the "ActionOnHit" function. It triggers to when the bullet hits ANY object in the game whether it be a room mesh or otherwise as opposed to the enemy (animated mesh) that I'd like to map it to.

Why is there not a function for "ActionOnTakeDamage" or something similar? Is there a way to go about doing this with other plugins?


sven
Registered User
Quote
2023-04-11 08:41:45

Bullet will hit anything in your game so this logic is correct.
So it will perform action if it hits something.

AI behaviour has action on hit also..this is what you need.
For player set it "this is the player" instead of "random patrol"


beanshapedboat
Registered User
Quote
2023-04-11 20:30:24

wrote:
Bullet will hit anything in your game so this logic is correct.
So it will perform action if it hits something.

AI behaviour has action on hit also..this is what you need.
For player set it "this is the player" instead of "random patrol"


Right, but it triggers the logic when the AI collides with anything as opposed to just a single bullet. What I'm ultimately saying is that the logic is too broad and needs to be specific to taking damage as opposed to collision


VP
Guest
Quote
2023-04-12 08:28:58

Add a game_actor bahviour to your node - this will give it health and other things.

You can then use the "on hit" option for that specific character, rather than using "on impact" for the bullet.

You also then have access to a special variable "(hashtag)node.health"

You can then use this variable to control events, eg:
If (hashtag)node.health <20, Play sound"ouch.wav"

🔎︎



demonnoteternal
Registered User
Quote
2023-04-12 15:24:53

if you want to define a specific type of bullet i can make an example ccb file cuz i know how to make it but i can't explain it


just_in_case
Moderator
Quote
2023-04-12 16:20:46

@beanshapedboat, it seems that your AI is using same name tags, make sure to define different name tags, and attack actors with tags if you are using multiple AI's. and the general name of the AI is also unique.

However the behavior works correctly. The action to trigger the hit works just fine regardless of the collision and bullet hit.

It will only execute the action only if the specific enemy or AI get hit by the bullet. Here is a sample demo file that updates the health of the AI on a overlay each time the AI gets damage or hit by the bullet. You can try shooting at different object but the overlay will only gets updated if you shoot the AI only.

So the action on hit works fine.

Download the demo from here.
https://cdn.discordapp.com/attac...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (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