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
AddEntityCollideCallback FAIL
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#1
AddEntityCollideCallback FAIL

Every single time I try to script the "AddEntityCollideCallback" thingy, NOTHING HAPPENS. So, I'm finally asking for help. I've put the area in the level editor, I scripted just like in the wiki tutorials, and I'm sure the names are correct. I don't know why i can't make this ship work! Won't you please, please help me?

This is the part of the .hps script that matters:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1);
}

void BottleFunc1()
{
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world");
SetSwingDoorClosed("mansion_1", true, true);
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(7.0f, true);
}

And, as I said, the area is there. With the same name. So is the bottle. And the door. And all.
I need somebody, help!
10-29-2011, 10:35 PM
Find
devin413 Offline
Member

Posts: 175
Threads: 7
Joined: Jul 2011
Reputation: 3
#2
RE: AddEntityCollideCallback FAIL

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1);
}

void BottleFunc1(string &in asParent, string &in asChild, int alState)
{
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world");
SetSwingDoorClosed("mansion_1", true, true);
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(7.0f, true);
}


you forgot (string &in asParent, string &in asChild, int alState)

np dude ^^

Boris Game Studios: Devin413 Moddels Maps Scripts.
Tenebris Lake
Killings In Altstadt

(This post was last modified: 10-29-2011, 11:31 PM by devin413.)
10-29-2011, 11:31 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#3
RE: AddEntityCollideCallback FAIL

(10-29-2011, 10:35 PM)Victor Wrote: Every single time I try to script the "AddEntityCollideCallback" thingy, NOTHING HAPPENS. So, I'm finally asking for help. I've put the area in the level editor, I scripted just like in the wiki tutorials, and I'm sure the names are correct. I don't know why i can't make this ship work! Won't you please, please help me?

This is the part of the .hps script that matters:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1);
}

void BottleFunc1()
{
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world");
SetSwingDoorClosed("mansion_1", true, true);
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(7.0f, true);
}

And, as I said, the area is there. With the same name. So is the bottle. And the door. And all.
I need somebody, help!
You have decimals on the "AddPropForce" event, you would probably need to put an f on the end of each float.

e.g: AddPropForce("wine01_1", -8.738f, 0.945f, -8.775f, "world");


(This post was last modified: 10-30-2011, 12:06 AM by flamez3.)
10-30-2011, 12:06 AM
Find
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#4
RE: AddEntityCollideCallback FAIL

(10-29-2011, 11:31 PM)devin413 Wrote: ////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1);
}

void BottleFunc1(string &in asParent, string &in asChild, int alState)
{
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world");
SetSwingDoorClosed("mansion_1", true, true);
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(7.0f, true);
}


you forgot (string &in asParent, string &in asChild, int alState)

np dude ^^
Wasn't working WITH this, so I tried to take it off, but... this isn't the problem.

10-30-2011, 12:09 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#5
RE: AddEntityCollideCallback FAIL

(10-30-2011, 12:09 AM)Victor Wrote:
(10-29-2011, 11:31 PM)devin413 Wrote: ////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1);
}

void BottleFunc1(string &in asParent, string &in asChild, int alState)
{
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world");
SetSwingDoorClosed("mansion_1", true, true);
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(7.0f, true);
}


you forgot (string &in asParent, string &in asChild, int alState)

np dude ^^
Wasn't working WITH this, so I tried to take it off, but... this isn't the problem.
You need "(string &in asParent, string &in asChild, int alState)"...don't take it off.

10-30-2011, 12:32 AM
Find
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#6
RE: AddEntityCollideCallback FAIL

(10-30-2011, 12:32 AM)flamez3 Wrote:
(10-30-2011, 12:09 AM)Victor Wrote:
(10-29-2011, 11:31 PM)devin413 Wrote: ////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1);
}

void BottleFunc1(string &in asParent, string &in asChild, int alState)
{
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world");
SetSwingDoorClosed("mansion_1", true, true);
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(7.0f, true);
}


you forgot (string &in asParent, string &in asChild, int alState)

np dude ^^
Wasn't working WITH this, so I tried to take it off, but... this isn't the problem.
You need "(string &in asParent, string &in asChild, int alState)"...don't take it off.
Doesn't work anyway! I know because I already put it back!


(This post was last modified: 10-30-2011, 01:55 AM by Victor.)
10-30-2011, 01:52 AM
Find
devin413 Offline
Member

Posts: 175
Threads: 7
Joined: Jul 2011
Reputation: 3
#7
RE: AddEntityCollideCallback FAIL

lol i test it on a test map and it works

area name = bottlescare ?

AddPropImpulse("wine01_1", 5, 5, 5, "World");

propimpulse is better i think

Boris Game Studios: Devin413 Moddels Maps Scripts.
Tenebris Lake
Killings In Altstadt

(This post was last modified: 10-30-2011, 02:24 AM by devin413.)
10-30-2011, 02:18 AM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#8
RE: AddEntityCollideCallback FAIL

Yea, I'd doublecheck to make sure your script area is called bottlescare. It's case sensitive as well.
10-30-2011, 03:00 AM
Find
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#9
RE: AddEntityCollideCallback FAIL

Yes, it is bottlescare. I'm sure!
I don't think it is "propimpulse", it is not like this in the tutorial.
In the tutorial it's "PropImpulse" allright.
(This post was last modified: 10-30-2011, 03:14 AM by Victor.)
10-30-2011, 03:13 AM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#10
RE: AddEntityCollideCallback FAIL

(10-30-2011, 12:06 AM)flamez3 Wrote: You have decimals on the "AddPropForce" event, you would probably need to put an f on the end of each float.

e.g: AddPropForce("wine01_1", -8.738f, 0.945f, -8.775f, "world");
Whilst it isn't necessary, you are correct in stating and doing this, as it is good practice to add the "f" after the decimal numbers to state that they are "floats" rather than "doubles". I say this merely because otherwise, you may get warning messages mixed in any error messages when compiling your script. These appear in both the log files and the error message box if errors occur (otherwise they are just ignored), and if sufficient in number, waste time trying to scan through them to see the actual relevant info.
(This post was last modified: 10-30-2011, 03:36 AM by Apjjm.)
10-30-2011, 03:36 AM
Find




Users browsing this thread: 1 Guest(s)