Gamestudio Links
Zorro Links
Newest Posts
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
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 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
change blue Vector in Particle event #458845
04/02/16 17:24
04/02/16 17:24
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
Hello,
How can I change the blue Vector in Particle event in his lifespawn time?

Re: change blue Vector in Particle event [Re: CocaCola] #458846
04/02/16 17:33
04/02/16 17:33
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I just assign blank white bmap (8x8 - png) to particle and change it's 'p.blue' in particle event, that's all.


Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: change blue Vector in Particle event [Re: 3run] #458847
04/02/16 17:42
04/02/16 17:42
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
maby I make something wrong, but it doesenīt work. Itīs a white picture and this code
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <particles.c>
///////////////////////////////
function p_alphafade(PARTICLE *p)
{
	p.alpha -= p.skill_a*time_step;
	if (p.alpha <= 80)vec_set(p.blue,vector(0,55,255));
	if (p.alpha <= 55)vec_set(p.blue,vector(0,0,55));
	if (p.alpha <= 25)vec_set(p.blue,vector(0,0,0));
	if (p.alpha <= 0)	p.lifespan = 0;
}
function spriteraketeexpfunc(ENTITY* p){
	VECTOR vTemp;
	vec_randomize(vTemp,1);
	vec_add(p._VEL_X,vTemp);
	vec_set(p.blue,vector(15,255,255));
	set(p, _MOVE  | TRANSLUCENT);
	p.alpha = 100;
	p._SIZE = 2;
	p._GRAVITY = 0.2;
	p._FADE = 3;  // fade factor
	p.event = p_fade_sprite;	
}
function spriteraketefly(){
	var numberp=10;
	VECTOR temp;
	while(1){
		if(key_space){
			vec_set(temp.x,vector(0.2,0,0));
			effect_sprite ("wolke.tga",spriteraketeexpfunc,10 ,my.x , temp.x);
		}
		wait(1);
	}
}
function main()
{
	video_window(NULL,NULL,0,"My New Game");
	d3d_antialias = 9;
	shadow_stencil = 0;
	level_load(NULL);
	vec_set(camera.x,vector(0,0,70));
	vec_set(camera.pan,vector(0,-90,0));
	ent_create("rakete1.mdl",nullvector,spriteraketefly);
}


Last edited by CocaCola; 04/02/16 17:44.
Re: change blue Vector in Particle event [Re: CocaCola] #458848
04/02/16 18:01
04/02/16 18:01
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I see you are using 'sprites', so this is something completely different (sprites are not particles, they only mimic them)! As far as I remember, you need to set LIGHT flag on to change the colors of models and sprites, give it a try.

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: change blue Vector in Particle event [Re: 3run] #458849
04/02/16 19:12
04/02/16 19:12
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
thx, now I understand the mistake, but how I put a png to particle?
I think I create a particle withe the effect function, is it ok?

In the manual is it define in this case:
Code:
effect (function, var number, VECTOR* pos, VECTOR* vel)


I do not see the place for the png String.

Re: change blue Vector in Particle event [Re: CocaCola] #458850
04/02/16 19:32
04/02/16 19:32
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: CocaCola
I do not see the place for the png String.
You don't use String or anything like that, you don't need to 'place' png there.
I just wanted to say that I used a .png image file format (like .pcx, .tga, .dds etc) laugh

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: change blue Vector in Particle event [Re: 3run] #458851
04/02/16 19:46
04/02/16 19:46
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
I find many mistakes lice ENTITY not PARTICLE and wrong link.
No I understand that Praticles are only pointer laugh
Thx for the tip with the ambient=100;
now itīs works: the Particle is going be red
Code:
function exp_fade(ENTITY *p)
{
	p.alpha -= p.skill_b*time_step;
	p.blue -=p.skill_b*time_step;
	p.green -=p.skill_b*time_step;
	if (p.alpha <= 0)	p._LIFESPAN = 0;
}
function spriteraketeexpfunc(ENTITY* p){
	VECTOR vTemp;
	set(p,LIGHT); 
	p.ambient=100;  
	vec_randomize(vTemp,10);
	vec_add(p._VEL_X,vTemp);
	vec_set(p.blue,vector(0,0,0));
	set(p, _MOVE  | TRANSLUCENT);
	p.alpha = 100;
	p._SIZE = 2;
	p.skill_b=15;
	p._GRAVITY = 0.2;
	p._FADE = 1;  // fade factor
	p.event = exp_fade;	
}



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