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
Scripting Help!!
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#1
Scripting Help!!

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!!

03-08-2013, 01:17 PM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#2
RE: Scripting Help!!

You forgot a ; after FadeOut(0) and you have a big letter on false at PlayMusic.

Creator of The Dark Treasure.
03-08-2013, 01:26 PM
Website Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#3
RE: Scripting Help!!

(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

(This post was last modified: 03-08-2013, 01:44 PM by 7heDubz.)
03-08-2013, 01:27 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: Scripting Help!!

(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:

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.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 03-08-2013, 03:24 PM by The chaser.)
03-08-2013, 03:24 PM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#5
RE: Scripting Help!!

(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:

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

(This post was last modified: 03-08-2013, 03:44 PM by 7heDubz.)
03-08-2013, 03:44 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#6
RE: Scripting Help!!

(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
Find
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#7
RE: Scripting Help!!

(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
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#8
RE: Scripting Help!!

(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!

03-09-2013, 12:19 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#9
RE: Scripting Help!!

OK Need some more help..

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

(This post was last modified: 03-09-2013, 01:36 AM by 7heDubz.)
03-09-2013, 01:07 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#10
RE: Scripting Help!!

(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.

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-09-2013, 11:18 AM
Find




Users browsing this thread: 1 Guest(s)