![]() |
Display message only when looking at an entity - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Display message only when looking at an entity (/thread-18499.html) Pages:
1
2
|
RE: Display message only when looking at an entity - Robby - 09-25-2012 More details please. "But it didn't work". How? Error? Or what? RE: Display message only when looking at an entity - Akos115 - 09-25-2012 No error message. There is no text displayed when looking at the entity. RE: Display message only when looking at an entity - Robby - 09-25-2012 Maybe you had written the names in the script incorrectly? Maybe a tiny problem in the lang file? (Like, extra letter/symbol). Otherwise, what you tried may not function. When it comes to "if" parts in scripting, I'm dud like an extinguished grenade. RE: Display message only when looking at an entity - Akos115 - 09-25-2012 I checked the names in the script, the .lang file and even in the game.They are all good :/ I figured it out... I made static objects for the items to make sure the player wont pick them up... STATIC OBJECTS, not entities, thats why it wont work... I feel so stupid now xD RE: Display message only when looking at an entity - Vic7im - 09-25-2012 (09-25-2012, 04:10 PM)Akos115 Wrote: No error message. There is no text displayed when looking at the entity. I had the same issue not long ago. The problem is either: #1 .lang file error (even if you triple-check it, you may have overlooked it) Fix: Create another entity with a text in it and see if it appears. If it doesn't then there's an error in the .lang file. #2 Bad scripting. I personally use on start stuff: { SetEntityPlayerLookAtCallback("Entity", "Function", true); } void Function (string &in asEntity, int alState) { if (alState == 1) { SetMessage("Category", "Text", 0); } } which is basically the same thing you wrote. If the second solution doesn't work there's an error in the .lang file, no way around that. RE: Display message only when looking at an entity - Akos115 - 09-25-2012 (09-25-2012, 04:15 PM)Akos115 Wrote: I figured it out... I made static objects for the items to make sure the player wont pick them up... STATIC OBJECTS, not entities, thats why it wont work... I feel so stupid now xDbut thanks anyway RE: Display message only when looking at an entity - The chaser - 09-25-2012 In the level editor, click at the desired entity you want to be seeked and then that displays message. Sorry if I don't explain myself well, my english isn't the best ![]() It's PlayerLookAtCallback, or something like that. Try it. |