7heDubz
Posting Freak
Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation:
41
|
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 |
|
Linus Ågren
Senior Member
Posts: 309
Threads: 58
Joined: Jan 2011
Reputation:
5
|
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 |
|
7heDubz
Posting Freak
Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation:
41
|
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 |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
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)
Aculy iz dolan.
(This post was last modified: 03-08-2013, 03:24 PM by The chaser.)
|
|
03-08-2013, 03:24 PM |
|
7heDubz
Posting Freak
Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation:
41
|
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
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 |
|
Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
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 |
|
ExpectedIdentifier
Member
Posts: 234
Threads: 10
Joined: Sep 2012
Reputation:
11
|
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
|
|
03-08-2013, 06:44 PM |
|
Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
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
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 |
|
7heDubz
Posting Freak
Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation:
41
|
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 |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
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 |
|
|