Author Topic: Request: 'is-object-position'  (Read 1630 times)

0 Members and 1 Guest are viewing this topic.

Offline T-Man

  • 210
  • I came... I saw... I had a cuppa!
Request: 'is-object-position'
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.
Also goes by 'Murasaki-Tatsu' outside of Hard-Light

UEF fanboy. Rabid Imagination.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Request: 'is-object-position'
You already have get-object-x, get-object-y, and get-object-z. Shouldn't be any problem using those, should there?

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Request: 'is-object-position'
Yeah, using those sexps, and a bit of thought, will let you do exactly what you want.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline T-Man

  • 210
  • I came... I saw... I had a cuppa!
Re: Request: 'is-object-position'
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
Also goes by 'Murasaki-Tatsu' outside of Hard-Light

UEF fanboy. Rabid Imagination.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Request: 'is-object-position'
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.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: Request: 'is-object-position'
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.

 

Offline Angelus

  • 210
  • The Angriest Angel
Re: Request: 'is-object-position'
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?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Request: 'is-object-position'
num-ships-in-box IIRC.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

  
Re: Request: 'is-object-position'
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.