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 / Script help: Player Crouching HUD Image.

Author
Message
Lewis
VBOTB Developer '10
19
Years of Service
User Offline
Joined: 16th Mar 2005
Location: Queensland, Australia
Posted: 13th Jul 2009 13:15
Hey guys.

I need some help with a script im doing. What it does is have an image of a person crouching and an image of a person standing. If the player is holding down the crouch button, it will show the player crouching image, and if not, it will show the player standing image. Heres what I go so far:



Where am I going wrong?
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 13th Jul 2009 15:18 Edited at: 13th Jul 2009 15:18
you can only do this if using ply's mod. If you are using ply's mod then use this.



Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 13th Jul 2009 17:21
hockeykid, I know you're a god at scripting, but I think you can pull this off without having ply's mod. Try using this:


Notice that in the original script, he had:


...which meant that he was always CHECKING to see if one hud was showing and the other wasn't. By changing this line to be:


...you can always be checking to see if nothing is being pressed (or, well, that codekey 46 isn't being pressed).

Unless I'm missing the point on this?

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 15th Jul 2009 17:52
He might be able to but i doubt it since scancodekeypressed detects the last key pressed, not weather or not its being held. So say the player started to walk (Pressing "W") while crouching then came out of crouch but did not take his finger off of the "W" key then it would still show the crouched hud,since the last button pressed was and still is "W" but when he stops and doesn't press anything it will work.

So basically yes it will work but it wouldn't really look good.

Lewis
VBOTB Developer '10
19
Years of Service
User Offline
Joined: 16th Mar 2005
Location: Queensland, Australia
Posted: 15th Jul 2009 18:22
I tried it with leon's method and it is working. The only thing is that if you hold down another key and let go of the crouching key, then the image is still crouched until you let go. Any way to solve this?
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 15th Jul 2009 18:48
Quote: "the image is still crouched until you let go. Any way to solve this?"


No, this is the problem stated above.

Lewis
VBOTB Developer '10
19
Years of Service
User Offline
Joined: 16th Mar 2005
Location: Queensland, Australia
Posted: 15th Jul 2009 19:02
Woops, didnt see that.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 15th Jul 2009 22:13
I'm wondering something....

Would it work properly if you implemented something similar to the Mission Objectives script by xplosys? Check the following thread and see if that would work. It's the same principle, right?

http://forum.thegamecreators.com/?m=forum_view&t=139591&b=23

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 16th Jul 2009 03:04 Edited at: 16th Jul 2009 03:06
No because you would need to put scancodekeypressed=0 so it doesn't go through it with out it being pressed (problem you were having leon that i helped you fix) but putting 0 would bring use right back to where we are now.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 16th Jul 2009 08:05
?




Problem solved, maybe?


The one and only,


Lewis
VBOTB Developer '10
19
Years of Service
User Offline
Joined: 16th Mar 2005
Location: Queensland, Australia
Posted: 16th Jul 2009 09:02
Good attempt ply, but when the player walks forward while crouching, it changes to the standing hud again.

Could really do with a ifcrouched=1 command ply.. wink wink
meteorite
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: The Capital Wasteland
Posted: 19th Jul 2009 23:53
Somehow I doubt it

Login to post a reply

Server time is: 2024-11-25 03:42:44
Your offset time is: 2024-11-25 03:42:44