trefoilknot on 12/6/2018 at 20:42
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!
R Soul on 12/6/2018 at 21:21
For something as simple as x=100, try installing (
http://thiefmissions.com/telliamed/index.html) PublicScripts and using TrigOBBSpec (bounds trigger for a specific archetype). A more versatile option would be (
http://thiefmissions.com/telliamed/scripts.html#trigroomobject) 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 (
http://www.ttlg.com/forums/showthread.php?t=147760) 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.
trefoilknot on 12/6/2018 at 21:39
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!
ZylonBane on 13/6/2018 at 01:03
Quote Posted by trefoilknot
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.
LarryG on 13/6/2018 at 01:37
(x, y, z, h, p, b) perhaps ?
trefoilknot on 13/6/2018 at 02:28
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?"
ZylonBane on 13/6/2018 at 03:25
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!
trefoilknot on 13/6/2018 at 03:31
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!
PinkDot on 13/6/2018 at 07:55
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! ;) :D
trefoilknot on 13/6/2018 at 12:43
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.