I will post a stand-alone-code for my problem in case someone wants to try to solve it. I really have no idea what I am doing wrong confused

Quote:

/////////////////////////////////untitled.c/////////////////////////////////
//
//Generated by Parted by Martin Coumont (redphoenix)
//
//LiteC Script file from 15.10.2014 ; 15:31:15:
//
//////////////////////////////////////////////////////////////////////////////

#include <acknex.h>
#include <default.c>

/////////////////////////////////header/////////////////////////////////

#ifndef PARTED_VECTOR_DEF
#define PARTED_VECTOR_DEF
VECTOR* parted_temp_vec = { x=0;y=0;z=0; }
VECTOR* parted_temp2_vec = { x=0;y=0;z=0; }
ANGLE* parted_temp_ang = { pan=0;tilt=0;roll=0; }
#endif

#ifndef PARTED_RANGEFUNC_DEF
#define PARTED_RANGEFUNC_DEF
function range(x,y,z) {
z+=y;
if(x >= y && x <= z) return(1);
return(0);
}
#endif

/////////////////////////////////particle code/////////////////////////////////

function Base_Effect_base_event(PARTICLE* p) {
p.vel_x = sinv(p.skill_d*3.6+180)*p.skill_x;
p.vel_y = cosv(p.skill_d*3.6)*p.skill_y;
p.vel_z = p.skill_z;
if(p.creator)vec_rotate(p.vel_x,p.creator.pan);

p.skill_a += 1 * time_step;
if (p.skill_a >= 30) {p.lifespan = 0;}

//if (p.lifespan == 0) {printf("Lifespan is Zero");}

}

function Base_Effect_base(PARTICLE* p) {
p.size = 200.000;
p.alpha = 100.000;
p.red = 255;
p.green = 255;
p.blue = 0;
p.skill_c = 0.5;
p.vel_x = random(10.000)+(-5.000);
p.vel_y = random(10.000)+(-5.000);
p.vel_z = (50.000);
if(p.creator)vec_rotate(p.vel_x,p.creator.pan);
p.gravity = 0.000;
p.flags = BRIGHT | MOVE;
p.skill_x = p.vel_x;
p.skill_y = p.vel_y;
p.skill_z = p.vel_z;
p.event = Base_Effect_base_event;
}

/////////////////////////////////timetableemitter actions/////////////////////////////////

action Base_Effect_emitter() {
var my_time;my_time = 0;
var timetable_num;timetable_num = 0;
var eff_frac; eff_frac = 0;
wait(1);
while(my) {
my_time += time_step/16;
if(my_time >= 0.000)my_time = 0;
timetable_num = 1;
parted_temp_vec.x = 0.000; //Partikelstart-Positonen
parted_temp_vec.y = 0.000; //Partikelstart-Positonen
parted_temp_vec.z = 0.000; //Partikelstart-Positonen
vec_rotate(parted_temp_vec,my.pan);
vec_add(parted_temp_vec,my.x);
eff_frac += 0.075*timetable_num*time_step*6.25;
if(eff_frac >= 1){
effect(Base_Effect_base,integer(eff_frac),parted_temp_vec,nullvector);
eff_frac -= integer(eff_frac);
}
wait(1);
}
}
/////////////////////////////////creation/////////////////////////////////

function item_particle_effect_create(VECTOR* position) {
if(!position)position = nullvector;
wait(3);
you = ent_create(NULL,position,Base_Effect_emitter);
if(you) {
set(you,PASSABLE);
set(you,INVISIBLE);
}
}


function main()
{
vec_set(sky_color,vector(10,10,10));
level_load (NULL);
item_particle_effect_create(NULL);
vec_set(camera.x,vector(-380,-400,500));
camera.pan = 45;
camera.tilt = -30;
}


Press F11 and you see the Particle-Counter is endlessly going up

Last edited by Yking; 10/16/14 19:45.