Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,227 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Invalid Arguments #243383
12/29/08 18:53
12/29/08 18:53
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
I got Invalid arguments in an Particle function, and dont know why.

Im using A6 v.6.60

Code:

function rocket_smoke()
{
	while (1)

       {

               effect(rocket_smoke_behavior() ,50, my.x, normal);
               
        }
}


function rocket_smoke_behavior()
{
		my.bmap = pcxSmokeParticel;
		
		my.TRANSPARENT = on;
	
		 my.alpha = 60 ;
			my.lifespan = 80;
       my.flare = on;

       my.bright = on;

       my.move = on;

       my.function = fade_smoke();


}


function fade_smoke()
{
	
	my.TRANSPARENT = on;
	
	
		
		my.alpha -= 1.2 * time_step;
      if (my.alpha <= 0) { my.lifespan = 0; } 

        


}


The invalid argument is in function fade_smoke

INVALID ARGUMENT : (my.alpha <= 0)

Please, anyone may help me.

I took the code from AUM, and from manual, i dont know why this is an invalid argument.

Thanks to all

Mike

Re: Invalid Arguments [Re: MikeS] #243511
12/30/08 13:59
12/30/08 13:59
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
Guys, i really need help with this, is there no one out there to help me? Im going mad about this problem.

Re: Invalid Arguments [Re: MikeS] #243519
12/30/08 14:47
12/30/08 14:47
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
hey,
remove the brackets

change
Code:
effect(rocket_smoke_behavior() ,50, my.x, normal);

to
Code:
effect(rocket_smoke_behavior, 50, my.x, normal);
also add a wait(1) to your while loop

hope this helps

Re: Invalid Arguments [Re: MikeS] #243594
12/30/08 21:35
12/30/08 21:35
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
Yes, thanks, that worked, BUT:

My big mistake was:

i did not put the functions in the right order.

This was the right one:

Code:
function fade_smoke()
{
	
	
	my.alpha -= 0.8 * time_step;
	if (my.alpha <= 0) 
		{ 
		my.lifespan = 0;
		}


}







function rocket_smoke_behavior()
{
my.bmap = pcxSmokeParticel;
		
my.TRANSPARENT = on;
	
my.alpha = 50 ;
my.lifespan = 80;
my.flare = on;
my.size = 10;
my.bright = on;

my.move = on;

my.function = fade_smoke;
}


function rocket_smoke()
{
	
while (1)
{

effect(rocket_smoke_behavior,1, my.x, velocity);
wait (1);
}
}



Thanks for all, now i solved it :-)

Re: Invalid Arguments [Re: MikeS] #243635
12/31/08 00:55
12/31/08 00:55
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Originally Posted By: MikeS
Thanks for all, now i solved it :-)


the problem you had was placing brackets, arranging function order wasn't the problem

you can define the functions beforehand

Re: Invalid Arguments [Re: MrGuest] #243717
12/31/08 14:45
12/31/08 14:45
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
Originally Posted By: MrGuest
Originally Posted By: MikeS
Thanks for all, now i solved it :-)


the problem you had was placing brackets, arranging function order wasn't the problem

you can define the functions beforehand


only if you have prototyped them beforehand, but he didn't so the order of the functions infact was important.


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku

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