Scripts / Knockdown/Self-Heal Script? (Request)

Author
Message
geistschatten
12
Years of Service
User Offline
Joined: 10th Apr 2012
Playing: GameGuru
Posted: 1st Sep 2014 22:21
Once the zombies come out (or even with the current characters), it seems like a nice script to have would be something that when your health reaches a certain low (like 10), then it pushes you down, similar to the death scene and has some prompt on the screen such as "Healing in 5, 4, 3....", lastly refills the life to whatever it was at the start but removes one of the lives. As opposed to death and then loading from the last checkpoint/start.

At the very least this is an idea for a store script
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Sep 2014 19:14 Edited at: 2nd Sep 2014 19:17
well i made a version of this but instead of taking away a life (which we dont really have any control over unless i kill the player - which ruins the "healing" effect) you just need to not die for 5 seconds once you reach 25% HP (both delay and HP threshold can be adjusted in the script)

but you can also make it so that it'll heal to a certain amount of max HP (because getting a free full heal might be too much)



we also can't force the player to lie down or not move and such (like when you die) so it's not really a hinderance but best i can do for now i think

if you really want the player to lose a life then you can change the line
Quote: "SetPlayerHealth(max_HP)"
to
Quote: "HurtPlayer(e,g_PlayerHealth)"
but it makes him scream and such... i didn't like it

(also uncomment the Checkpoint(e) line otherwise you wont spawn at that location)



there is a slight bug with the HP if you die while healing in that sometimes it'll still trigger the heal (although i tried to stop this)

it just seems to be a quick visual issue though as seen in the video (at the end)



as always let me know if you have any issues or need any help / changes









life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Attachments

Login to view attachments
tomjscott
User Banned
Posted: 2nd Sep 2014 19:17
Quote: "we also can't force the player to lie down or not move and such"


If you have Omega Core, you can use ocBlockInput to prevent the player from doing anything. Just be sure to re-enable input or you'll be eternally stuck. This function also works well for a stunned effect.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0071
geistschatten
12
Years of Service
User Offline
Joined: 10th Apr 2012
Playing: GameGuru
Posted: 4th Sep 2014 08:41
This is exactly what I had in mind, thank you smallg!

I shall be sure to credit you when I finally get my lazy self to finish my game idea.

Your scripts have been an invaluable resource with FPSCR, and you're motivating me to sit down and learn LUA

Login to post a reply

Server time is: 2024-12-22 01:43:57
Your offset time is: 2024-12-22 01:43:57