Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Examine script
Tomzzz Offline
Junior Member

Posts: 23
Threads: 7
Joined: Aug 2013
Reputation: 1
#11
RE: Examine script

changed to area script but result is still the same = nothing , im getting really mad :x cmon dolan help me
08-08-2013, 11:19 AM
Website Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#12
RE: Examine script

(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

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

And your fixed script:


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()
{

}

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-08-2013, 11:19 AM
Find
Tomzzz Offline
Junior Member

Posts: 23
Threads: 7
Joined: Aug 2013
Reputation: 1
#13
RE: Examine script

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..
08-08-2013, 11:25 AM
Website Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#14
RE: Examine script

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.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-08-2013, 11:36 AM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#15
RE: Examine script

(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
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
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

(This post was last modified: 08-08-2013, 12:25 PM by Adrianis.)
08-08-2013, 12:21 PM
Find




Users browsing this thread: 2 Guest(s)