Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, NeoDumont), 761 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Fade-out #396630
03/08/12 16:59
03/08/12 16:59
Joined: Jan 2012
Posts: 16
R
rcth Offline OP
Newbie
rcth  Offline OP
Newbie
R

Joined: Jan 2012
Posts: 16
Hi,

I've made a fade-in script, but after the fade-in, it won't fade-out.
Script:
Quote:

PANEL* splash =
{
pos_x = 230;
pos_y = 10;
bmap = "start1.bmp";
}
set(splash, SHOW);
wait(1);
set(splash,TRANSLUCENT);
for (splash.alpha=0; splash.alpha+=5*time_step; splash.alpha<100) wait(5);
if(splash.alpha=100) {
for (splash.alpha=100; splash.alpha-=5*time_step; splash.alpha>0) wait(5);
}


So anyone?

Re: Fade-out [Re: rcth] #396633
03/08/12 17:10
03/08/12 17:10
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Why do you check if(splash.alpha=100)? Normally, splash.alpha will mostly never be exactly 100 after the first for loop, more like 100.3, 100.07 or something like that. Then there is missing a second "=", so you don't compare the values, but you assign 100 to splash.alpha. Then you've got the for loops messed up a little, it should be:

for (splash.alpha=0; splash.alpha<100; splash.alpha+=time_step) wait(1);
instead of
for (splash.alpha=0; splash.alpha+=5*time_step; splash.alpha<100) wait(5);


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Fade-out [Re: Superku] #396634
03/08/12 18:11
03/08/12 18:11
Joined: Jan 2012
Posts: 16
R
rcth Offline OP
Newbie
rcth  Offline OP
Newbie
R

Joined: Jan 2012
Posts: 16
I'll test it, thanks!

Re: Fade-out [Re: rcth] #396685
03/09/12 00:44
03/09/12 00:44
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
you could just remove the if statement altogether, you know it must be greater than or equal to 100 after the first for loop.

preferably i'd use a while loop
Code:
while(splash.alpha < 100){
  splash.alpha += 5*time_step; //change this to change the speed
  wait(5); //change this to 1 otherwise you'll get uneven fading.
}

wait(-1); //keep onscreen for 1 second
while(splash.alpha > 0){
  splash.alpha -= 5*time_step; //as above
  wait(5); //as above
}

though the result would be the same

Re: Fade-out [Re: MrGuest] #396723
03/09/12 15:47
03/09/12 15:47
Joined: Jan 2012
Posts: 16
R
rcth Offline OP
Newbie
rcth  Offline OP
Newbie
R

Joined: Jan 2012
Posts: 16
Ok, thanks all. It's working!

Anyway, a new question: Is there no way to:
* Use the old A7 physics engine in A8?
* Buy A7.X now?

Re: Fade-out [Re: rcth] #396724
03/09/12 15:54
03/09/12 15:54
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I don't think that there are anyways to buy officially A7 license any more, ony from hands. Better learn PhysX, it's more stable in my opinion.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Fade-out [Re: 3run] #396725
03/09/12 16:04
03/09/12 16:04
Joined: Jan 2012
Posts: 16
R
rcth Offline OP
Newbie
rcth  Offline OP
Newbie
R

Joined: Jan 2012
Posts: 16
awh, ok... Are there btw any c-script tutorials? I only can find some from lite-c.

Re: Fade-out [Re: rcth] #396728
03/09/12 16:56
03/09/12 16:56
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Why do you want to use the ODE physics engine, buy A7 and learn C-Script?
C-Script is dead and far inferior to lite-C.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Fade-out [Re: Superku] #396729
03/09/12 17:10
03/09/12 17:10
Joined: Jan 2012
Posts: 16
R
rcth Offline OP
Newbie
rcth  Offline OP
Newbie
R

Joined: Jan 2012
Posts: 16
Because all the help I get for a really specific type of making games is in the old A7 engine with old physics, that's why. And c-script is another reason.

Last edited by rcth; 03/09/12 17:11.
Re: Fade-out [Re: rcth] #396736
03/09/12 19:09
03/09/12 19:09
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
These arguments are just shit. You wanna see what you can do with A8 and lite-c?
I will post anywhen this year my FPS game for free!
I hope you all enjoy it grin


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