Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Grant, AndrewAMD), 911 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
missing bracket, not really? #140627
07/12/07 02:02
07/12/07 02:02
Joined: Oct 2003
Posts: 2,194
Saturn
Metal_Thrasher Offline OP
Expert
Metal_Thrasher  Offline OP
Expert

Joined: Oct 2003
Posts: 2,194
Saturn
My script I'm trying to run wont, because when I'm starting it up, it tells me I have a missing bracket...but I'm made positive I wasn't missing a bracket. and I'm not. So why does it say I am? For the line it gives me the last line which is 314, it says "314:-1". Anybody know what the problem is?


-Johnny Thrash
Re: missing bracket, not really? [Re: Metal_Thrasher] #140628
07/12/07 02:58
07/12/07 02:58
Joined: Oct 2003
Posts: 2,194
Saturn
Metal_Thrasher Offline OP
Expert
Metal_Thrasher  Offline OP
Expert

Joined: Oct 2003
Posts: 2,194
Saturn
if it helps, after commenting it out. the problem seems to be somewhere is this bit of code
Code:
 	ifelse(gunselec==1 && gun1clip=0 && gun1amm>0)
{
snd_play(gunpickup, 100, 0);
while(1)
{
animrate1 += 4*time;
if (animrate1 > 100)
{
animrate1 -= 100;
gunanimfin=0;
return;
}

ent_animate(screengun,"reload",animrate1,0);
wait(1);

if(gun1amm > 6)
{
gun1clip=6;
gun1amm-=6;
return;
}
else
{
gun1clip=gun1amm;
gun1amm=0;
return;
}
}
}




-Johnny Thrash
Re: missing bracket, not really? [Re: Metal_Thrasher] #140629
07/12/07 03:47
07/12/07 03:47
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
try "if" instead of "ifelse" at the beginning.

not sure though.

as u said, ur bracket count seems just fine.

julz


Formerly known as JulzMighty.
I made KarBOOM!
Re: missing bracket, not really? [Re: JibbSmart] #140630
07/12/07 08:22
07/12/07 08:22
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
i am realy not sure about this but maby you need to add () after return
dont be angry if it isnt


"empty"
Re: missing bracket, not really? [Re: Metal_Thrasher] #140631
07/12/07 08:30
07/12/07 08:30
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
@ flits:

Quote:

i am realy not sure about this but maby you need to add () after return
dont be angry if it isnt




Why should he be angry, every little bits help
But I guess your solution would lead into an error because a return parameter terminates the function so in that case you need to return either a variable, pointer or at least an expression when using '()'. You can just just return as in the example posted out by Metal_Thrasher which in that case would just end the function.

@ Metal_Thrasher:

I guess you're getting the error because of the equasion you missed :

Code:
 	ifelse(gunselec==1 && gun1clip==0 && gun1amm>0)
{
snd_play(gunpickup, 100, 0);
while(1)
{
animrate1 += 4*time;
if (animrate1 > 100)
{
animrate1 -= 100;
gunanimfin=0;
return;
}

ent_animate(screengun,"reload",animrate1,0);
wait(1);

if(gun1amm > 6)
{
gun1clip=6;
gun1amm-=6;
return;
}
else
{
gun1clip=gun1amm;
gun1amm=0;
return;
}
}
}



Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: missing bracket, not really? [Re: frazzle] #140632
07/12/07 11:25
07/12/07 11:25
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Quote:

I guess you're getting the error because of the equasion you missed :
Code:
ifelse(gunselec==1 && gun1clip==0 && gun1amm>0)...






@frazzle: while you're probably right that he didn't intend to do "gun1clip=0", it is still technically correct. i don't know about c-script, but other languages (probably including lite-c) should be able to use that, but instead of checking if gun1clip equals 0, it would make gun1clip equal 0 and return "true" if it successfully did that (which it will).

i hope u understand either way, you're correct that this is an error and i don't know if it would work with c-script.

julz


Formerly known as JulzMighty.
I made KarBOOM!
Re: missing bracket, not really? [Re: JibbSmart] #140633
07/12/07 14:45
07/12/07 14:45
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Well theoritically it is correct but in the practical way, c-script will give a 'missing parameter' error

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: missing bracket, not really? [Re: frazzle] #140634
07/13/07 01:46
07/13/07 01:46
Joined: Oct 2003
Posts: 2,194
Saturn
Metal_Thrasher Offline OP
Expert
Metal_Thrasher  Offline OP
Expert

Joined: Oct 2003
Posts: 2,194
Saturn
THanks for all the help guys. but I figured it out. I tried using if instead of ifelse, and for some reason it all worked out fine.


-Johnny Thrash
Re: missing bracket, not really? [Re: Metal_Thrasher] #140635
07/13/07 08:00
07/13/07 08:00
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Wasn't that what JulzMighty replied ??
Oh well, glad your problem is solved, but one question is still remaining.
Do you get an error when you only use one '=' instead of two in your expression in c-script ??

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: missing bracket, not really? [Re: frazzle] #140636
07/13/07 14:26
07/13/07 14:26
Joined: Oct 2003
Posts: 2,194
Saturn
Metal_Thrasher Offline OP
Expert
Metal_Thrasher  Offline OP
Expert

Joined: Oct 2003
Posts: 2,194
Saturn
Yes I did, I fixed it though, thanks again guys =D


-Johnny Thrash

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1