Scripts / Anyone know if there is a lua command that detects when the player looks at an object?

Author
Message
warlock12
7
Years of Service
User Offline
Joined: 12th Sep 2016
Location: Argentina
Posted: 27th Dec 2016 15:55
I am a couple of days ago looking for the form so that when looking at an object appears a promt ... Which command should be used? (It can be done)
Thanks since now
The game is a serious thing (El juego es una cosa seria)
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 27th Dec 2016 17:20
PromptLocal(e,"text goes here")

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
warlock12
7
Years of Service
User Offline
Joined: 12th Sep 2016
Location: Argentina
Posted: 27th Dec 2016 18:43
Thanks Belidos for speed and predisposition, but how does the object knows that the player is watching ???
The game is a serious thing (El juego es una cosa seria)
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 27th Dec 2016 18:48 Edited at: 27th Dec 2016 18:51
For that you need to code it yourself, something like this:



Just have:
if PlayerLookingAt (e) then PromptLocal(e, "<text in here>") end
Been there, done that, got all the T-Shirts!
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 27th Dec 2016 19:30 Edited at: 27th Dec 2016 19:30
I use similar, looks like there's lots of ways of doing it

In this one you can set the angle and distance by changing the variables at the top.


i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 27th Dec 2016 20:22
In mine you just pass them in to the call! (if you don't bother it just picks defaults, a really cool feature of Lua btw)
Been there, done that, got all the T-Shirts!
PM
warlock12
7
Years of Service
User Offline
Joined: 12th Sep 2016
Location: Argentina
Posted: 27th Dec 2016 21:05
Wow thank you very much friends! Just ask for a tip on the command ... but the complete script is better !!! Well, whenever you use it also to study it and that way do not disturb the others !!! Sincerely many thanks ... and I'm trying them !!!

How can I help you ???

Greetings from the pampas
The game is a serious thing (El juego es una cosa seria)
warlock12
7
Years of Service
User Offline
Joined: 12th Sep 2016
Location: Argentina
Posted: 27th Dec 2016 23:20
Working Genial!!! TY!!!
The game is a serious thing (El juego es una cosa seria)
Unspokenbond
7
Years of Service
User Offline
Joined: 28th Nov 2016
Playing: GameGuru
Posted: 28th Dec 2016 04:08 Edited at: 28th Dec 2016 04:08
This may help as well if you need still

https://forum.game-guru.com/thread/207801?page=7#msg2515459
PM

Login to post a reply

Server time is: 2024-05-21 23:30:28
Your offset time is: 2024-05-21 23:30:28