Frictional Games Forum (read-only)

Full Version: Scripting Help!!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
void OnStart
{
FadeOut(0)
PlayMusic("forest(fw).ogg", False, 1.0, 1.5, 1, false);
SetMessage("Messages", "opening1", 3.0f);
SetMessage("Messages", "opening2", 3.0f);

}

This is my whole script. Yet I'm getting the error (2,1) Expected "("

This means it wants it to be {(
And then when i did that, it still said i needed one!
This makes no sense.... Help!!
You forgot a ; after FadeOut(0) and you have a big letter on false at PlayMusic.
(03-08-2013, 01:26 PM)junkfood2121 Wrote: [ -> ]You forgot a ; after FadeOut(0) and you have a big letter on false at PlayMusic.

how didnt i see this.. well it doesnt line up with the problem code it gave me i guess thats why..

<3's and giggles thanks man

Fixed it but its still giving me the same errorcode...

void OnStart
{
FadeOut(0);
PlayMusic("forest(fw).ogg", false, 1.0, 1.5, 1, false);
SetMessage("Messages", "opening1", 3.0f);
SetMessage("Messages", "opening2", 3.0f);

}

void OnEnter
{
}

void OnLeave
{
}

I have been missing () after the Void OnStart
Thats why it never showed.
Sorry to waste your time! At least the other errors were shown to me xD
(03-08-2013, 01:27 PM)WIWWM Wrote: [ -> ]
(03-08-2013, 01:26 PM)junkfood2121 Wrote: [ -> ]You forgot a ; after FadeOut(0) and you have a big letter on false at PlayMusic.

how didnt i see this.. well it doesnt line up with the problem code it gave me i guess thats why..

<3's and giggles thanks man

Fixed it but its still giving me the same errorcode...

void OnStart
{
FadeOut(0);
PlayMusic("forest(fw).ogg", false, 1.0, 1.5, 1, false);
SetMessage("Messages", "opening1", 3.0f);
SetMessage("Messages", "opening2", 3.0f);

}

void OnEnter
{
}

void OnLeave
{
}

I have been missing () after the Void OnStart
Thats why it never showed.
Sorry to waste your time! At least the other errors were shown to me xD

It's:

Code:
void OnStart
{
    FadeOut(0);
    PlayMusic("forestfw.ogg", false, 1.0, 1.5, 1, false);
    SetMessage("Messages", "opening1", 3.0f);
    SetMessage("Messages", "opening2", 3.0f);
    
}

void OnEnter
{
}

In the PlayMusic thing you had a (). If that's how your file is called, change the name, because the () are a part of the C++ syntax. This script is the good script, it should work.
(03-08-2013, 03:24 PM)The chaser Wrote: [ -> ]
(03-08-2013, 01:27 PM)WIWWM Wrote: [ -> ]
(03-08-2013, 01:26 PM)junkfood2121 Wrote: [ -> ]You forgot a ; after FadeOut(0) and you have a big letter on false at PlayMusic.

how didnt i see this.. well it doesnt line up with the problem code it gave me i guess thats why..

<3's and giggles thanks man

Fixed it but its still giving me the same errorcode...

void OnStart
{
FadeOut(0);
PlayMusic("forest(fw).ogg", false, 1.0, 1.5, 1, false);
SetMessage("Messages", "opening1", 3.0f);
SetMessage("Messages", "opening2", 3.0f);

}

void OnEnter
{
}

void OnLeave
{
}

I have been missing () after the Void OnStart
Thats why it never showed.
Sorry to waste your time! At least the other errors were shown to me xD

It's:

Code:
void OnStart
{
    FadeOut(0);
    PlayMusic("forestfw.ogg", false, 1.0, 1.5, 1, false);
    SetMessage("Messages", "opening1", 3.0f);
    SetMessage("Messages", "opening2", 3.0f);
    
}

void OnEnter
{
}

In the PlayMusic thing you had a (). If that's how your file is called, change the name, because the () are a part of the C++ syntax. This script is the good script, it should work.

it wouldnt. and i did change it thanks Smile

It woudnt work because you didnt put a () after OnEnter

void OnEnter()
void OnStart()
ECT

either way, let this thread RIP please
(03-08-2013, 03:24 PM)The chaser Wrote: [ -> ]In the PlayMusic thing you had a (). If that's how your file is called, change the name, because the () are a part of the C++ syntax. This script is the good script, it should work.

That shouldn't matter because it's contained within the string delimiter "", there are all sorts of keywords you can use within a string that don't cause problems because the compiler knows to treat it as a character not an operator
(03-08-2013, 06:09 PM)Adrianis Wrote: [ -> ]
(03-08-2013, 03:24 PM)The chaser Wrote: [ -> ]In the PlayMusic thing you had a (). If that's how your file is called, change the name, because the () are a part of the C++ syntax. This script is the good script, it should work.

That shouldn't matter because it's contained within the string delimiter "", there are all sorts of keywords you can use within a string that don't cause problems because the compiler knows to treat it as a character not an operator

If I remember correctly, there are some characters that can cause errors even if it is within a string, I know in PHP you have to put a \ before a ' for it to accept it is a character, so you never know it could cause errors Big Grin
(03-08-2013, 06:44 PM)sonataarctica Wrote: [ -> ]If I remember correctly, there are some characters that can cause errors even if it is within a string, I know in PHP you have to put a \ before a ' for it to accept it is a character, so you never know it could cause errors Big Grin

Yeh right, in other languages it's different. I can't speak for PHP as I've never used it, but normally that's because the character in question is the string delimiter, and so to include it within a string as a character you need to use an escape sequence like \ - that's the case in Javascript certainly. C has special escape sequences you can use for formatting and such, can't speak for C++ however.

But irrespective of all that, I made a sound file with () in the name and it worked just fine, so Angelscript doesn't have that problem at least!
OK Need some more help..

i cant seem to figure out how PlaySoundAtEntitiy works.. nor the .snt files! help with detailed steps please!
(03-09-2013, 01:07 AM)WIWWM Wrote: [ -> ]OK Need some more help..

i cant seem to figure out how PlaySoundAtEntitiy works.. nor the .snt files! help with detailed steps please!

PlaySoundAtEntity is a function that will play a sound at a specific entity. Could be a chair, or the Player. The .snt's are properties for sounds to play. It shows what is the volume, range and directory?

Is this what you mean? Because it's not clear enough.