Frictional Games Forum (read-only)

Full Version: Examine script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello, i cant get examine script working, ive tried everything but its still not working when i click on candlestick it does nothing..

im using Area Examine in map:
Name: ExamineArea_1
DescCat: Examine
DescEntry: InteractCandlestick



Map script:
PHP Code:
void OnStart()
{    
SetEntityPlayerInteractCallback("InteractCandlestick""InteractCandlestick"true);
}

void InteractCandlestick(string &in asTimer)
{
SetMessage("Examine""InteractCandlestick"0);
}


void OnLeave()
{
 



Extra english:

<CATEGORY Name = "Examine">
<Entry Name="InteractCandlestick">It is a candlestick.</Entry>
</CATEGORY>
(08-08-2013, 07:41 AM)Tomzzz Wrote: [ -> ]Hello, i cant get examine script working, ive tried everything but its still not working when i click on candlestick it does nothing..

im using Area Examine in map:
Name: ExamineArea_1
DescCat: Examine
DescEntry: InteractCandlestick



Map script:
PHP Code:
void OnStart()
{    
SetEntityPlayerInteractCallback("InteractCandlestick""InteractCandlestick"true);
}

void InteractCandlestick(string &in asTimer)
{
SetMessage("Examine""InteractCandlestick"0);
}


void OnLeave()
{
 



Extra english:

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


PHP Code:
void OnStart()
{    
SetEntityPlayerInteractCallback("InteractCandlestick""InteractCandlestick"true);
}

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


void OnLeave()
{
 


There, fixed it for you. You had the parameter wrong (string &in asTimer) instead (string &in asEntity)
Well, ive tried this too, but its still same.. theres not text tho..
(08-08-2013, 10:00 AM)The chaser Wrote: [ -> ]There, fixed it for you. You had the parameter wrong (string &in asTimer) instead (string &in asEntity)

As long as the parameter is of the right type (in this case, 'string &in') it doesn't matter what you call it. (string &in HUEHUFSEIPSN) is still perfectly valid, it only cares about the type of parameter. For example, I always start a string variable name with 'str' instead of 'as', 'in' instead of 'al' etc, so i use e.g. 'strTimer' or 'inState' for parameters without issue.
Though obviously it is helpful if it's called something meaningful to avoid confusion, it won't actually be a problem unless your using the wrong type


Tomzzz, you should check the name of the candlestick in your map to make sure it is "InteractCandlestick"
If it is, then you might want to post up the whole of your extra english lang file in case there is something else there causing a problem, your script looks fine
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..
(08-08-2013, 11:03 AM)Adrianis Wrote: [ -> ]
(08-08-2013, 10:00 AM)The chaser Wrote: [ -> ]There, fixed it for you. You had the parameter wrong (string &in asTimer) instead (string &in asEntity)

As long as the parameter is of the right type (in this case, 'string &in') it doesn't matter what you call it. (string &in HUEHUFSEIPSN) is still perfectly valid, it only cares about the type of parameter. For example, I always start a string variable name with 'str' instead of 'as', 'in' instead of 'al' etc, so i use e.g. 'strTimer' or 'inState' for parameters without issue.
Though obviously it is helpful if it's called something meaningful to avoid confusion, it won't actually be a problem unless your using the wrong type.

Wow, didn't know that... I'm still going to use the (string &in as) as it's more typical for me.

So yeah, Tomzzz, check names and post your whole .lang file, please.
I think I'm probably the only person on here who knows well how to USE the scripts, but can't for the life of me memorize them.

I copy-paste their base templates every single time, and just proceed to change whatever details I reuire lol.
It's not necessary to make an examine area for that. I made once a script where you had to touch something and something would happen (for my coming story, not going to spoil it):

Turn your examine area into a script area in the level editor (it's easy, there's a dropdown in the area general panel). Now, go to "Area" and put "InteractCandlestick" in PlayerInteractCallback. It should work now (I think)...
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..
(08-08-2013, 11:12 AM)Kreekakon Wrote: [ -> ]I think I'm probably the only person on here who knows well how to USE the scripts, but can't for the life of me memorize them.

I copy-paste their base templates every single time, and just proceed to change whatever details I reuire lol.

Big Grin the way I memorize them is to have the engine scripts page from the wiki downloaded and, as I use them all the time, I learn them by pure repetition.

You aren't alone Smile
Pages: 1 2