Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, dr_panther), 1,290 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Smoke Bug? #262779
04/25/09 20:53
04/25/09 20:53
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

Joined: Apr 2009
Posts: 113
Netherlands
Hello,

I'm using the smoke code from Aum60 (As it's exactly what I'm looking for), but there is something wrong with it!



Code:
function fade_smoke()

{

       my.alpha -= 0.15 * time; // particle fading speed

       if (my.alpha < 0) {my.lifespan = 0;}

}

 

function smoke_effect()

{
	    my.bmap = smoke;
	    
       temp.x = random(1) - 0.5; // move a bit on the x

       temp.y = random(1) - 0.5; // and y axis

       temp.z = random(2); // but always move upwards on the z axis

       vec_add (my.vel_x, temp);

       my.alpha = 10 + random(20);

       my.size = 5; // size of the smoke

       my.bright = on;

       my.move = on;

       my.lifespan = 50; // lifespan for the smoke particles

       my.function = fade_smoke;

}

 

starter generate_smoke()

{

       while (diamond == null) {wait (1);}

       while (1)

       {

               vec_for_vertex (temp, diamond, 2617); // generate smoke from the 246th vertex on the player model

               effect (smoke_effect, (2 / (time_step + 0.1)), temp.x, normal);

               wait (1);

       }

}


I can't think of something, it should work shocked


A7 7.77
Re: Smoke Bug? [Re: Dreher] #262792
04/25/09 21:53
04/25/09 21:53
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
It looks like something is wrong with your BMAP "smoke".
Ive not used this code, but I think the BMAP needs to have an
alpha channel (for transparency), like TGA for example.

The solid grey squares tells me something is wrong with the BMAP,
but their positions look OK.

Try using "smoke.tga" from the "x:/GStudio7/templates/images" folder of your install.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Smoke Bug? [Re: EvilSOB] #262797
04/25/09 22:14
04/25/09 22:14
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

Joined: Apr 2009
Posts: 113
Netherlands
Isn't gonne work..

Code:
BMAP* smoke_tga = "C\Program Files\GStudio7\template_6\images\smoke.tga";

function fade_smoke()

{

       my.alpha -= 0.15 * time; // particle fading speed

       if (my.alpha < 0) {my.lifespan = 0;}

}

function smoke_effect()

{
       my.bmap = smoke_tga;
	    
       temp.x = random(1) - 10.5; // move a bit on the x

       temp.y = random(1) - 10.5; // and y axis

       temp.z = random(2); // but always move upwards on the z axis

       vec_add (my.vel_x, temp);

       my.alpha = 10 + random(20);

       my.size = 5; // size of the smoke

       my.bright = on;

       my.move = on;

       my.lifespan = 50; // lifespan for the smoke particles

       my.function = fade_smoke;

}

starter generate_smoke()

{

       while (diamond == null) {wait (1);}

       while (1)

       {

               vec_for_vertex (temp, diamond, 2617); // generate smoke from the 246th vertex on the player model

               effect (smoke_effect, (2 / (time_step + 0.1)), temp.x, normal);

               wait (1);

       }

}

starter generate_smoke()

{

       while (diamond == null) {wait (1);}

       while (1)

       {
       	
               vec_for_vertex (temp, diamond, 2516); // generate smoke from the 246th vertex on the player model

               effect (smoke_effect, (2 / (time_step + 0.1)), temp.x, normal);

               wait (1);

       }

}


When trying to run, it says: (): Bitmap unkown C

BTW, I'm on XP ><

Last edited by Dreher; 04/25/09 22:14.

A7 7.77
Re: Smoke Bug? [Re: Dreher] #262802
04/25/09 23:53
04/25/09 23:53
Joined: Jul 2005
Posts: 38
N
ngisiger Offline
Newbie
ngisiger  Offline
Newbie
N

Joined: Jul 2005
Posts: 38
Hi!

I agree with EvilSOB (yikes! grin)

The code seems to work: it's just the aspect of the bitmap used as particle which is problematic.

Either the bitmap you use is somehow incorrect (YMCK or grayscale or indexed format, etc.) or A7 can't find it and uses a grey square instead of a bitmap (I think that's the default mode).

Maybe try copying the bitmap smoke.tga in the folder of your game, and rename smoke_tga accordingly.

Hope this helps!
Thomas

Re: Smoke Bug? [Re: ngisiger] #262806
04/26/09 01:01
04/26/09 01:01
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

Joined: Apr 2009
Posts: 113
Netherlands
Ok, I got it fixed, the code I use now (With the smoke.tga within the game folder)

Code:
BMAP smoke_tga = "smoke.tga";

function fade_smoke()

{

       my.alpha -= 0.15 * time; // particle fading speed

       if (my.alpha < 0) {my.lifespan = 0;}

}

 

function smoke_effect()

{
	    my.bmap = smoke_tga;
	    
       temp.x = random(1) - 0.5; // move a bit on the x

       temp.y = random(1) - 0.5; // and y axis

       temp.z = random(2); // but always move upwards on the z axis

       vec_add (my.vel_x, temp);

       my.alpha = 10 + random(20);

       my.size = 5; // size of the smoke

       my.bright = on;

       my.move = on;

       my.lifespan = 50; // lifespan for the smoke particles

       my.function = fade_smoke;

}

 

starter generate_smoke()

{

       while (diamond == null) {wait (1);}

       while (1)

       {

               vec_for_vertex (temp, diamond, 2617); // generate smoke from the 246th vertex on the player model

               effect (smoke_effect, (2 / (time_step + 0.1)), temp.x, normal);

               wait (1);

       }

}


I hope this will help other people out aswell ^^

And thanks to you too of course! wink

Last edited by Dreher; 04/26/09 01:02.

A7 7.77

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