Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: T-Man on November 14, 2010, 05:13:57 pm
-
Just me with another wacky concept to put to the coders.
Have noticed that FRED to my knowledge has no way to record if a ship is in an area of space (it can do distance to an object, but not just empty space). I then remembered that you can teleport players, meaning SEXP can understand XYZ positions, and that got me thinking; could you do a SEXP that records if an object's position and trips when they equal a value? Obviously one that uses exact numbers would be almost useless due to scale but if you used "higher than" or "lower than" values you could mark out an area of space that will trigger a SEXP if the player enters it. Also if i'm right by using a series of these with 'and' statements, you could chissel out practically any shape of area you wanted (so using a series of six would create a cube shaped zone, for example).
As an example of use, i had a mission idea where an asteroid has a secret base built into it, but the base is hidden from view when the player first arrives (the asteroid is untargetable), but is revealed if the player faces the asteroid from a direction where he can see the structures jutting out the rock. With the above SEXPs, you could mark out the area where the player would be able to see the base, and then combine that with a is-facing SEXP.
But yeah, just an idea. Maybe a little fiddly, and having 6+ "has player crossed this?" lines stretching into infinity might murder the CPU, but it might be dooable and those who like advanced missions might find it useful.
-
You already have get-object-x, get-object-y, and get-object-z. Shouldn't be any problem using those, should there?
-
Yeah, using those sexps, and a bit of thought, will let you do exactly what you want.
-
There is? In that case i apologise. I did try to check on FRED_Open but i couldn't get into the distance and coordinates area at any point (it was greyed out all the time). Didn't find it on the Wiki either so i assumed there wasn't one. I'm guessing that one can do greater and less than values then?
Mods are welcome to delete this topic if they want; its no longer needed. Sorry for the n00bness. :o
-
We don't delete topics. And yes, those sexps return numeric values like you would expect. As a result, you can only use them in contexts where numbers can be used.
-
Also, I remember that I've once seen a SEXP which allowed you to check if N objects are inside a cube of X Y Z dimensions.
I don't remember how it was called though.
-
Also, I remember that I've once seen a SEXP which allowed you to check if N objects are inside a cube of X Y Z dimensions.
I don't remember how it was called though.
num in a box?
-
num-ships-in-box IIRC.
-
A pretty easy hack if you want a spherical area is to place a nav point in the center and then do a < distance SEXP to find if something is within that sphere.
You could practically do planes (geometric planes) with a point placed so far away from the battle that the border of the sphere is nearly flat.