Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wrong script!Why!?
Author Message
Janni1234 Offline
Member

Posts: 134
Joined: Jan 2011
Reputation: 1
Post: #1
Wrong script!Why!?

My scripting file:

void OnStart()
{
PlayMusic("01_amb_darkness.ogg", true, 0.7f, 1, 0, false);
}

void OnEnter()
{
AddEntityCollideCallback("Player", "scare_1", "scare1", true, 1);
PlayMusic("01_amb_darkness.ogg", true, 0.7f, 1, 0, false);

}

void scare1(string &in asParent , string &in asChild , int alState)
{
PlaySoundAtEntity("", "04_hole_squeal.snt", "candlestick_floor_1", 0, false);
01-05-2011 10:54 AM
Find all posts by this user Quote this message in a reply
ModManDann Offline
Member

Posts: 61
Joined: Dec 2010
Reputation: 0
Post: #2
RE: Wrong script!Why!?

you forgot } on the end.

Might be helpfull if you also post the error report you are getting.

Current project: Mind Trap
01-05-2011 10:59 AM
Find all posts by this user Quote this message in a reply
DIGI Byte Offline
Senior Member

Posts: 376
Joined: Dec 2010
Reputation: 1
Post: #3
RE: Wrong script!Why!?

(01-05-2011 10:59 AM)ModManDann Wrote:  you forgot } on the end.

Might be helpfull if you also post the error report you are getting.

also he's not using this correctly;
void scare1(string &in asParent , string &in asChild , int alState)

should be something like
void scare1(string &in asParent)

I'm not in the mood to look up the proper use and syntax
01-05-2011 11:07 AM
Find all posts by this user Quote this message in a reply
Janni1234 Offline
Member

Posts: 134
Joined: Jan 2011
Reputation: 1
Post: #4
RE: Wrong script!Why!?

Okay Thanks! Smile
But whats wrong with that?:
}

void guardian1(string &in asParent , string &in asChild , int alState)
{
PlaySoundAtEntity("", "guardian_distant3.snt", "storage_box_wood02_1", 0, false);
}
(This post was last modified: 01-05-2011 11:59 AM by Janni1234.)
01-05-2011 11:27 AM
Find all posts by this user Quote this message in a reply
Janni1234 Offline
Member

Posts: 134
Joined: Jan 2011
Reputation: 1
Post: #5
Is that right!?scripting

Huh

void OnStart()
{
PlayMusic("01_amb_darkness.ogg", true, 0.7f, 1, 0, false);
}

void OnEnter()
{
AddEntityCollideCallback("Player", "scare_1", "scare1", true, 1);
PlayMusic("01_amb_darkness.ogg", true, 0.7f, 1, 0, false);
AddEntityCollideCallback("player", "guardian_1", "guardian1", true, 1);
}

void scare1(string &in asParent , string &in asChild , int alState)
{
PlaySoundAtEntity("", "04_break02.snt", "candlestick_floor_1", 0, false);
PlaySoundAtEntity("", "scare_male_terrified_4.snt", "candlestick_floor_1", 0, false);
}

void guardian1(string &in asParent , string &in asChild , int alState)
{
PlaySoundAtEntity("", "guardian_distant.snt", "Player", 0, false);
PlaySoundAtEntity("", "guardian_idle.snt", "Player", 0, false);
01-05-2011 02:04 PM
Find all posts by this user Quote this message in a reply
jens Offline
Frictional Games

Posts: 4,095
Joined: Apr 2006
Reputation: 202
Post: #6
RE: Is that right!?scripting

Don't make a new thread for the same thing, use your old thread.

you are missing a } at the end again.
(This post was last modified: 01-05-2011 03:06 PM by jens.)
01-05-2011 03:05 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Mofo Offline
Member

Posts: 71
Joined: Sep 2010
Reputation: 2
Post: #7
RE: Wrong script!Why!?

void OnStart()
{
AddEntityCollideCallback("Player", "scare_1", "scare1", true, 1);
AddEntityCollideCallback("Player", "guardian_1", "guardian1", true, 1);
}

void OnEnter()
{
PlayMusic("01_amb_darkness.ogg", true, 0.7f, 1, 0, false);
}

void scare1(string &in asParent , string &in asChild , int alState)
{
AddDebugMessage("scare1", false);
PlaySoundAtEntity("scaresound1", "04_break02.snt", "candlestick_floor_1", 0, false);
PlaySoundAtEntity("scaresound2", "scare_male_terrified.snt", "candlestick_floor_1", 0, false);
}

void guardian1(string &in asParent , string &in asChild , int alState)
{
AddDebugMessage("guardian1", false);
PlaySoundAtEntity("guardiansound1", "guardian_distant.snt", "Player", 0, false);
PlaySoundAtEntity("guardiansound2", "guardian_idle.snt", "Player", 0, false);
}



There. That should work.
(This post was last modified: 01-05-2011 03:23 PM by Mofo.)
01-05-2011 03:22 PM
Find all posts by this user Quote this message in a reply
Janni1234 Offline
Member

Posts: 134
Joined: Jan 2011
Reputation: 1
Post: #8
RE: Wrong script!Why!?

@Jens : okay sorry Big Grin
@Mofo:Thanks man!
And yes right!Thanks.
01-05-2011 03:44 PM
Find all posts by this user Quote this message in a reply
Janni1234 Offline
Member

Posts: 134
Joined: Jan 2011
Reputation: 1
Post: #9
RE: Wrong script!Why!?

I`ve tried a new map.
void OnStart()
{
AddEntityCollideCallback("Player", "area_scare_1", "areascare1", true, 1);
PlayMusic("12_amb.ogg"), true, 0.7f, 1, 0, false);
}

void OnEnter()
{
PlayMusic("12_amb.ogg"), true, 0.7f, 1, 0, false);
}

void areascare1(string &in asParent , string &in asChild , int alState)
{
PlaySoundAtEntity("Player", "04_hole_squeal.snt", "candle_floor_1", 0, false);
}

Are there any mistakes!?
01-05-2011 05:55 PM
Find all posts by this user Quote this message in a reply
Akumasama Offline
Member

Posts: 122
Joined: Nov 2010
Reputation: 0
Post: #10
RE: Wrong script!Why!?

You should also post the error message you're getting.
I'm not sure what's wrong right now so yeah...
01-05-2011 06:01 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)