Blood controller part of demo I want to use for my own file link- how to?

This is blood hit display

from bge import logic
import random

cont = bge.logic.getCurrentController()
scene = bge.logic.getCurrentScene()
own = cont.owner

if own['blood'] > 0:
    own['blood'] -= 1
    own.applyRotation([0.0, 0.0, (random.randint(0, 90))])
    scene.addObject("blood splat", own, 10)

if own['blood'] == 1 or own['blood'] == 2:
    scene.addObject("bloodmist", own, 30)

And the following is blood display

from bge import logic

cont = logic.getCurrentController()
scene = logic.getCurrentScene()
own = cont.owner

#messages
msg1 = cont.sensors['noblood']
msg2 = cont.sensors['80+']
msg3 = cont.sensors['60+']
msg4 = cont.sensors['40+']
msg5 = cont.sensors['20+']
msg6 = cont.sensors['0+']

#bloodspawn
blood1 = cont.actuators['1']
blood2 = cont.actuators['2']
blood3 = cont.actuators['3']
blood4 = cont.actuators['4']
blood5 = cont.actuators['5']

#endobjects
end1 = cont.actuators['end1']
end2 = cont.actuators['end2']
end3 = cont.actuators['end3']
end4 = cont.actuators['end4']
end5 = cont.actuators['end5']

#spawning in blood
if msg1.positive:
    cont.activate(end1)
    cont.activate(end2)
    cont.activate(end3)
    cont.activate(end4)
    cont.activate(end5)
    
if msg2.positive:
    cont.activate(blood1)
    cont.activate(end2)
    cont.activate(end3)
    cont.activate(end4)
    cont.activate(end5)

if msg3.positive:
    cont.activate(blood2)
    cont.activate(end1)
    cont.activate(end3)
    cont.activate(end4)
    cont.activate(end5)
if msg4.positive:
    cont.activate(blood3)
    cont.activate(end1)
    cont.activate(end2)
    cont.activate(end4)
    cont.activate(end5)
if msg5.positive:
    cont.activate(blood4)
    cont.activate(end1)
    cont.activate(end2)
    cont.activate(end3)
    cont.activate(end5)
if msg6.positive:
    cont.activate(blood5)
    cont.activate(end1)
    cont.activate(end2)
    cont.activate(end3)
    cont.activate(end4)

I append the blood controller empty, so it includes it when I loaded it into my game file.

I don’t know how to get it to work in my file.

I don’t know how to link, so when the AI crashes into the player, that loads the effect.

Thank you.

I have tried this, should this be about correct, or well correct.

Everything was appended related to the code, and so these are the objects. So when enemy collides the code is played, and the effect in the Armour section is loaded into the camera as shown in the Minigame section of the blend file.

I had a view of this file again.

Once the AI has damaged the Player. It ends, so this is what is displayed. I would be a lose screen without the overlay one. But even with the Lose_screen that is what displays.

This explains why, the 80+ brick needs to be connected to a 80 message with bloodcontroller added in 80+, the player can’t process the different stages of damage, so there needs to new bricks added for the player object. Not just added in the blood and objects in another layer and just load it in. Hmm Got to try this out first, see if it gives the effect needed.

I ended up with this, I don’t think this is correct, there isn’t anything on the player.

The enemy AI has collision with player and it damages, that is it.

I am not sure here.