Frictional Games Forum (read-only)
Examine script - 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: Examine script (/thread-22356.html)

Pages: 1 2


RE: Examine script - Tomzzz - 08-08-2013

changed to area script but result is still the same = nothing , im getting really mad :x cmon dolan help me


RE: Examine script - The chaser - 08-08-2013

(08-08-2013, 11:14 AM)Tomzzz Wrote: well:


<LANGUAGE>
<CATEGORY Name = "Examine">
<Entry Name="InteractCandlestick">It is a candlestick</Entry>
</CATEGORY>

thats all im using in lang since ive just started creating new custom story... and i'll dont add anything until this problem will be fixed..

<LANGUAGE>
<CATEGORY Name = "Examine">
<Entry Name="InteractCandlestick">It is a candlestick</Entry>
</CATEGORY>
</LANGUAGE>

That's what was wrong. However, if you want a message, the .lang file must be changed:

GOOD .LANG FILE

Code:
<LANGUAGE>
<CATEGORY Name = "Messages">
<Entry Name="InteractCandlestick">It is a candlestick</Entry>
</CATEGORY>
</LANGUAGE>

And your fixed script:


Code:
void OnStart()
{    
///As you already do my thing in the level editor, is not necessary to put that function here
}

//This gets called when you interact with your area

void InteractCandlestick(string &in asEntity)
{
SetMessage("Messages", "InteractCandlestick", 0);
}


void OnLeave()
{

}



RE: Examine script - Tomzzz - 08-08-2013

Thanks dolan, its finally working!.. but i just dont get it.. what was wrong? your fixed script looks same only you just changed Examine to messages if im correct..


RE: Examine script - The chaser - 08-08-2013

Exactly: When you make a message, it MUST be in the "Messages" category. As the category was named "Examine" and not "Messages" the game didn't display that message, because it didn't know that was a message.

About the script: In the level editor you can also do script (not a powerful tool to make script, just a help) and, when it's about touching and those things, I prefer using the level editor and a bit of script.


RE: Examine script - Adrianis - 08-08-2013

(08-08-2013, 11:07 AM)Tomzzz Wrote: wait , wait.. so candle (as model) must be in code? cuz im using only Area Example in script
.. im touching the area not the model i think?
name of model is candlestick_tri_1... but i dont think i need to use it in code or i should? if yes can you show me where..

Glad it's solved and this may not have helped anyway, but in your previous script you had this line
Code:
SetEntityPlayerInteractCallback("InteractCandlestick", "InteractCandlestick", true);

That first parameter, the one you have as "InteractCandlestick", is the name of the entity that the interact callback is set to, so when you interact with 'InteractCandlestick' the function in the second parameter, in this case also called 'InteractCandlestick' is called. Obviously, if there is no entity called 'InteractCandlestick' then the callback will never be activated

So, if the name of your candlestick entity in the level ed is 'candlestick_tri_1' then the line should read
Code:
SetEntityPlayerInteractCallback("candlestick_tri_1", "InteractCandlestick", true);


Personally, I would always always set callbacks in the script rather than in the level editor - if you have the callbacks set in the level editor and the functions in the script it means you have to check 2 different places if something is not working, and it makes it way harder to keep track of what callbacks have been set where etc.
But then, I'm a programmer so I would say that Tongue