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
#1
Examine script

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: (Select All)
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>
(This post was last modified: 08-08-2013, 11:27 AM by Tomzzz.)
08-08-2013, 07:41 AM
Website Find
The chaser Offline
Posting Freak

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

(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: (Select All)
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: (Select All)
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)

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-08-2013, 10:00 AM
Find
Tomzzz Offline
Junior Member

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

Well, ive tried this too, but its still same.. theres not text tho..
08-08-2013, 10:19 AM
Website Find
Adrianis Offline
Senior Member

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

(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

(This post was last modified: 08-08-2013, 11:05 AM by Adrianis.)
08-08-2013, 11:03 AM
Find
Tomzzz Offline
Junior Member

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

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..
(This post was last modified: 08-08-2013, 11:09 AM by Tomzzz.)
08-08-2013, 11:07 AM
Website Find
The chaser Offline
Posting Freak

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

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

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 08-08-2013, 11:08 AM by The chaser.)
08-08-2013, 11:07 AM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#7
RE: Examine script

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.

[Image: Tv0YgQb.gif]
Image by BandyGrass
08-08-2013, 11:12 AM
Find
The chaser Offline
Posting Freak

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

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)...

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

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

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

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:14 AM
Website Find
The chaser Offline
Posting Freak

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

(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

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-08-2013, 11:15 AM
Find




Users browsing this thread: 1 Guest(s)