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
Can anyone find the script error?
danimora2012 Offline
Junior Member

Posts: 47
Threads: 18
Joined: Apr 2012
Reputation: 0
#1
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
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
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.
(This post was last modified: 09-15-2012, 08:18 PM by FlawlessHappiness.)
09-15-2012, 08:17 PM
Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#3
RE: Can anyone find the script error?

It should be like this:

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

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
09-15-2012, 08:25 PM
Find
danimora2012 Offline
Junior Member

Posts: 47
Threads: 18
Joined: Apr 2012
Reputation: 0
#4
RE: Can anyone find the script error?

(09-15-2012, 08:25 PM)Wapez Wrote: It should be like this:

PHP Code: (Select All)
//////////////////////////////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
(This post was last modified: 09-15-2012, 08:47 PM by danimora2012.)
09-15-2012, 08:45 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#5
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:

PHP Code: (Select All)
//////////////////////////////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.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 09-15-2012, 09:08 PM by The chaser.)
09-15-2012, 08:52 PM
Find
danimora2012 Offline
Junior Member

Posts: 47
Threads: 18
Joined: Apr 2012
Reputation: 0
#6
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:

PHP Code: (Select All)
//////////////////////////////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()
(This post was last modified: 09-15-2012, 09:44 PM by danimora2012.)
09-15-2012, 09:28 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: Can anyone find the script error?

Then try with SetEntityCallbackFunc("key", "Jump");

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
09-15-2012, 09:58 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
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.

Tutorials: From Noob to Pro
(This post was last modified: 09-15-2012, 10:09 PM by Your Computer.)
09-15-2012, 10:06 PM
Website Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#9
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.

Confused How I couldn't see that? Confused

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
09-15-2012, 10:14 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#10
RE: Can anyone find the script error?

*cough*(string &in asEntity) *cough*

Wink 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
Find




Users browsing this thread: 3 Guest(s)