Tomzzz
Junior Member
Posts: 23
Threads: 7
Joined: Aug 2013
Reputation:
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:
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 |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
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:
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>
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)
Aculy iz dolan.
|
|
08-08-2013, 10:00 AM |
|
Tomzzz
Junior Member
Posts: 23
Threads: 7
Joined: Aug 2013
Reputation:
1
|
RE: Examine script
Well, ive tried this too, but its still same.. theres not text tho..
|
|
08-08-2013, 10:19 AM |
|
Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
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 |
|
Tomzzz
Junior Member
Posts: 23
Threads: 7
Joined: Aug 2013
Reputation:
1
|
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 |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
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)
Aculy iz dolan.
(This post was last modified: 08-08-2013, 11:08 AM by The chaser.)
|
|
08-08-2013, 11:07 AM |
|
Kreekakon
Pick a god and pray!
Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation:
124
|
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.
|
|
08-08-2013, 11:12 AM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
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)
Aculy iz dolan.
|
|
08-08-2013, 11:14 AM |
|
Tomzzz
Junior Member
Posts: 23
Threads: 7
Joined: Aug 2013
Reputation:
1
|
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 |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
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.
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
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
08-08-2013, 11:15 AM |
|
|