TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 13 of 13

Thread: Query objects' position and location, and send on/off signal

  1. #1
    Member
    Registered: May 2017
    Location: USA

    Query objects' position and location, and send on/off signal

    Hi all,

    Is there any way to query an object's situation (3 location coordinates and 3 position coordinates), in-game? I want to send an On signal when these coordinates satisfy certain conditions. E.g., when the crate's x coordinate exceeds 100, send an On signal, that could be linked to a door, etc...

    It's the kind of thing that would take about 2 lines of code, so it feels like it should be trivial. But I know that's not always how things work with DromEd. I don't recall any fan missions [obviously] doing this, so I don't have any reference points to look at. I looked through the tnhScripts and nvscripts, and couldn't find anything that would help. But often this is because I'm not thinking creatively enough, and I just haven't found the clever implementation yet.

    I'd appreciate any hints thanks!

  2. #2
    Member
    Registered: Jan 2001
    Location: Formby, NW England
    For something as simple as x=100, try installing PublicScripts and using TrigOBBSpec (bounds trigger for a specific archetype). A more versatile option would be TrigRoomObject, but it will take more effort to set up the room types and get their positions correct.

    Another possibility is to write a squirrel script (a while ago I started a thread to hopefully make it easy for people to get started). It would get the object's position property and then access subproperties (X, Y Z, etc). The code wouldn't be very complicated but the drawback with squirrel scripts is that they're not as performance friendly as genuine .osm scripts, so it's not wise to have one running constantly.

  3. #3
    Member
    Registered: May 2017
    Location: USA
    X>100 was just a simple example---not what I actually want to implement. I don't think rooms will work, b/c [as I understand it] these ignore the orientation parameters, and would only reflect that an object was located within a particular rectangular prism. Is this correct?

    I haven't looked into squirrel all that much. I'll look through your tutorial and see if that helps, thanks!

  4. #4
    ZylonBane
    Registered: Sep 2000
    Location: ZylonBane
    Quote Originally Posted by trefoilknot View Post
    Is there any way to query an object's situation (3 location coordinates and 3 position coordinates), in-game?
    Please explain what you believe the difference is between location and position.

  5. #5
    Member
    Registered: Aug 2007
    Location: LosAngeles: Between Amusements
    (x, y, z, h, p, b) perhaps ?

  6. #6
    Member
    Registered: May 2017
    Location: USA
    Exactly. Thanks, Larry!

    As to what I "believe the difference is," I'd be glad to elucidate. "Location" and "position" can be, but are not always, synonyms. When used in conjunction, "location" typically refers to where someone or something is, while "position" typically refers to "a particular way in which someone or something is placed or arranged."

    In that sense, my usage is fairly common parlance. E.g. "The guard was located in the hallway, positioned with his back against the northern wall." Sorry if my word choice confused you! (Seems that happens to you a lot, ZB...) Perhaps you'd prefer the term "orientation?"
    Last edited by trefoilknot; 12th Jun 2018 at 22:51.

  7. #7
    ZylonBane
    Registered: Sep 2000
    Location: ZylonBane
    Ah, so you knew the correct term in this context was rotation or orientation, but instead you used the wrong, ambiguous term just to be difficult.

    Well there goes my interest in helping. Good luck!

  8. #8
    Member
    Registered: May 2017
    Location: USA
    Oh, what a loss!! And you were so obvious in your sincere desire to be helpful, at be start! How I wish I could unwind my offensively loose wording... Now the TTLG community will never know what a helpful post from ZB looks like! This was our one shot to find out, and I blew it! Sorry y'all!

  9. #9
    Member
    Registered: Oct 2004
    Location: Ireland/Poland
    Losing ZB's helpful comments on this forum is a tragedy on its own, but I have to admit, that the term 'position' was actually used in a confusing manner. The whole 3D animation and game industry uses position as a synonym of location or translation. "Particular way of arranging things" is referred to as rotation or orientation and is expressed in angle units, as opposed to distance units.
    Having said that, my mind was able to guess what you meant and I believe your intentions were genuine, therefore you won't lose me!

  10. #10
    Member
    Registered: May 2017
    Location: USA
    Thanks, PinkDot. I agree that "orientation" could have been the better term. "Position" was the word that occurred to me, as I was writing the post, and is a perfectly appropriate (albeit less precise) term, based on common parlance. Perhaps the game design industry does not use them, as I have. So be it; live and learn

    But I grow weary of ZB's palpably condescending faux-confusion. Seems it's the only kind of post he makes, around here. There were plenty of genuine ways to clarify, had he actually been confused about my meaning. But no---not his style. I've little patience for such nonsense. Amazingly, I think he fancies himself rather clever...

    Any ideas, PinkDot? I'm chugging through the threads on squirrel, but it's a bit daunting at the moment.

  11. #11
    Dóttirin klęšist oft móšur möttli
    Registered: Apr 2015
    Might be useful to take a look at the puzzle in Temple of the Tides
    The puzzle pieces are working with coordinates (object 34 for example). Some special script there (NVSortPuzzle)

  12. #12
    Member
    Registered: May 2017
    Location: USA
    Great idea, thanks! I'll take a look!

  13. #13
    Member
    Registered: Oct 2004
    Location: Ireland/Poland
    Quote Originally Posted by trefoilknot View Post
    Any ideas, PinkDot? I'm chugging through the threads on squirrel, but it's a bit daunting at the moment.
    Sorry, no not right now. I have had a look at Squirrel API documentation and it looks approachable, even for a simple folk like myself. If you don't get it working using the approach suggested by Unna, I'd be happy to finally get my hands dirty with Squirrel in the coming days.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •