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 / Pickup Healthpack

Author
Message
Trope
16
Years of Service
User Offline
Joined: 9th Jan 2008
Location:
Posted: 9th Jan 2008 12:22
Hey,

is it possible to add a healthpack to the (inventory) HUD.

I meen i picked up a health pack, collect them, and i can use them when i want to.

my script works, until to the source code-> currently i have ingrampromt so when i collet the Medipack, i shoot.

Maybe someone knows a solution.

Please answer kindly, i am a beginner so i am trying everthing

Greetz

PL
Pain
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 4th Apr 2007
Location: Lake Orion, MI - USA
Posted: 9th Jan 2008 15:37
hmm... ill look into this later today.

pain

Me = noob

and i love The TGC : )
Trope
16
Years of Service
User Offline
Joined: 9th Jan 2008
Location:
Posted: 9th Jan 2008 18:30
Please be so kind, i really go crazy

greetz
Trope
16
Years of Service
User Offline
Joined: 9th Jan 2008
Location:
Posted: 9th Jan 2008 18:31
Please be so kind, i really go crazy

greetz
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 10th Jan 2008 14:01
No....sorry.

PLRTAKE only seems to add keys and weapons to an inventory which allows future usage, items like health-packs are used instantly, there is no inventory window so you can't use it later on.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 11th Jan 2008 01:12
If you were to use a mod that allowed the use of variables, then you could use one of the variables to keep track of how many healthpacks the player is holding on to, then when the player presses a certain key, you can check if that variable is greater than 0, and if so, then give the player health and take one of the health packs away.

Of course, you'd need a global variable for it to work that way.


Now that I think about it, there could be a way for this to work, in a similar fashion to how I made the "Half-Life Automed" script.

Let me just sit down and think about this for a little bit...

I'll post up what I can come up with.


The one and only,
~PlystirE~

Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 11th Jan 2008 02:11 Edited at: 11th Jan 2008 10:03
Okay, this is just a rough setup, but from what I can tell without testing it, it should work.



Put that into the MainAI of a hidden entity (Stick it someplace that the player will never see it), and make it so that it is "Always Active".

Now, for the Health Packs. Put the name of your hidden entity (the entity from above) into the Health Pack's "If Used" property. Now give it this code as it's MainAI.



I'm in kind of a rush right now so I didn't take the time to put in the HUD popups and sounds and whatnot, so maybe one of the other forum dwellers here can do that for ya.

Good Luck, and let me know how it goes!

[EDIT]

Just realised that I didn't mention that to USE the healthpack, you gotta push the "H" key.

Also, this will "rapid-fire" health packs, so someone is gonna need to put in some code that will prevent it from constantly triggering the healthpack when the user holds down the key.

Have fun!

[/EDIT]

[EDIT2]

Okay, the health pack shouldn't rapid-fire anymore. I also put in a sound when the player uses a healthpack.

Enjoy!

[/EDIT2]


The one and only,
~PlystirE~

Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!
Trope
16
Years of Service
User Offline
Joined: 9th Jan 2008
Location:
Posted: 12th Jan 2008 00:42
Oh my GOD,

Plystire, you are really great, now you got me stunning.

i will try it tomorrow, because i just came home from work, and i am tired, so i sure will let you know if its working.

Really great thanks

You are really THE ONE AND ONLY

Greetu

PL
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 12th Jan 2008 10:29
Hehe, well I'm glad to be of some help.

I look forward to seeing if it'll work for you.


The one and only,
~PlystirE~

Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!
Trope
16
Years of Service
User Offline
Joined: 9th Jan 2008
Location:
Posted: 12th Jan 2008 14:00 Edited at: 12th Jan 2008 15:21
Well i got some problems, i am testing already all variations, that i knew.

So my Problem is:
If i pick up the healthpack, it heals me, and then the hud shows me 2 times hurt and 2 times heal, and the ammo, helath,live information is gone...

i tell you later, what i made up

greetz

/EDIT

I think everthing is working well, but its just not knowing that i am pressing the h-Key, so i cant get health...

maybe you know something else, what i did wrong
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 13th Jan 2008 03:18
Hmmm, well the scancode for "H" is 35, so make sure it's checking that number in the "scancodekeypressed" condition.

If you amde changes to the script, could you post it up here so I can take a look at it?

Other than that, I'm not sure what else to look for without code in front of me.

Also, make sure you did everything I mentioned above. Like the "If Used" property of your healthpacks. If that property isn't set to the name of your hidden entity, then it won't increase the number of healthpacks that you are allowed to use, and so it may APPEAR as thought it's not checking the "H" key properly.


The one and only,
~PlystirE~

Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 13th Jan 2008 04:07
Ah, hehe... whoops!

I forgot to mention that you needed to add in the "/"s into the file paths that were in the scripts!

Well, I made a little test demo level for it and altered the scripts with what I found.

This is the closest I can get for ya and there are a few issues that I can't resolve:

This is the MainAI script for your hidden entity:


This is the MainAI script for your health packs:



you'll notice that I took out the HUD pop-up for when you pick up the health pack. There were glitches with it that caused all the Perma-Huds to fadeout and never come back! I have no clue what caused that to happen, but whatever it was, taking out the item picked up hud seems to keep it from happening.

Also, you may note that I changed the script to ONLY work if your health is less than 450 (50 less than the default max health). This was because there is no way to effectively keep the player from using a pack when they don't have any, thus causing it to give the player health (maxing out at 500) and then take 50 health away from them, bringing them down 450 if they were already OVER 450.


SO! That's the best I can do with this very limited scripting language, I hope it's enough for your purposes.

If you have any problems, let me know.


The one and only,
~PlystirE~

Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 20th Jan 2008 13:03
Has anybody tested this?

I would really like to know if anybody else found this of use, lol.


The one and only,
~PlystirE~

Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!
Trope
16
Years of Service
User Offline
Joined: 9th Jan 2008
Location:
Posted: 22nd Jan 2008 12:37
Hey, i am sorry, but i had lots of work to do.

I will try it that evening and tell you then, if its working.

A small Question...again:

Can you tell me how to minimize health? I just want 100 hp.
I dont like the 500.

Greetz

And Sorry again

Login to post a reply

Server time is: 2024-11-24 03:27:39
Your offset time is: 2024-11-24 03:27:39