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 / F to pick up script HELP

Author
Message
General Jackson
User Banned
Posted: 9th Feb 2009 23:38
Hi, i'm modifying a script so that you can hit f to pick up a weapon. I need help cause it doesnt work. What am i doing wrong?



It is well that war is so terrible or we should grow too fond of it- Robert E Lee
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 10th Feb 2009 00:52 Edited at: 10th Feb 2009 00:55
Quote: "I need help cause it doesnt work."


Okay, that's a really frustrating thing to read when someone's asking for help.

You need to tell us what it's supposed to be doing.
Then you need to tell us what it IS doing.
Then you need to tell us what it SHOULD BE doing, but isn't.

Looking at your code, it looks like there won't be a HUD popping up until after you pick up the weapon, but I have no clue if you intended it to be that way or not.

Also, I don't think "hudfadeout" will work with Text HUDs.


The one and only,


General Jackson
User Banned
Posted: 10th Feb 2009 02:40
sorry. ok, i want the player to walk up. text appears that says 'f to pick up weapon'. then when player hits f, they pick up the weapon.
what it is doing is this. i walk up to the gun and no text appears and the gun wont pick up.thx

It is well that war is so terrible or we should grow too fond of it- Robert E Lee
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 10th Feb 2009 03:48 Edited at: 10th Feb 2009 03:57
This works, I tested it.



Instead of using hudfadeout use hudunshow.
If player gets within the distance then show the hud and goto a new state. In the new state if the player presses the "F" key then hide the hud and take the weapon or any other entity. Then go from there to whatever you need to have done. e.g. having the player drop the weapon.

Hope this gets you started. Using FPI EditPad will help you have the correct syntax and the commands/definitions are included. Also, read the stickies regarding how to do scripting. Plystire has a couple of good threads of how-tos. The thing to remember is to write out your logic in plain english or whatever language you use in an if/then statement as I had done above. You construct your script lines according to those statements. What comes after the if are the conditions and what comes after the then are the actions to the script. I like to do a top/down format as much as I can. It makes it easier to follow.


__________________________________________________________
Make life a little easier and use FPI Editpad for your sctripting needs. And it's free!
Now with Line Numbers. V3.3.8 is now available.

The past has a lot of memories to hold onto; but, today is chock full of new adventures, and, the future shouts out, "The best is yet to come!" -- TerryC
General Jackson
User Banned
Posted: 10th Feb 2009 04:23 Edited at: 10th Feb 2009 04:31
Thanks so much flatlander. i've been trying to learn to script and i have fpi editpad and its way awesomer than notepad. thx!
edit:er, thers a problem. when you move back from the gun it still shows the 'Hit f to pick up' no matter where you go.

It is well that war is so terrible or we should grow too fond of it- Robert E Lee
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 10th Feb 2009 04:33 Edited at: 10th Feb 2009 04:33
Thanks Shooter.

One more thing for anybody else who might read this. The first colon (if) of a script line indicates that the condition of the script follows. The second colon (then) indicates that the actions of the script follows. There can be more than one condition and they are separated by a comma. If there is more than one condition then ALL of them must be true before the action is done. There can be more than one action also separated by commas. ALL of the actions indicated WILL be performed.

The past has a lot of memories to hold onto; but, today is chock full of new adventures, and, the future shouts out, "The best is yet to come!" -- TerryC
General Jackson
User Banned
Posted: 10th Feb 2009 22:49
I fixed it where when you walk away from it the text will dissapear
here it is. thx flatlander for the help.


It is well that war is so terrible or we should grow too fond of it- Robert E Lee

Login to post a reply

Server time is: 2024-11-24 19:28:43
Your offset time is: 2024-11-24 19:28:43