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 / Need help with raycasting

Author
Message
Stalker93
16
Years of Service
User Offline
Joined: 1st Sep 2008
Location: Italy
Posted: 26th Apr 2011 21:52
Hi guys!
I need help with this idea: how can I print to the screen the distance of an object away from the player (in units, or whatever else) when it's aimed with the crosshair? Something like the distance counter in S.T.A.L.K.E.R. ...Can I achieve this by using raycasting, then grab the raycast value and print it to screen?
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 27th Apr 2011 07:40
I don't believe this is possible without modifying the source code.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
Stalker93
16
Years of Service
User Offline
Joined: 1st Sep 2008
Location: Italy
Posted: 27th Apr 2011 09:33 Edited at: 27th Apr 2011 09:39
Neither with Project Blue (I'm using PB 1.8C Beta 2)? I thought it could be possible through variables and the "printval=X" command..
Thx anyway!
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 27th Apr 2011 10:58
Ah, what you are asking maybe possible with a mod - my comment was just to point out that it is not possible using stock FPSC. I'm not totally sure of the PB commands, but maybe someone else can clarify the situation for you?

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
bobochobo
16
Years of Service
User Offline
Joined: 9th Jul 2008
Location: My house, in the middle of my street
Posted: 27th Apr 2011 18:55 Edited at: 27th Apr 2011 20:35
Why wouldn't it be possible? Try stuff like this

plrdistfurther=100,plrdistwithin=200,plrnotfacing=0:printval=1
plrdistfurther=200,plrdistwithin=300,plrnotfacing=0:printval=2

etc...
Not tested but it might be workable.

EDIT: Just made and tested the following, it works, apart from the occasional bug.

Quote: ":always,plrdistfurther=100,plrdistwithin=200,plrnotfacing=0:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=90,fpgcrawtexty=85,fpgcrawtext=1m
:always,plrdistfurther=200,plrdistwithin=300,plrnotfacing=0:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=90,fpgcrawtexty=85,fpgcrawtext=2m
:always,plrdistfurther=300,plrdistwithin=400,plrnotfacing=0:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=90,fpgcrawtexty=85,fpgcrawtext=3m"


Stalker93
16
Years of Service
User Offline
Joined: 1st Sep 2008
Location: Italy
Posted: 28th Apr 2011 20:28
Thx bobochobo!!!!!

Login to post a reply

Server time is: 2025-06-07 16:53:58
Your offset time is: 2025-06-07 16:53:58