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
Brute doesn't want to go away.
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#1
Question  Brute doesn't want to go away.

Okay, so I've scripted an event, but would like the brute to despawn at the area "brute1stoparea".

I'm sure there's something wrong with my script, I just can't see it.

Here's my relevant script:
PHP Code: (Select All)
void OnEnter()
{
AddUseItemCallback("""room101key""room101""UsedKeyOnDoor"true);
AddUseItemCallback("""room100key""room100""UsedKeyOnDoor"true);
AddUseItemCallback("""hollow_needle_1""padlock_rusty_1""unlock_prison_section_1"true);
AddEntityCollideCallback("Player""prison_1swingarea""func_slam"true1);
AddEntityCollideCallback("Player""intromusic1""playintromusic1"true1);
AddEntityCollideCallback("brute1""brute1stoparea""endbrute1"true1);
SetEntityPlayerInteractCallback("prison_1""func_slam"true);
SetEntityCallbackFunc("room100key""OnPickup");
SetEntityCallbackFunc("NOTETWO""OnPickup");
}

void endbrute1(string &in asEntity)
{
SetEntityActive("brute1"false);


I get no errors, but he doesn't deactivate at the area.

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-21-2012, 09:07 PM by The Shanus.)
06-21-2012, 05:53 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Grunt doesn't want to go away.

Improper syntax for the endbrute1 script (syntax is the stuff inside the "()"). You have:

void endbrute1(string &in asEntity)
{
SetEntityActive("brute1", false);
}

it should be


void endbrute1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("brute1", false);
}

Also, you should have all callbacks under the "void OnStart()", not OnEnter.

I rate it 3 memes.
(This post was last modified: 06-21-2012, 06:00 PM by Adny.)
06-21-2012, 05:58 PM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#3
RE: Grunt doesn't want to go away.

(06-21-2012, 05:58 PM)andyrockin123 Wrote: Improper syntax for the endbrute1 script (syntax is the stuff inside the "()"). You have:

void endbrute1(string &in asEntity)
{
SetEntityActive("brute1", false);
}

it should be


void endbrute1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("brute1", false);
}

Also, you should have all callbacks under the "void OnStart()", not OnEnter.
Thanks alot. How do I know which arguments to use in the bracket? For future reference.
I'm also wondering - how do I change the amount of oil in the lantern when it's picked up? There are no tutorials for it.

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-21-2012, 06:31 PM by The Shanus.)
06-21-2012, 06:26 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#4
RE: Brute doesn't want to go away.

SetPlayerLampOil(float afOil);

max amount is 100.0f, min is 0.0f
06-21-2012, 06:34 PM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#5
RE: Brute doesn't want to go away.

(06-21-2012, 06:34 PM)FastHunteR Wrote: SetPlayerLampOil(float afOil);

max amount is 100.0f, min is 0.0f
Great, thanks a bunch.

[Image: theshanusyoutube.jpg]
06-21-2012, 06:40 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#6
RE: Brute doesn't want to go away.

This page:

http://wiki.frictionalgames.com/hpl2/amn..._functions


has all of the callback syntax listed; just search for the function using "ctrl+f", (for example, search entitycollidecallback). Generally, after the function is listed there will be details; most callbacks will have this afterwards:


Calls a function when two entites collide.
Callback syntax: void MyFunc(string &in asParent, string &in asChild, int alState)
^^ Callback syntax is what you need.


The bolded part is what you need. It is note worthy that sometimes they're not fully written out, like in some cases a part will be written like: "string &in entity" instead of "string &in asEntity", but that shouldn't cause too many problems within the script Big Grin

I rate it 3 memes.
06-21-2012, 06:46 PM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#7
RE: Brute doesn't want to go away.

(06-21-2012, 06:46 PM)andyrockin123 Wrote: This page:

http://wiki.frictionalgames.com/hpl2/amn..._functions


has all of the callback syntax listed; just search for the function using "ctrl+f", (for example, search entitycollidecallback). Generally, after the function is listed there will be details; most callbacks will have this afterwards:


Calls a function when two entites collide.
Callback syntax: void MyFunc(string &in asParent, string &in asChild, int alState)
^^ Callback syntax is what you need.


The bolded part is what you need. It is note worthy that sometimes they're not fully written out, like in some cases a part will be written like: "string &in entity" instead of "string &in asEntity", but that shouldn't cause too many problems within the script Big Grin
Oh, got it! So I'll just search for callback and keep going till it looks like the one I need :p Thanks mate, you've been a great help. And FastHunteR too! Always there for me Big Grin +1 rep.

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-21-2012, 09:07 PM by The Shanus.)
06-21-2012, 09:06 PM
Find




Users browsing this thread: 1 Guest(s)