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 the "raycast" command

Author
Message
Gamer X
16
Years of Service
User Offline
Joined: 1st Feb 2008
Location: Planet X
Posted: 3rd Mar 2009 21:46
I need to know if I am using raycast and raycastback commands correctly.

Here is an example that I have been using:



Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 3rd Mar 2009 23:32
Your raycasts are using a range of 1 to 25... that's a very close distance. I would suggest something more like 20 to 55.

Other than that, it appears that you are using them correctly.


The one and only,


Gamer X
16
Years of Service
User Offline
Joined: 1st Feb 2008
Location: Planet X
Posted: 4th Mar 2009 00:36
I made the changes, but I got the same results.

on a similar note: What exactly is raycast used for?


Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 4th Mar 2009 01:08
To check if there is an object in the way. (i believe)


X10 User
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location:
Posted: 5th Mar 2009 00:42 Edited at: 5th Mar 2009 01:09
im having trouble with the raycast command, i too am under the impression its for detecting objects in the entities path and this is essential to my squad command script, could someone who perhaps knows how to use the raycast command post a snippet showing the correct syntax?

EDIT:http://www.rockstevens.com/fpiref/RAYCASTBACK.htm is what i found when i googled the subject which just confuses me

- Why is everyone on here so rude? -
Brian In Korea
15
Years of Service
User Offline
Joined: 1st Mar 2009
Location:
Posted: 5th Mar 2009 04:50
Why do you switch to raycastback? Don't you want to continue checking for objects in front of the character?
Gamer X
16
Years of Service
User Offline
Joined: 1st Feb 2008
Location: Planet X
Posted: 5th Mar 2009 20:06
Quote: "Why do you switch to raycastback?"

I use the raycastback command to check and make sure that before the entity takes off that the object is behind him and not in front of him.

Quote: "Don't you want to continue checking for objects in front of the character?"

I edited the command in the script I am using so that it is always checking for objects in its way.

Quote: "could someone who perhaps knows how to use the raycast command post a snippet showing the correct syntax?"


The closest example I have seen is the lift script, but it shows the raycastup command being used instead.


Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 5th Mar 2009 20:44
@GamerX:

Be careful with how you code this.. Remember that if he hits a corner, he won't necessarily have the initial wall at his back.


@X10 User:

The raycast seems to originate from the center of the entity... and this is a true mathematical "line", so it has no thickness to it whatsoever. So, if the entity is tall, it won't be able to detect objects that don't come up more than halfway on it.


The one and only,


Gamer X
16
Years of Service
User Offline
Joined: 1st Feb 2008
Location: Planet X
Posted: 5th Mar 2009 21:35
Well thanks Ply.
I will continue to work with it until I get mad at it and decide to remove it from the script that I am working on.


X10 User
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location:
Posted: 6th Mar 2009 17:15
Yeah ply i read the definition and took that to be what it meant myself hence using the stock locker from ww2 media as its virtually ceiling height and at least as wide as a character, i tried both dynamic and static with the same result the character ignored them, their pace slowed but that was the only discernible difference, i tried walls, crates, stock media and custom content, i even created a piece exactly one tile wide and ceiling height in milkshape and brought that it but zero result, possibly something that got mussed up in the v115 beta perhaps? as i tend to grab every beta going, what version are you using Gamer xz?

- Why is everyone on here so rude? -
Gamer X
16
Years of Service
User Offline
Joined: 1st Feb 2008
Location: Planet X
Posted: 6th Mar 2009 23:48
I am using V 15 beta 2.


Login to post a reply

Server time is: 2024-11-24 20:27:59
Your offset time is: 2024-11-24 20:27:59