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 / Hud display question

Author
Message
riccetts
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 9th Jun 2013 22:39
I got the "creating a hud to display when play approaches an entity." pdf. My question is how can I get the hud to show only over the entity? When the player turns the hud is always in view.
Can anybody help?
The Master D
15
Years of Service
User Offline
Joined: 20th Feb 2009
Location:
Posted: 9th Jun 2013 22:44
You can use the "plrfacing" condition where you specify what angle the player's view has to be within relative to the entity for the condition to be TRUE.

AMD FX-6300 Vishera 3.5GHz, Radeon HD 7850 2GB, 8 GB RAM, Win 7 Pro 64 Bit
riccetts
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 9th Jun 2013 23:08
The Master D,

I'm not sure I understand. Plrfacing=? Players view is what I don't understand. How do I find the players view?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 10th Jun 2013 04:03
riccetts
Quote: "How do I find the players view?"

I think I know what your getting at. You're assuming it's added to the players view somehow. No, the "plrfacing=x" is added to the entities main script. As in "plrfacing=45" means the player is within 45 deg. of "looking straight at" the entity. It's a condition, so when the players view is within 45 deg. it becomes "TRUE" and your hud should show.

Also note: most of the scripts I've seen include "plrdistwithin" along with "plrfacing".
riccetts
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 10th Jun 2013 05:00
ncmako,
I actually placed that in the terminal script right after plrdistwithin and set it at 1 and it did nothing. It is in the main script of the entity. It just follows me in circles.
Burger
12
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: New Zealand
Posted: 10th Jun 2013 08:25
Quote: "plrdistwithin and set it at 1 and it did nothing"


the distance used is 100 'units' = 1 segment. So therefore 1 is too small for the engine to measure (I think the engine has issues at ranges under 30-20, but I cannot confirm this). So you would want something like - plrdistwithin=60. This is a reasonably close distance, but the fine tweaking of the value is totally up to you of course.

An alternative to 'plrfacing=x' is 'pickobject=1 (or 0). The definition of pickobject, as copied from the script syntax list is:

3.10.1.2 PICKOBJECT=X
Description: Is true if the entity is dead-centre screen and X is 1 or the entity is
not dead-centre screen and X is 0.
Range: X = 0 – True if the entity is not in the centre of view.
X = 1 – True if the entity is in the centre of view.
Example: :pickobject=1:playertake
3.10.2ACTIONS

So perhaps a script like:

:state=1,plrdistwithin=60,pickobject=1:blah blah

Or that's how I'd do it.

On a side note check out the complete script syntax list in your fpscreator/docs folder. This is very helpful for scripting.

Burger,

- An Instinctive Fear IndieDB page, download demo today!
riccetts
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 10th Jun 2013 22:57
Burger
Nope pickobject didn't work the hud just stays in view when I turn away from the entity.
Any other suggestions?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Jun 2013 07:18
@ riccetts
"pickobject" should work. If you don't mind, post what you have so far. I'm sure it's just an oversight in the script.
riccetts
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 11th Jun 2013 07:53
Here it is

Attachments

Login to view attachments
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 11th Jun 2013 17:10
You want to try that:


http://cornofpsc.webs.com/
I know that Corno has a lot of translations. If you find one sent me a mail
riccetts
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 11th Jun 2013 17:43
Corno_1

Thanks but it didn't work.The hud stays in view when the player turns left or right of the entity.Could it be that some of the values in the fpe file need to be changed?
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 11th Jun 2013 18:06
Quote: "The hud stays in view when the player turns left or right of the entity.Could it be that some of the values in the fpe file need to be changed? "


You don't need to ever touch the FPE unless you are tweaking the model (ie scaling it, changing texture). Your issue is script related.

If you are at the terminal when the hud comes up and turn left and right while still at the entity, the hud should remain because you are still within the distance specified in the script. That distance is related to a central point on the entity itself. If you want the hud to disappear, then you need to change the "plrdistfurther" amount to what you want.

The command "inview" may or may not be the issue. Normally myself I do not use it but set my "plrdistwithin" to a low amount so that the player is almost touching it, then set the "plrdistfurther" to a low amount. It takes some tweaking to get the values right where you want it.


There's no problem that can't be solved without applying a little scripting.
riccetts
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 11th Jun 2013 20:32
Blackfox,
I played around with plrdiswithin and plrdistfurther. I found I could only go to 29 on both. It worked. If the player looks to the right or left the hud will fade out. I would say it fades out at 45 on left and 55 on right on hudx=.
Thanks
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Jun 2013 21:00
@ riccetts
The script you posted, I noticed you have two colons in a row
Try it with one.

But Corno_1's looks like it should work? Do you run the cleaner between tests?
riccetts
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 12th Jun 2013 04:34
ncmako,
Yup that works as well.I also used the cleaner. Just for info purposes why use the cleaner? how are the bin and dbo created and why?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 12th Jun 2013 21:40
@ riccetts
Quote: "Yup that works as well"

What works as well? Getting rid of the one extra colon, or Corno_1's script?
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 12th Jun 2013 21:49
Just FYI. The cleaner only is effective if you make changes to an entity, that is if you assign a different texture or change another faction of the entity properties. The cleaner will remove the *.dbo/*.bin file(s) of the entities so when you retest, it will reconstruct them with your changes. The cleaner has no effect with scripts/scripting.


There's no problem that can't be solved without applying a little scripting.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 12th Jun 2013 22:03
Yeah BlackFox, that's what I thought. But I have a feeling he's making a lot of changes? I do have times where I make so many changes where I have to shut down fpsc and restart. Some times things go smooth, sometime not..lol fun fun fun
riccetts
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 13th Jun 2013 07:06
Experimentation is the name of the game. Besides I'm trying to learn scripting. I am hands on so I have to do it to learn it.

Login to post a reply

Server time is: 2024-11-23 14:04:16
Your offset time is: 2024-11-23 14:04:16