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 / New to FPI scripting

Author
Message
N4warhead
13
Years of Service
User Offline
Joined: 23rd Oct 2011
Location:
Posted: 24th Oct 2011 07:37 Edited at: 2nd Nov 2011 00:21
Hey all, I'm N4warhead new to this site and to FPI scripting, one of my friends came to me asking if i could learn it and make scripts for him. (Sense I'm known for my scripting skills with other programs) I think i have the basics handled but had a problem with one of my scripts and was thinking someone here could help me out.

I tried to make a health pack that gives you 250 health (no matter what your health is at that time) then decreases what it gave you by 1. (sorta like a temporary powerup) Here is what i have, don't laugh because this is relatively still new to me.



Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
N4warhead
13
Years of Service
User Offline
Joined: 23rd Oct 2011
Location:
Posted: 26th Oct 2011 00:54 Edited at: 2nd Nov 2011 00:21
I know trying to make a loop wont work but wanted to give it a try, any help?

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Dark Frager
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: The Void.
Posted: 26th Oct 2011 12:39 Edited at: 26th Oct 2011 12:53
Hi N4Warhead

I'm also new to scripting myself, and I'm looking for ways to practice so I might be able to help you.

Here it is: Didn't have time to test it though.



Remember to remove the [] and enter your own value if needed.

Also, I think your signature may be too big but Im not sure.

"I guarantee you'll miss me, 'cause you changed the way you kissed me." www.youtube.com/TheDarkFrager
Spare 2 seconds of your life and subscribe to me please.
N4warhead
13
Years of Service
User Offline
Joined: 23rd Oct 2011
Location:
Posted: 27th Oct 2011 16:32 Edited at: 2nd Nov 2011 00:21
Thanks for the help, i was about to give up on this forum. It seems it still doesn't work for some reason. It gives you 250 health but it doesn't decrease in value and my signature is 500x241. I really appreciate your help.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Dark Frager
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: The Void.
Posted: 27th Oct 2011 18:29


Here, try that.

"I guarantee you'll miss me, 'cause you changed the way you kissed me." www.youtube.com/TheDarkFrager
Spare 2 seconds of your life and subscribe to me please.
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 27th Oct 2011 21:18
I'd do something like this(a slight modification of Dark Frager's). Note that etimergreater=100 means that true is returned after 100 milliseconds,and therefore 1hp deducted.
Then a simple check is made if the player's health is above or equal to the normal,so it can go to that same sequence of deduction again. The trick is to loop it from state 1 to state 3 and back to state 1 , so the timer is reset every 100 milliseconds. The whole script is basically a loop within itself,due to its constant execution.



Quote: "
;Artificial Intelligence Script

;Header

desc = Get 250 health and decrease by one until desired value

;Triggers

:state=0,cantake,plrdistwithin=80:playertake,plraddhealth=250,plrsound=audiobank\items\healthup.wav,state=1
:state=1:etimerstart,state=2
:state=2,etimergreater=100:plraddhealth=-1,state=3
:state=3,plrhealthgreater=100:state=1

;End of Script
"


Samotnijat vylk nasred gorata.
-3D,2D Artist,Animator,Web developer and Programmer.
angusm3
15
Years of Service
User Offline
Joined: 6th Mar 2009
Location: Right behind you...
Posted: 2nd Nov 2011 01:35
I made a script that assumes you start with 300 health and has a call of duty thing going on, you could probably pick that apart to get what you want

I appear to have burst into flames...

Login to post a reply

Server time is: 2024-11-24 04:31:58
Your offset time is: 2024-11-24 04:31:58