Data Realms Fan Forums http://45.55.195.193/ |
|
Need some guidance on a common bit of syntax http://45.55.195.193/viewtopic.php?f=73&t=18847 |
Page 1 of 1 |
Author: | Joe [ Fri May 28, 2010 1:36 am ] |
Post subject: | Need some guidance on a common bit of syntax |
Hello to all. I need to know why there are numbers required in the parentheses of statements such as -self:GetAltitude(x,y) -SceneMan:FindAltitude(x,y,z) -and other things like this. Could some kind soul tell me what these numbers are/do/represent? Thank you. |
Author: | CaveCricket48 [ Fri May 28, 2010 1:49 am ] |
Post subject: | Re: Need some guidance on a common bit of syntax |
Those "statements" there are functions. Functions do stuff. But they need information on how to do it. Those numbers are the information. Check the wiki for what each number is defining. |
Author: | Joe [ Fri May 28, 2010 2:17 am ] |
Post subject: | Re: Need some guidance on a common bit of syntax |
I checked the wiki, but everything except things pertaining to the vector() statements seemed very ambiguous. I also noticed there are no articles regarding the SceneMan. If I could have specific answers as to what the numbers in the parentheses of the statements above do, I would be very much obliged. |
Author: | CaveCricket48 [ Fri May 28, 2010 8:40 pm ] |
Post subject: | Re: Need some guidance on a common bit of syntax |
Tip: "SceneMan" is the shortened name of "SceneManager". Also, I'm not completely sure how to use the FindAltitude function. You're better off casting a StrengthRay downwards. wiki wrote: CastStrengthRay Traces along a vector and shows where along that ray there is an encounter with a pixel of a material with strength more than or equal to a specific value. Arguments: -The starting position. -The vector to trace along. -The strength value of screen any found to be equal or more than will terminate the ray. -A reference to the vector screen will be filled out with the absolute location of the found terrain pixel of less than or equal to above strength. -For every pixel checked along the line, how many to skip between them for optimization reasons. 0 = every pixel is checked. -A material ID to ignore, IN ADDITION to Air. -Whetehr the ray should wrap around the scene if it crosses a seam. Return value: Whether a material of equal or more strength was found along the ray. If not, the fourth parameter have been set to last position of the ray. How to read the wiki: Name of function What this function does Arguments - the things that go into the parantheses Return Value - What the function spits back out at you. If you set a variable equal to a function, the variable will equal whatever the function spat out. Specific break-down of CastStrengthRay arguments (ini modding knowledge required) -Where this "ray" starts (Vector) -What direction to draw the line and how long to draw it (Vector) -The material with this strength value will stop this ray (number) -How many pixels to skip scanning. If this is set to five, only the sixth pixel after will be checked (number) -What material the ray should ignore. Materials are identified by their ID index number (number) -If the map wraps, should the ray wrap across the map too? (boolean) |
Author: | Joe [ Fri May 28, 2010 9:16 pm ] |
Post subject: | Re: Need some guidance on a common bit of syntax |
Alright. Thank you, but I'm afraid I'm still clueless. Could you write a statement for a CastObstacleRay that starts at an actor and then points straight down at the ground (stopping at the terrain) and returns a value of how long the ray is? |
Author: | CaveCricket48 [ Fri May 28, 2010 11:19 pm ] |
Post subject: | Re: Need some guidance on a common bit of syntax |
The way CastStrengthRay works is that you set the ray length, and the return value is if the ray hit terrain. The position of the detected terrain pixel is dumped in a variable as a vector (woops forgot to describe this, but I just did). You're trying to figure out the altitude of the actor, right? You could do a distance check with the position of the detected pixel and the actor to get the altitude. |
Author: | Joe [ Fri May 28, 2010 11:20 pm ] |
Post subject: | Re: Need some guidance on a common bit of syntax |
Sorry, could I have that in code please? |
Author: | Joe [ Fri May 28, 2010 11:42 pm ] |
Post subject: | Re: Need some guidance on a common bit of syntax |
YYYYEEEEEEEEEEEEHHHHHHHAAAAAWWWWWW!!!!!!!!!!! I got SceneMan:FindAltitude() to work!!! Aparently, you say SceneMan:FindAltitude(self.Pos <to give it your current position>, <the max length of the ray>, <how many pixels the check skips (like you said, for optimization)>) I stared at Abdul's SAM Drop Crate code for about half an hour, and using what you said, it all suddenly clicked! Thank you very much Cricket, many mods shall benefit from your advice (or code ) |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |