what to do so that a marine knows how much life you have

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
ChaingunnerSlayer
Posts: 25
Joined: Fri Feb 19, 2021 2:15 pm

what to do so that a marine knows how much life you have

Post by ChaingunnerSlayer »

Hello friends, I'm making an allied marine to fight demons, I'm occupying decorate, is there any way for the marine to know that I have little life and drop me a first aid kit?

Just decorate.

:D
mrspeaker
Posts: 21
Joined: Mon Dec 14, 2020 10:24 pm

Re: what to do so that a marine knows how much life you have

Post by mrspeaker »

Something like this might work:

TNT1 A 0 A_CheckRange(300,1,false)// if the player is too far, the marine skips the health check to prevent it from spawning items where the player can't even see
TNT1 A 0 A_JumpIfHealthLower(50,"HealPlayer",pointer)//Jumps to "HealPlayer" state if pointer's health is lower than 50
As a pointer you use either AAPTR_MASTER (if you spawned him in yourself) or AAPTR_PLAYER#(where # is a number in the range 1 - 8)
50 and "HealPlayer" state are just examples, change them for what you need.

Return to “Scripting”