BEAM / STREAK

Posted By: draculaFactory

BEAM / STREAK - 07/09/10 01:53

First, I have never had this problem before.

I am trying to make a particle line between two vectors. Beam and streak do not work, no particle is visible on the screen. The code is straight out of the manual for BEAM / STREAK. I am not using the ISOMETRIC flag for the camera.
Posted By: 3run

Re: BEAM / STREAK - 07/09/10 02:22

What version are you using? laugh
Posted By: draculaFactory

Re: BEAM / STREAK - 07/09/10 07:58

A7 Comm grin
Posted By: Superku

Re: BEAM / STREAK - 07/09/10 12:22

Then post your code, please.
Posted By: draculaFactory

Re: BEAM / STREAK - 07/09/10 20:06

Quote:
The code is straight out of the manual for BEAM / STREAK.

Posted By: Superku

Re: BEAM / STREAK - 07/09/10 20:17

...
Are you using lite-C or c-script?
The code in the german manual under BEAM/ STREAK is the following:

Code:
// Hilfsfunktion: setzt den Vektor auf Zufallsrichtung und -Länge
function vec_randomize(&vec,range)
{
  vec[0] = random(1) - 0.5;
  vec[1] = random(1) - 0.5;
  vec[2] = random(1) - 0.5;
  vec_normalize(vec,random(range));
} 		

// Hilfsfunktion: blendet einen Partikel aus
function part_alphafade()
{
  my.alpha -= time+time;
  if (my.alpha <= 0) { my.lifespan = 0; } // Alpha <= 0, dann Partikel vernichten
}

//Partikelfunktion: generiert eine verblassende Explosion in Richtung vel 
function effect_explo()
{
  vec_randomize(temp,10);
  vec_add(my.vel_x,temp);
  my.alpha = 25 + random(25);
  my.bmap = scatter_map;
  my.flare = on;
  my.bright = on;
  my.beam = on; //Partikel verschmieren
  my.move = on;
  my.function = part_alphafade; // ändere in eine kürzere, schnellerer Funktion
}
...
vec_scale(normal,10); // produziere eine Explosion in Richtung der Normalen
effect(effect_explo,1000,my.x,normal);



This one?
Posted By: draculaFactory

Re: BEAM / STREAK - 07/09/10 20:57

Lite-c, and yes that is the code, its the same. I didn't realize that you thought there may be a difference between the German manual and the English manual, but that is the code. It simply does not work, but as I've said, I have never had this problem before. BEAM and STREAK have always worked without error before.
Posted By: Superku

Re: BEAM / STREAK - 07/09/10 21:02

Yes, then there is the problem, the manual code is C-Script code. A lite-C particle effect should look somehow like the following code:

Code:
function eff_somerandomeffect(PARTICLE* p) {
	vec_add(p.x,vector(random(4)-2,0,random(4)-2));
	vec_add(p.vel_x,vector(random(2)-1,0,random(2)-1));
	set(p, MOVE | BRIGHT | BEAM);
	p.bmap = bmp_flame_circle32;
	p.alpha = 60+random(40);
	p.size = 16+random(4);
	p.event = eff_fadefunction;
}


Posted By: draculaFactory

Re: BEAM / STREAK - 07/09/10 22:37

Here's the thing: I tried it with my own code as well and it does not work either. I tried it with code from other projects of mine (code that I know works) and it still doesn't work. Yes that is c-script and no the answer is not that simple. I added BEAM and STREAK to other particles within the same project and they disappeared.

Code:
function p_alphafade(PARTICLE *p)
{
    p.alpha -= p.skill_a*time_step;
    if (p.alpha <= 0) p.lifespan = 0;
}

function p_trace(PARTICLE *p)
{
   set(p, BRIGHT|TRANSLUCENT|BEAM);
   p.size = 2;
   p.skill_a = 1; // fade factor
   p.event = p_alphafade;
}

// entity that runs in circles and leaves a vapor trail
action tracer()
{
   var dist = 0,radius = 10,sign = 1;
   VECTOR last_pos;
   while(1) 
   {
      vec_set(last_pos,my.x);
      dist += 30*time_step;
      radius += sign*random(3)*time_step; // change radius randomly
      if (radius > 150) sign = -1;
      else if (radius < 30) sign = 1;
      my.x = radius*sin(dist);
      my.y = radius*cos(dist);
      effect(p_trace,1,my.x,vec_sub(last_pos,my.x));
      wait(1);
   }
}

function main()
{
  vec_set(sky_color,vector(50,1,1)); // dark blue
  level_load(NULL);
  video_window(NULL,NULL,0,"Vapor trail demo");
  vec_set(camera.x,vector(-250,0,50));
  vec_set(camera.pan,vector(0,-15,0));

  ent_create(NULL,vector(0,0,0),tracer);  
}



This is from the manual, it does not work. Unless someone has an actual suggestion as to how to get BEAM and STREAK working, please don't waste my time asking the same basic questions that everyone knows about. It seems as of late, I have had nothing but problems with the engine. I have viewed other threads about similar situations and they usually end with no resolution grin
Posted By: Superku

Re: BEAM / STREAK - 07/09/10 22:56

Install the latest DirectX drivers (9.29) and give it a try.

EDIT:
"please don't waste my time asking the same basic questions that everyone knows about"

What do you mean by saying this, that I waste your time?!
Posted By: EvilSOB

Re: BEAM / STREAK - 07/09/10 22:57

Works perfectly for me, no changes required. (except including acknex.h)

Version A7.85.4 commercial.
Posted By: draculaFactory

Re: BEAM / STREAK - 07/10/10 01:09

The latest direct x drivers are installed, like I said it seems to be randomly working or not working based on whether or not a mouse farted in the past 15 minutes. Does camera angle have anything to do with this at all?
Posted By: draculaFactory

Re: BEAM / STREAK - 07/10/10 02:09

Just to let you know the sort of thing that I am talking about; just now I started up my project, deleted all the enemies placed around my level, then placed the same type of enemy around the level again, compiled it and it runs fine now; BEAM and STREAK work great.
Posted By: EvilSOB

Re: BEAM / STREAK - 07/11/10 02:25

Cant think of anything except if the camera is too close,
it may clip SOME of the particles, but some should remain...

Have you upgraded gamestudio above 7.07 yet?
It was a horribly buggy version...
© 2024 lite-C Forums