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 / 4 Simple Scripts Using Variables

Author
Message
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 29th Jul 2008 23:24
It's been awhile since I've posted any new scripts, so I figured I'd post my latest four that were developed mainly as experiments with the new variable system.

automed.fpi - An auto-med script that slowly heals you up to a certain amount (Default: 50). Loops sound $0 as you are healing (try using "audiobank\atmos\teleporthum.wav") and plays sound $1 if it is empty (try using "audiobank\scifi\scenery\doors\lock.wav").


plrhurtinzoneslow.fpi - Slowly damages the player in the zone, rather than every loop. Easily modifiable, good for radiation or something when you don't want it constantly hurting. You could even loop a sound like a geiger counter.


medichealvar.fpi - A medic script for model pack 4's medic. You could easily add it to any other character and remove the hud if you don't have MP4. Gives you full health up to two times, then shakes his head when he has no more medkits.


medichealvar2.fpi - Same as above, but he'll start following you once you get close enough.


Well there you are. 4 simple scripts demonstrating the use of variables (mainly to time things ). I'll start messing with global variables next. I want to do something like RTCW where you can collect treasure and find secrets, and then it will tell you how many you got at the end of the level.

Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 29th Jul 2008 23:58
Could I add these to the guide Airslide?

Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 30th Jul 2008 01:03
They look nice, good contribution.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th Jul 2008 02:01
Hey, Airslide, good scripts you have there, but...... I already made a tutorial a long time ago that did the "automed" without the use of variables... and it did exactly what yours does.


Here it is:



Don't remember if it was exactly like that in the tutorial, because I probably altered it a bit afterwards, but yeah.... it does everything yours does, but with less code and no variables. Simply change the "100" in the last line to whatever amount of health you want the automed to give.

If you want to use a "Press ENTER To Use" HUD, you can... just make sure that the HUD you're wanting is loaded up in another script and this one will have access to it.


Not trying to start something here or anything, just letting you know.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 30th Jul 2008 02:22
Drat! Plystire, you have once again foiled my plans for world domination!

How does it get to state 100 though? I could understand if you had incstate in the first line, but I don't see it

The only thing yours doesn't do (or doesn't look like it should ) is slowly heal the player. It will still heal it once per loop - so 30 health a second. Mine will only be 6 health a second because it is purposely slowed down.

While yours is probably faster due to less code, variables probably don't affect it much - they are there on all entities, whether they are in use or not.

Anyways, throw in the code I have to slow down the healing and they're pretty much the same. Have a penguin

Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 30th Jul 2008 02:46
I have also made a script for Plys script challenges, check that out.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th Jul 2008 07:35
Yup, performance won't be very noticable at this level, Airslide. I was just stating that it had been done without the use of variables.

With a little extra thought, you can work around the use of variables in most cases.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 31st Jul 2008 00:26
There are dozens of ways to do things in .fpi scripting. Both ways ahve their pros and cons.

Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 2nd Aug 2008 17:30
Quote: "With a little extra thought, you can work around the use of variables in most cases."


That's what we always had to do before. The variables do open up a lot of opportunities that either required lots of extra code or were difficult to impossible to work around - say something like money. Though the in-ability to tie a variable to a hud is killing most of my ideas (Treasure and Secret count, kill count, etc)

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 2nd Aug 2008 23:56
I believe Conjured Entertainment had made a pack of scripts to deal with that.

Speaking of him..... where is he?


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 3rd Aug 2008 00:04
Doesn't that require like a million checks to determine which hud to draw? That'd drive me nuts - I like clean solutions....so why am I using FPSC?

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 3rd Aug 2008 00:05
Beats me.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 3rd Aug 2008 01:37
The easy to use UI?

Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 3rd Aug 2008 04:32
Hey, if you don't like it, then don't use it.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 4th Aug 2008 07:52
People use a lot of things that they don't like for various reasons. They range anywhere from a cellphone to being in a country.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 4th Aug 2008 22:34
Still, FPSC has some advantages.

Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 6th Aug 2008 20:10
Quote: "They range anywhere from a cellphone to being in a country."


Those examples fit me perfectly

Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 6th Aug 2008 22:13
So FPSC fits you perfectly?

Roger Wilco
19
Years of Service
User Offline
Joined: 6th Jul 2005
Location: In the Shadow of Chernobyl
Posted: 7th Aug 2008 02:52
I found a nice loop of a geiger counter on the net, tripled the amount of clicks, and put a sound-loop in the hurt zone and adjusted the values and stuff some. Worked awesomely, thanks for the scripts.

Check out the Gunn3r Games web-site and its growing community, and expand the joy of indie development!
http://www.gunn3rgames.net/
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 7th Aug 2008 03:32
You mean like the geiger counter in Half Life 2? That would be a usefull script, you should post it.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 7th Aug 2008 06:15
If you do it right you can have a geiger counter speed up the closer you get to the source of radiation.

All you would need is a sound of a single geiger "click"

Example:





The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Roger Wilco
19
Years of Service
User Offline
Joined: 6th Jul 2005
Location: In the Shadow of Chernobyl
Posted: 7th Aug 2008 12:56
Yeah, that would be a more space-saving way to do it, instead of having a loop of geiger clicks.

@Hybrid: It was just a small edit of Airslides slow hurt zone script, but I'll post it as soon as I get home. I might also include both versions of the geiger clicking loop, if I'm permitted to.

Check out the Gunn3r Games web-site and its growing community, and expand the joy of indie development!
http://www.gunn3rgames.net/
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 7th Aug 2008 23:51
I know, buy Plystire's method would be very useful, you caneven subtract health as you get closer.

Login to post a reply

Server time is: 2024-11-24 12:15:07
Your offset time is: 2024-11-24 12:15:07