danimora2012
Junior Member
Posts: 47
Threads: 18
Joined: Apr 2012
Reputation:
0
|
Can anyone find the script error?
////////////////////////////
//Run First Time Starting map
void OnStart()
{
SetEntityCallbackFunc("key", "Jump");
}
void jump(string &in asEntity, string &in type)
{
SetEntityActive("bro_1", true);
}
////////////////////////////
// Run when leaving map
void OnLeave()
i can't make the guy pop out when i pick up the key...
Name of the key -- key
Name of guy -- bro_1
Name of area -- Jump
|
|
09-15-2012, 08:04 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Can anyone find the script error?
Check the script wiki. It's:
SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity)
asName - internal name
asCallback - function to call
abRemoveOnInteraction - determines whether the callback should be removed when the player interacts with the entity
[/color]
Trying is the first step to success.
|
|
09-15-2012, 08:17 PM |
|
Wapez
Senior Member
Posts: 360
Threads: 37
Joined: Mar 2012
Reputation:
19
|
RE: Can anyone find the script error?
It should be like this:
//////////////////////////////Run First Time Starting map void OnStart() { SetEntityPlayerInteractCallback("key", "Jump", true); }
void Jump(string &in asEntity, string &in type) { SetEntityActive("bro_1", true); }
//////////////////////////// // Run when leaving map void OnLeave()
|
|
09-15-2012, 08:25 PM |
|
danimora2012
Junior Member
Posts: 47
Threads: 18
Joined: Apr 2012
Reputation:
0
|
RE: Can anyone find the script error?
(09-15-2012, 08:25 PM)Wapez Wrote: It should be like this:
//////////////////////////////Run First Time Starting map void OnStart() { SetEntityPlayerInteractCallback("key", "Jump", true); }
void Jump(string &in asEntity, string &in type) { SetEntityActive("bro_1", true); }
//////////////////////////// // Run when leaving map void OnLeave()
Uuuuuh...that's exacly the same...
(This post was last modified: 09-15-2012, 08:47 PM by danimora2012.)
|
|
09-15-2012, 08:45 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Can anyone find the script error?
(09-15-2012, 08:45 PM)danimora2012 Wrote: (09-15-2012, 08:25 PM)Wapez Wrote: It should be like this:
//////////////////////////////Run First Time Starting map void OnStart() { SetEntityPlayerInteractCallback("key", "Jump", true); }
void Jump(string &in asEntity, string &in type) { SetEntityActive("bro_1", true); }
//////////////////////////// // Run when leaving map void OnLeave()
Uuuuuh...that's exacly the same... No, it isn't. Check the SetEntityPlayerInteractCallback. You don't have that.
http://wiki.frictionalgames.com/hpl2/tutorials/start
http://wiki.frictionalgames.com/hpl2/tut...n_entities
The first link are the tutorials in the wiki. Please, before creating a thread asking something, check the wiki. The second link explains how to trigger a monster in an entity. Follow the instructions and all will be fine.
Also, here are the engine scripts. It says every single function:
http://wiki.frictionalgames.com/hpl2/amn..._functions
Please, development support is for things that you may not understand in the wiki. Use this section if you can't find your answer. We are always happy to help, but try to solve yourself your problems always that you can.
THE OTHERWORLD (WIP)
Aculy iz dolan.
(This post was last modified: 09-15-2012, 09:08 PM by The chaser.)
|
|
09-15-2012, 08:52 PM |
|
danimora2012
Junior Member
Posts: 47
Threads: 18
Joined: Apr 2012
Reputation:
0
|
RE: Can anyone find the script error?
(09-15-2012, 08:52 PM)The chaser Wrote: (09-15-2012, 08:45 PM)danimora2012 Wrote: (09-15-2012, 08:25 PM)Wapez Wrote: It should be like this:
//////////////////////////////Run First Time Starting map void OnStart() { SetEntityPlayerInteractCallback("key", "Jump", true); }
void Jump(string &in asEntity, string &in type) { SetEntityActive("bro_1", true); }
//////////////////////////// // Run when leaving map void OnLeave()
Uuuuuh...that's exacly the same... No, it isn't. Check the SetEntityPlayerInteractCallback. You don't have that.
http://wiki.frictionalgames.com/hpl2/tutorials/start
http://wiki.frictionalgames.com/hpl2/tut...n_entities
The first link are the tutorials in the wiki. Please, before creating a thread asking something, check the wiki. The second link explains how to trigger a monster in an entity. Follow the instructions and all will be fine.
Also, here are the engine scripts. It says every single function:
http://wiki.frictionalgames.com/hpl2/amn..._functions
Please, development support is for things that you may not understand in the wiki. Use this section if you can't find your answer. We are always happy to help, but try to solve yourself your problems always that you can. Alright...now i have this but still doesn't work...
//////////////////////////////Run First Time Starting map
void OnStart()
{
SetEntityPlayerInteractCallback("Player", "bro_1", "true");
}
void Jump(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("bro_1", true);
AddPropForce("bro_1", 0, 0, -9000, "world");
PlaySoundAtEntity("", "ahhh.snt", "Player", 0, false);
}
////////////////////////////// Run when leaving map
void OnLeave()
(This post was last modified: 09-15-2012, 09:44 PM by danimora2012.)
|
|
09-15-2012, 09:28 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Can anyone find the script error?
Then try with SetEntityCallbackFunc("key", "Jump");
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
09-15-2012, 09:58 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Can anyone find the script error?
Not sure how you managed to copy and paste and ruin the syntax of the callback. The original issue was that the callback syntax was incorrect and that the callback function name didn't match. And now it's the same issue, along with the fact that you converted a boolean into a string.
(This post was last modified: 09-15-2012, 10:09 PM by Your Computer.)
|
|
09-15-2012, 10:06 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Can anyone find the script error?
(09-15-2012, 10:06 PM)Your Computer Wrote: Not sure how you managed to copy and paste and ruin the syntax of the callback. The original issue was that the callback syntax was incorrect and that the callback function name didn't match. And now it's the same issue, along with the fact that you converted a boolean into a string. Damn, I didn't saw that. It's true: Jump and jump.
How I couldn't see that?
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
09-15-2012, 10:14 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Can anyone find the script error?
*cough*(string &in asEntity) *cough*
this syntax is what means: you are interacting with something and calling a function by it
Trying is the first step to success.
|
|
09-15-2012, 10:51 PM |
|
|