User01
Member
Posts: 97
Threads: 30
Joined: Feb 2013
Reputation:
0
|
area problem
I want to make two messages and the first message should never seen again, while only the second message should be shown after entering an area, which is inactive now
The code:
void OnStart() { AddEntityCollideCallback("Player" , "Area1" , "A" , true , 1); AddEntityCollideCallback("Player" , "Area2" , "C" , true , 1); }
void A(string &in asParent, string &in asChild, int alState) { SetEntityActive("object", true); SetMoveObjectState("object", 1.0); PlaySoundAtEntity("", "sound.snt", "object", 1.5f, false); SetMessage("Message", "SampleText", 4); AddTimer("", 4, "Hand2"); } void B(string &in asParent, string &in asChild, int alState) { SetEntityActive("Area2", true); }
void C(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "Sound.ogg", "object", 1.5f, SetMessage("Message2", "SampleText", 3); }
but somehow the void C part is just ignoring. Why?
(This post was last modified: 03-23-2013, 02:08 AM by plutomaniac.)
|
|
03-03-2013, 09:47 PM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: area problem
(03-03-2013, 09:47 PM)User01 Wrote: I want to make two messages and the first message should never seen again, while only the second message should be shown after entering an area, which is inactive now
The code:
void OnStart() { AddEntityCollideCallback("Player" , "Area1" , "A" , true , 1); AddEntityCollideCallback("Player" , "Area2" , "C" , true , 1); }
void A(string &in asParent, string &in asChild, int alState) { SetEntityActive("object", true); SetMoveObjectState("object", 1.0); PlaySoundAtEntity("", "sound.snt", "object", 1.5f, false); SetMessage("Message", "SampleText", 4); AddTimer("", 4, "Hand2"); } void B(string &in asParent, string &in asChild, int alState) { SetEntityActive("Area2", true); }
void C(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "Sound.ogg", "object", 1.5f, SetMessage("Message2", "SampleText", 3); }
but somehow the void C part is just ignoring. Why?
Why is there a void B ? I don't see any of B being mention in the script. I think that's the problem.
|
|
03-03-2013, 11:59 PM |
|
User01
Member
Posts: 97
Threads: 30
Joined: Feb 2013
Reputation:
0
|
RE: area problem
(03-03-2013, 11:59 PM)No Author Wrote: (03-03-2013, 09:47 PM)User01 Wrote: I want to make two messages and the first message should never seen again, while only the second message should be shown after entering an area, which is inactive now
The code:
void OnStart() { AddEntityCollideCallback("Player" , "Area1" , "A" , true , 1); AddEntityCollideCallback("Player" , "Area2" , "C" , true , 1); }
void A(string &in asParent, string &in asChild, int alState) { SetEntityActive("object", true); SetMoveObjectState("object", 1.0); PlaySoundAtEntity("", "sound.snt", "object", 1.5f, false); SetMessage("Message", "SampleText", 4); AddTimer("", 4, "Hand2"); } void B(string &in asParent, string &in asChild, int alState) { SetEntityActive("Area2", true); }
void C(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "Sound.ogg", "object", 1.5f, SetMessage("Message2", "SampleText", 3); }
but somehow the void C part is just ignoring. Why?
Why is there a void B ? I don't see any of B being mention in the script. I think that's the problem. Nope.avi
I did it like that and it was the same problem. I need a better way of script
|
|
03-04-2013, 12:58 AM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: area problem
Pass false to the second collision callback.
|
|
03-04-2013, 01:33 AM |
|
User01
Member
Posts: 97
Threads: 30
Joined: Feb 2013
Reputation:
0
|
RE: area problem
(03-04-2013, 01:33 AM)Your Computer Wrote: Pass false to the second collision callback. Do you mean
AddEntityCollideCallback("Player" , "Area2" , "C" , FALSE , 1); ?
I already tried that too and it didnt work.
|
|
03-04-2013, 02:33 AM |
|
ExpectedIdentifier
Member
Posts: 234
Threads: 10
Joined: Sep 2012
Reputation:
11
|
RE: area problem
(03-04-2013, 02:33 AM)User01 Wrote: (03-04-2013, 01:33 AM)Your Computer Wrote: Pass false to the second collision callback. Do you mean
AddEntityCollideCallback("Player" , "Area2" , "C" , FALSE , 1); ?
I already tried that too and it didnt work.
There is no collide callback that calls function "B", so Area2 is never set to active. Try this:
void OnStart() { AddEntityCollideCallback("Player" , "Area1" , "A" , true , 1); AddEntityCollideCallback("Player" , "Area2" , "C" , false , 1); AddEntityCollideCallback("Player" , "PUTSOMETHINGHERE" , "B" , true , 1); }
void A(string &in asParent, string &in asChild, int alState) { SetEntityActive("object", true); SetMoveObjectState("object", 1.0); PlaySoundAtEntity("", "sound.snt", "object", 1.5f, false); SetMessage("Message", "SampleText", 4); AddTimer("", 4, "Hand2"); } void B(string &in asParent, string &in asChild, int alState) { SetEntityActive("Area2", true); }
void C(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "Sound.ogg", "object", 1.5f, false); SetMessage("Message2", "SampleText", 3); }
You need to put in the area that you want the player to collide with to set Area2 active though. It's very confusing to try and see what you're doing though, so if this doesn't work explain again what the problem is.
|
|
03-04-2013, 02:50 AM |
|
|