Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
5 registered members (AbrahamR, wdlmaster, 7th_zorro, dr_panther, 1 invisible), 764 guests, and 5 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
Particle glitch #296630
11/02/09 06:05
11/02/09 06:05
Joined: Jan 2007
Posts: 25
California, USA
D
darksmaster923 Offline OP
Newbie
darksmaster923  Offline OP
Newbie
D

Joined: Jan 2007
Posts: 25
California, USA
For some reason, every time I move further away from my particle emitter, it moves farther away too. I have the tiger use
effect_local(p_blood, 200, me.x, normal);
but, it comes out like this
http://img101.imageshack.us/img101/6803/22294948.png

Where it looks like it is behind the tiger, and as I go farther away it goes farther behind the tiger


I'm pretty awesome
Re: Particle glitch [Re: darksmaster923] #296635
11/02/09 07:50
11/02/09 07:50
Joined: Mar 2009
Posts: 88
Walori Offline
Junior Member
Walori  Offline
Junior Member

Joined: Mar 2009
Posts: 88
Well do you want it to be below the tiger? Then you should change

Code:
effect_local(p_blood, 200, me.x, normal);



to:

Code:
effect_local(p_blood, 200,vector( me.x,me.y,me.z), normal);


Because if you take only X the particle is made only to the X coord of entity, and if you'd need it to be below then you'd need at least Y coord (Z is also adviced) hope that made an y sence


EDIT: I stand corrected

Last edited by Walori; 11/02/09 15:55.
Re: Particle glitch [Re: Walori] #296659
11/02/09 10:42
11/02/09 10:42
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
@Walori:
you are false, if the compiler expect a vector and you only whrite my.x,the compiler takes my.y,my.z automatically for the vector!!!
(the same if you use my.pan (tilt,roll), my.blue (green,red)...)
so effect_local(p_blood, 200, me.x, normal); is right !!!

@darkmaster:
you are sure that the me-pointer is pointing to the tiger?
If yes, post your particlefunction for more help...

Last edited by Widi; 11/02/09 10:55.
Re: Particle glitch [Re: Widi] #296800
11/03/09 03:30
11/03/09 03:30
Joined: Jan 2007
Posts: 25
California, USA
D
darksmaster923 Offline OP
Newbie
darksmaster923  Offline OP
Newbie
D

Joined: Jan 2007
Posts: 25
California, USA
The particle function
Code:
BMAP* blood_particle ="blood.tga";

function vec_randomize (VECTOR* vec, var range)
{
   vec_set(vec,vector(random(1)-0.5,random(1)-0.5,random(1)-0.5));
   vec_normalize(vec,random(range));
}
function p_alphafade(PARTICLE *p)
{
    p.alpha -= p.skill_a*time_step;
    if (p.alpha <= 0) p.lifespan = 0;
}
function p_blood(PARTICLE* p)
{
   VECTOR vTemp;
   vec_randomize(vTemp,2);
   vec_add(p.vel_x,vTemp);
   vec_set(p.blue,vector(random(255),random(255),255));
   set(p, MOVE | BRIGHT | TRANSLUCENT);
   p.alpha = 100;
   p.size = 2;
   p.gravity = 0.2;
   p.skill_a = 3; // fade factor
   p.event = p_alphafade;
}



The tiger function
Code:
function got_shot()
{
	effect_local(p_blood, 200, me.x, normal);
	//ptr_remove(me);
}
action test()
{
	var scale=0.2;
	VECTOR temp[3];
	var speed=3;
	me.material=mat_metal;
	me.scale_x=scale;
	me.scale_y=scale;
	me.scale_z=scale;
	me.emask= ENABLE_IMPACT;
	my.event=got_shot;
	c_setminmax(me);
	set(me,POLYGON);
	set(me,SHADOW);
	while(1)
	{
		vec_set(temp,camera.x); 
		vec_sub(temp,my.x); 
  		vec_to_angle(me.pan,temp); 
  		got_shot();
  		c_move(me,nullvector,vector(0,0,-speed),IGNORE_PASSABLE|GLIDE);
  		if(vec_dist(me.x,camera.x)<20)
  		{
			c_move(me,vector(-speed,0,0),nullvector,IGNORE_PASSABLE|GLIDE);
		}
		wait(1);
	}
}




I'm pretty awesome
Re: Particle glitch [Re: darksmaster923] #297474
11/07/09 18:57
11/07/09 18:57
Joined: Jan 2007
Posts: 25
California, USA
D
darksmaster923 Offline OP
Newbie
darksmaster923  Offline OP
Newbie
D

Joined: Jan 2007
Posts: 25
California, USA
bump?


I'm pretty awesome

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