Germanunkol, you must be psychic.
I glanced at this thread three or four times, hoping by some chance, someone would actually suggest values were being overwritten.
Eventually, against good sense, I wasted my time writing the following...I 'hit refresh' and someone actually indeed, finally declares the possibility.
Really, you can't suggest the values were being overwritten without slightly implying that the question asker is 'incompetent'.
vec_for_fu<k is not function
Code:
//...
function prefunc_bottom_spray();
//...
Function func_bottom_spray() {
/*
I believe this or a variation of was sound, but
expected results are probably dependent upon whether
relevant variables are overwritten in the next function.
vel and position might have been overwritten in
prefunc_bottom_spray()
*/
var vel[3];
vec_set(vel, nullvector);
vec_for_angle(vel, ent_waterfall.pan);
vec_scale(vel, 8.45); //[optional]
//randomize [optional]
var i0 =0;
while (i0 < 3) {
temp[0] = random(0, 7.45);
if (random(1) < 0.5) {
temp[0] *= -1;
}
vel[i0] += temp[0];
i0 += 1;
}
vec_for_vertex(temp, my, 7);
effect(prefunc_bottom_spray, 1, temp, vel);
}
//...
Function prefunc_bottom_spray()
{
mat_particle_fall.specular_blue=clamp(my.blue+(d3d_fogcolor1.blue*ent_waterfall.fall_fogcol_fac)+ent_waterfall.fall_add_blue,0,255);
mat_particle_fall.specular_green=clamp(my.green+(d3d_fogcolor1.green*ent_waterfall.fall_fogcol_fac)+ent_waterfall.fall_add_green,0,255);
mat_particle_fall.specular_red=clamp(my.red+(d3d_fogcolor1.red*ent_waterfall.fall_fogcol_fac)+ent_waterfall.fall_add_red,0,255);
my.blue=mat_particle_fall.specular_blue;
my.green=mat_particle_fall.specular_green;
my.red=mat_particle_fall.specular_red;
my.bmap = bmp_bott_spray;
//my.vel_x = random(6) - 3 ; vel was overwritten
//my.vel_y = random(0.8) - 0.4; vel was overwritten
// I offer no claims of validity for these modifications.
// They are dummy or placeholder modifications only.
my.vel_y -= max(my.vel_y * 0.995, time_step * 0.35);
my.vel_x -= max(my.vel_x * 0.995, time_step * 0.35);
//my.vel_z = 4.5 ;
my.z = my.vel_z * my.skill_a - 1/2 * 5 * pow(my.skill_a, 2);
my.size = ent_waterfall.bott_spray_size;//4
my.alpha = ent_waterfall.bott_spray_alpha;//60
//my.gravity = 0.4 ;
my.streak = off;
my.flare = off;
if(ent_waterfall.bott_spray_bright == on){
my.bright = on;
}
else{
my.bright = off;
}
my.beam = off;
my.move = on;
my.transparent = on;
my.function = init_prefunc_bottom_spray;
//Why are vel and pos both set directly?
//my.x = my.x-10+random(ent_waterfall.bott_spray_width)-ent_waterfall.bott_spray_width/2;
//my.y = my.y+8+ent_waterfall.bott_spray_pos_y;
//my.z = (my.z+ent_waterfall.bott_spray_level)+(random(5)-2.5);
my.skill_a += time;
}
Although there seemed to be a superfluous instruction, what Thunder had probably would have worked.
Seemingly, vec_for_angle is a vec_set, vec_rotate, ... shortcut. Or is it?