0 registered members (),
1,227
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Invalid Arguments
#243383
12/29/08 18:53
12/29/08 18:53
|
Joined: Mar 2007
Posts: 112
MikeS
OP
Member
|
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
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]
#243519
12/30/08 14:47
12/30/08 14:47
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
hey, remove the brackets change effect(rocket_smoke_behavior() ,50, my.x, normal); to 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
OP
Member
|
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:
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
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
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
Senior Expert
|
Senior Expert
Joined: Aug 2003
Posts: 7,439
Red Dwarf
|
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
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|