Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (AndrewAMD, TipmyPip, NewbieZorro, Grant), 14,196 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: can someone pls help me converter this to lice-c.. [Re: ZeroEight] #251588
02/13/09 22:18
02/13/09 22:18
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
it's integer but i don't think you need to cast it at all.

Re: can someone pls help me converter this to lice-c.. [Re: Joey] #251615
02/14/09 05:05
02/14/09 05:05
Joined: Nov 2008
Posts: 29
Philippines
ZeroEight Offline OP
Newbie
ZeroEight  Offline OP
Newbie

Joined: Nov 2008
Posts: 29
Philippines
this is the way i converted it..
can someone pls tell what's wrong with it
because when i move the camera the level just exits by it self and of course there's rain falling down.....


BMAP* smoke_tga = "laser_grey.tga";

//// particle alpha handling ////////
function fire_part_alphafade(PARTICLE *p)
{
p.alpha -= 0 *time_step;
if(p.alpha < 0) { p.alpha = 0; p.lifespan = 0; }
p.skill_b += 0.03;
p.skill_c = 6 - my.skill_b;
if(p.skill_c < 0) { p.lifespan = 0; }
}

///// particle creating /////////
function effect_fire(PARTICLE *p)
{
p.red = 128;
p.blue = 128;
p.green = 128;
p.skill_c = 0; p.skill_b = 0;
p.vel_x = random( 0 ) - 0 ;
p.vel_y = random( 0 ) - 0 ;
p.vel_z = -40 ;
p.x += random(1000)-500;
p.y += random(1000)-500;
p.z += random(100)-50;
p.alpha = 100;
p.size = 14;
p.bmap = smoke_tga;
//set(p, BRIGHT);
p.flags |= (MOVE);
set(p, TRANSLUCENT);
p.event = fire_part_alphafade; // change to a shorter, faster function
}
//// particle using /////////
action im_on_fire()
{
set(my, INVISIBLE);
set(my, PASSABLE);
while(1)
{
var rainAnzahlPartikel = 1;
VECTOR temp;
VECTOR* mypos =
{
x=0;
y=0;
z=0;
}
vec_set(mypos,camera.x);
temp.x = cos(camera.pan);
temp.y = sin(camera.pan);
temp.z = 600*cos(camera.tilt);
mypos.x = mypos.x + temp.z*temp.x;
mypos.y = mypos.y + temp.z*temp.y;
mypos.z = mypos.z + 600*sin(camera.tilt);
mypos.z = camera.z + 800;
effect(effect_fire,maxv(1,integer(rainAnzahlPartikel*time_step)),mypos,nullvector);
wait(1);
}
wait(1);
}

Re: can someone pls help me converter this to lice-c.. [Re: ZeroEight] #251653
02/14/09 13:47
02/14/09 13:47
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
this code is weird. you're overwriting mypos.z in the end. you're using VECTOR* and VECTOR kind of arbitrarily. you're using random(0)-0. you're mixing p.flags and set. you're not initializing p.lifespan.

Re: can someone pls help me converter this to lice-c.. [Re: Joey] #251778
02/14/09 19:44
02/14/09 19:44
Joined: Nov 2008
Posts: 29
Philippines
ZeroEight Offline OP
Newbie
ZeroEight  Offline OP
Newbie

Joined: Nov 2008
Posts: 29
Philippines
what should i do sir?

Re: can someone pls help me converter this to lice-c.. [Re: ZeroEight] #251839
02/15/09 10:09
02/15/09 10:09
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
Code:
BMAP* smoke_tga = "laser_grey.tga";

//// particle alpha handling ////////
function fire_part_alphafade(PARTICLE *p)
{
    p.alpha = p.lifespan -= time_step;
}

///// particle creating /////////
function effect_fire(PARTICLE *p)
{
    p.vel_x = random(20)-10;
    p.vel_y = random(20)-10;
    p.vel_z = -40;
    p.x += random(1000)-500;
    p.y += random(1000)-500;
    p.z += random(100)-50;
    p.lifespan = 100; // has to be adapted

    p.alpha = 100;
    p.bmap = smoke_tga;
    p.red = p.blue = p.green = 128;
    p.size = 14;

    p.flags |= (TRANSLUCENT | MOVE);
    p.event = fire_part_alphafade;
}

//// particle using /////////
const var RAIN_COUNT = 1;
action im_on_fire()
{
    set(my, INVISIBLE | PASSABLE);

    while(1)
    {
        VECTOR temp;
        vec_set(temp, camera.x);
        temp.z += 600;

        effect(effect_fire, maxv(1, integer(RAIN_COUNT*time_step)), temp, nullvector);

        wait(1);
    }
}


as for the lifespan, try to adapt it to your needs. i wasn't sure what you were trying to achieve so i just made the particle kind of like rain.

i haven't tested the code.

some general tips: try to write more compact code. try not to mix stuff which does the same thing (such as set and .flags) - just stick to one which fits your needs. don't mix English and German in variable names, use "const" for constants and write them in large letters. structurize your code with empty lines. and of course: "if you can say it with code, code, else comment" (which means that unnecessary comments don't add to the clearness of your code).

joey.

Re: can someone pls help me converter this to lice-c.. [Re: Joey] #252209
02/17/09 05:35
02/17/09 05:35
Joined: Nov 2008
Posts: 29
Philippines
ZeroEight Offline OP
Newbie
ZeroEight  Offline OP
Newbie

Joined: Nov 2008
Posts: 29
Philippines
it works now sir,thank you so much for the help.sorry for the late reply.kinda busy nowadays...

Page 2 of 2 1 2

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

Gamestudio download | 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