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
Wrong script!Why!?
Janni1234 Offline
Member

Posts: 134
Threads: 24
Joined: Jan 2011
Reputation: 1
#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
ModManDann Offline
Member

Posts: 61
Threads: 6
Joined: Dec 2010
Reputation: 0
#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
DIGI Byte Offline
Senior Member

Posts: 376
Threads: 20
Joined: Dec 2010
Reputation: 1
#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
Janni1234 Offline
Member

Posts: 134
Threads: 24
Joined: Jan 2011
Reputation: 1
#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
Janni1234 Offline
Member

Posts: 134
Threads: 24
Joined: Jan 2011
Reputation: 1
#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
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#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
Website Find
Mofo Offline
Member

Posts: 71
Threads: 4
Joined: Sep 2010
Reputation: 2
#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
Janni1234 Offline
Member

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

@Jens : okay sorry Big Grin
@Mofo:Thanks man!
And yes right!Thanks.
01-05-2011, 03:44 PM
Find
Janni1234 Offline
Member

Posts: 134
Threads: 24
Joined: Jan 2011
Reputation: 1
#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
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#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




Users browsing this thread: 2 Guest(s)