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 / ocfpsguide - script help.

Author
Message
Panther1965
15
Years of Service
User Offline
Joined: 10th Nov 2009
Location:
Posted: 26th Nov 2009 00:00
Hello everyone.
I am trying to use a script from the guide. Page 243. Display a HUD while holding an object.

Original Code


However the hud displays as soon as you approach the object.
I understand how the code is doing this, but what I want to know is if there is a condition test to show that the player is holding the object.I cannot find one in the manual or FPIEditpad.

I'm sure I could get the script working if there is a way to determine if the player is holding the object.
Also I don't want the player to take the object, Just pick it up or put it down.

Any help or ideas greatly appreciated.


Thank you in advance

Panther1965
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 26th Nov 2009 01:18
I could not get the script to work either. I am wondering if a similar idea to your script you did on moving a crate on/off a pedastal would do the trick.

Cheers

Mike
Panther1965
15
Years of Service
User Offline
Joined: 10th Nov 2009
Location:
Posted: 26th Nov 2009 01:59
@ BlackFox

I will play around with that idea.
It may be a while as I have to go out now.
As soon as I get back, I will start playing around with it.

Thank you

Panther1965
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 26th Nov 2009 03:03
No problem. I saw that script and had tried to get it to work in my wife's game for her, where the player picks up a map and the hud shows the map. However, it would not show the hud at all. I've tried with just the default FPSC and with Project Blue mod, but to no avail.

If you manage to get it working, let me know. I'd be interested in implementing this idea into her game. For now, I made it so you press a key to view the map.

Cheers

Mike
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 26th Nov 2009 04:49


Here you go Black Fox (not sure if this is what you wanted) replace the hud path with the map hud and apply this to the main of the map item (make the map item always) and when you press enter it will toggle the map (once you pick it up of course)

Panther1965
15
Years of Service
User Offline
Joined: 10th Nov 2009
Location:
Posted: 26th Nov 2009 06:35
@ hockeykid,
I'm fairly new to scripting. I looked in the manual but cannot figure it out. could you please explain what the following line does, or any help on the rundecal would be appreciated.



Thank you in advance

Panther1965
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 26th Nov 2009 06:38 Edited at: 26th Nov 2009 06:43
Thanks hockeykid. I set mine up where I first pick up the map. Then I have a trigger right over the map entity and the trigger uses this script to display a map hud anytime I press the M key:



I will play with the script you submitted to see if I can just pick up the map with the right mouse button to carry and have the hud displayed.

Appreciate you getting me in the right direction.

Cheers

Mike
Panther1965
15
Years of Service
User Offline
Joined: 10th Nov 2009
Location:
Posted: 26th Nov 2009 09:05 Edited at: 26th Nov 2009 13:03
Have been playing around, so far the following script will show the HUD when I press the T key. However it won't hide the HUD when I drop the item ( Press T again )
I will still mess around with it, but maybe one of you guys can have a look and see what you can come up with.



Regards

Panther65



The following script will display the hud then make it disappear when I hit the T key to pick the item up.
It then shows the hud and makes it disappear when I hit the T key again to drop the item.
I feel that I am getting closer.



Regards

Panther1965
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 28th Nov 2009 01:53
Going back tot he original question... how to show a HUD only while holding an object.... I'm gonna take this as LITERALLY holding it and not just "acquiring it" into your invisible inventory.


PBUM has a command (currently untest for as long as I can remember) called "settargetheld" which sets an entity's target to the entity that the player is holding (picked up via right-mouse click)

Witht hat in mind, make a script that uses "settargetheld" and then activates that entity with "activatetarget". Then all you need to do is give the entity a script that displays a HUD when activated, and hides it after a certain amount of time.


That's the theory anyway.


The one and only,


BlueFox
15
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 28th Nov 2009 03:11
Plystire,

Thank you for that information. I was asking Mike if it was possible to have a hud come up while using the right mouse button to hold an object. He does it differently by allowing the player to press T to take (or pickup) the entity, then the player can press a key to view information on that entity (such as a map).

I can play around with the suggestion you posted to see if I can get it to work. If not, then it will have to wait until Mike returns and he can look at it.

Thank you

Cathy

Login to post a reply

Server time is: 2024-11-25 05:39:06
Your offset time is: 2024-11-25 05:39:06