Frictional Games Forum (read-only)

Full Version: Can anyone find the script error?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
////////////////////////////
//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
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]
It should be like this:

PHP Code:
//////////////////////////////Run First Time Starting map
void OnStart()
{
SetEntityPlayerInteractCallback("key""Jump"true);
}

void Jump(string &in asEntitystring &in type)
{
SetEntityActive("bro_1"true);
}


////////////////////////////
// Run when leaving map
void OnLeave() 
(09-15-2012, 08:25 PM)Wapez Wrote: [ -> ]It should be like this:

PHP Code:
//////////////////////////////Run First Time Starting map
void OnStart()
{
SetEntityPlayerInteractCallback("key""Jump"true);
}

void Jump(string &in asEntitystring &in type)
{
SetEntityActive("bro_1"true);
}


////////////////////////////
// Run when leaving map
void OnLeave() 
Uuuuuh...that's exacly the same... Dodgy
(09-15-2012, 08:45 PM)danimora2012 Wrote: [ -> ]
(09-15-2012, 08:25 PM)Wapez Wrote: [ -> ]It should be like this:

PHP Code:
//////////////////////////////Run First Time Starting map
void OnStart()
{
SetEntityPlayerInteractCallback("key""Jump"true);
}

void Jump(string &in asEntitystring &in type)
{
SetEntityActive("bro_1"true);
}


////////////////////////////
// Run when leaving map
void OnLeave() 
Uuuuuh...that's exacly the same... Dodgy
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.
(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:

PHP Code:
//////////////////////////////Run First Time Starting map
void OnStart()
{
SetEntityPlayerInteractCallback("key""Jump"true);
}

void Jump(string &in asEntitystring &in type)
{
SetEntityActive("bro_1"true);
}


////////////////////////////
// Run when leaving map
void OnLeave() 
Uuuuuh...that's exacly the same... Dodgy
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()
Then try with SetEntityCallbackFunc("key", "Jump");
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.
(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.

Confused How I couldn't see that? Confused
*cough*(string &in asEntity) *cough*

Wink this syntax is what means: you are interacting with something and calling a function by it