Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Several problems with health scripts

Author
Message
Madcow02
8
Years of Service
User Offline
Joined: 29th Jan 2016
Location: Under My Skin
Posted: 4th Nov 2016 15:58
Hello !

I have two scripts in my test map, the first is used to display player's health as an animation, and the second one allows the player to carry up to three medkits s/he can use whenever s/he wants.
Everything works fine but the problem is that the medkits makes me invincible (the healthpoints are then set to 9999)... I've changed the health base value from the inventar.fpi script to make it match with the one found in controlloenergia.fpi but still, no luck again ! I don't know how this could be, I don't think it's a variable related problem since the script for the animation doesn't contain any.

Here's the animated hud
https://forum.thegamecreators.com/thread/172017

Here's the medkit script
http://s000.tinyupload.com/download.php?file_id=54858642236311364291&t=5485864223631136429112904


Can someone help me, please ?
Thank you !
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 5th Nov 2016 20:27
Hey MadCow, will try and help you out. In hospital at the moment but can still look at forums. Paste the whole script code your using for this with the "code insert" and I'll look over it.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Madcow02
8
Years of Service
User Offline
Joined: 29th Jan 2016
Location: Under My Skin
Posted: 6th Nov 2016 20:01
Get well soon ncmako and thank you to help me to sort things up !

The script controlling the animated hud




The ones for the medkits.




ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 7th Nov 2016 16:08 Edited at: 8th Nov 2016 00:30
MadCow
I looked over scripts quickly. On the last code snippet. At the bottom, state=3 goes back to state=0 ? That's where your health var. is set back to 3. Its a loop. You never use any health packs up. I'll think of solution.
Also, in main HUD script. I noticed your using an older script with old "timer" command.
They can cause problems, change all to "etimer" for a more stable script.

Hi mad cow, noticed another script error.
For player health used " plrhealthless=" not
"healthless". those are for entities and NPC characters health.
Also have you thought of using " dimvar"
Instead of " globalvar? You may have better
control in the script to set & use variables?
My games never have bugs. They just develop random features..
Lots and lots of random features...
Madcow02
8
Years of Service
User Offline
Joined: 29th Jan 2016
Location: Under My Skin
Posted: 10th Nov 2016 07:46
I did not have made the scripts, so I don't know what I am supposed to modify
Madcow02
8
Years of Service
User Offline
Joined: 29th Jan 2016
Location: Under My Skin
Posted: 10th Nov 2016 07:46
I did not have made the scripts, so I don't know what I am supposed to modify ? :-|
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 10th Nov 2016 16:16
Mad cow. OK, I'll work on this in a few days.
Give me a little time. Still in hospital, hope to
be released tomorrow. I'll rewrite the script and test when I'm home.
My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 13th Nov 2016 18:32 Edited at: 13th Nov 2016 20:07
MadCow2
Hi, finally home from hospital yesturday. Getting around today and have a little time to sit down at
computer and check out your script problem. I think I found the problem already, doing some tests
now and will get back with you this eve.
best

Ok MadCow Tested these scripts and all works good. Just made a few changes toy our old ones.
Lucky I had all the necessary images to test already from Doomster. I made note in each script
to help setup. Two are for triggerzones, and one is to be attached to a dynamic entity "health pack"
(like the health pack in the ww2 entities) To use health hit the "G" key, it was mislabeled as the "Y" key.

Note: The "medipack_inventory script, it's setup to only add 15 health points to player when
players health is ONLY below 120 points. You'll have to adjust to meet your needs.

ALSO: your problem with player getting 9999 health is a little feature in "Test" mode only
when you hit the "i" key (gives player 9999 health) It is only active in test mode. Did you
hit the "i" key or do you have a script running that uses the "i" key? If so try not to use it.
Do a test run and don't hit the "i" key and all works well
If you have any problems, let me know.
best
My games never have bugs. They just develop random features..
Lots and lots of random features...

Attachments

Login to view attachments
Madcow02
8
Years of Service
User Offline
Joined: 29th Jan 2016
Location: Under My Skin
Posted: 14th Nov 2016 00:11
Thank you, I will test that ASAP
Madcow02
8
Years of Service
User Offline
Joined: 29th Jan 2016
Location: Under My Skin
Posted: 15th Nov 2016 15:23
It works, thank you very much !

Login to post a reply

Server time is: 2024-11-21 13:16:04
Your offset time is: 2024-11-21 13:16:04