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, degenerate_762), 1,309 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Can you help me with this function? #255175
03/08/09 12:12
03/08/09 12:12
Joined: Aug 2008
Posts: 49
V
Vyse220 Offline OP
Newbie
Vyse220  Offline OP
Newbie
V

Joined: Aug 2008
Posts: 49
The idea is that when an enemy is killed, a flow of particles moves from the destroyed enemy to the player.
Code:
function move_power(){
	my.passable = on;
	my.size = 0.1;
	var c;
	while(vec_dist(me, player) > 10 && my. x > -200){
		ent_move(vector(-10, 0, 0), vector(-5, 0, 0));
		c = random(360);
		effect (minpart, 10, my.x, nullvector);
		wait(1);
		if(my.z < player.z){
			my.z += 5;
		}
		if(my.y > player.y){
			my.pan += 4;
			my.y -= 5;
		}
		else{
			my.pan -= 4;
			my.y += 5;
		}
	}
	ent_create("glow.tga", vector(player.x, player.y, player.z - 80), explosion_ring1);
	ent_remove(me);
}

I've done it with this code, but it isn't good, the movement is not good.
Can you help me to do something better? I've used particles, but i would like to use the "beam effect".
This is a demostration of my work as you can see, the movemen't isn't "smooth".

Last edited by Vyse220; 03/08/09 12:13.
Re: Can you help me with this function? [Re: Vyse220] #255266
03/09/09 08:50
03/09/09 08:50
Joined: Jan 2009
Posts: 86
Brasil - RS
D
DiegoFloor Offline
Junior Member
DiegoFloor  Offline
Junior Member
D

Joined: Jan 2009
Posts: 86
Brasil - RS
Hello!

First of all, I still don't know anything about particles, so if I say something that doesn't make any sense jsut ognore laugh But aesthetically maybe I can help.

My first impression was that the particles were in a perfect line and all of the same size. A few patterns I can think of:
-Make the first one bigger and the following gradually smaller (with random oscilations);
-Also, change the opacity so that the last ones on the line are barely visible (making the opacity oscilate a little could work too)

Also, you can try to make additional layers of particles to achieve some sort of glow effect. Or even sparkles leaving the main trail in random directions.

I'm about to start playing around with particles too.. isn't there some sort of particle editor? it's hard to come up with something visually appealing only with coding.

Re: Can you help me with this function? [Re: DiegoFloor] #255301
03/09/09 12:56
03/09/09 12:56
Joined: Aug 2008
Posts: 49
V
Vyse220 Offline OP
Newbie
Vyse220  Offline OP
Newbie
V

Joined: Aug 2008
Posts: 49
Originally Posted By: DiegoFloor
Hello!

First of all, I still don't know anything about particles, so if I say something that doesn't make any sense jsut ognore laugh But aesthetically maybe I can help.

My first impression was that the particles were in a perfect line and all of the same size. A few patterns I can think of:
-Make the first one bigger and the following gradually smaller (with random oscilations);
-Also, change the opacity so that the last ones on the line are barely visible (making the opacity oscilate a little could work too)

Also, you can try to make additional layers of particles to achieve some sort of glow effect. Or even sparkles leaving the main trail in random directions.

I'm about to start playing around with particles too.. isn't there some sort of particle editor? it's hard to come up with something visually appealing only with coding.


I remember a tool that was in the site, something that show in real time the particles and instead put the velocity, the size and other proprieties.
It can be really usefull.

However my problem is't the particle, but the movement of them, thx for the help.

Re: Can you help me with this function? [Re: Vyse220] #255314
03/09/09 14:20
03/09/09 14:20
Joined: Nov 2008
Posts: 215
V
vertex Offline
Member
vertex  Offline
Member
V

Joined: Nov 2008
Posts: 215
I know this might not help for a variable/dynamic particle method-- but nonetheless: a great tool for particles for Gamestudio:

http://www.easyparticle.com/

developed by:
Timo Stark, Martin Teichmann



Last edited by vertex; 03/09/09 14:32.
Re: Can you help me with this function? [Re: vertex] #255318
03/09/09 15:06
03/09/09 15:06
Joined: Apr 2008
Posts: 437
dracula Offline
Senior Member
dracula  Offline
Senior Member

Joined: Apr 2008
Posts: 437
Does Easy Particle only produce C- Script code and not Lite-C ?

The interface looks superb

thanks

Re: Can you help me with this function? [Re: dracula] #255335
03/09/09 17:12
03/09/09 17:12
Joined: Nov 2008
Posts: 215
V
vertex Offline
Member
vertex  Offline
Member
V

Joined: Nov 2008
Posts: 215
This is a remake of Easy Particle done by Tobias and is referenced in the Lite-C contribution area.

It outputs Lite-C.

Tobias' lite-C conversion of Easy Particle

Re: Can you help me with this function? [Re: vertex] #255627
03/11/09 15:58
03/11/09 15:58
Joined: Aug 2008
Posts: 49
V
Vyse220 Offline OP
Newbie
Vyse220  Offline OP
Newbie
V

Joined: Aug 2008
Posts: 49
I still can't understeand how I can do this sorta of parabolic movement, someone have an idea? can help me?

Re: Can you help me with this function? [Re: Vyse220] #255677
03/11/09 20:29
03/11/09 20:29
Joined: Jan 2009
Posts: 86
Brasil - RS
D
DiegoFloor Offline
Junior Member
DiegoFloor  Offline
Junior Member
D

Joined: Jan 2009
Posts: 86
Brasil - RS
Ooh! You want a better trajectory? is that it?

You can achieve "some sort" of parabolic movement simply by making the velocity vector of the particle always pointing at the player. To give it a little more movement, make the velocity vector's amplitude increase gradually, this way the particle will "fall" a little (to the bottom of the screen) before gaining velocity towards the player. (This is known as the predator-prey model)

Another possibility is to make the player something like a sun and the particle a tiny planet. Of course, you're not using the physics system, so you have to code this interaction yourself. But it's not difficult! Basically, you have to make tiny incremente to the particle's velocity towards the player per time unit (it's slightly different from the first approach). To make this solution more like a sun-planet system, make the increment increase with the distance to the player.

I don't know squat about coding particles, but at least I know a little about physics laugh yay


edit: ...make the increment decrease with the distance... Because we want the particle to get more accelerated as it gets closer to the player.

Last edited by DiegoFloor; 03/11/09 20:33.
Re: Can you help me with this function? [Re: DiegoFloor] #255828
03/12/09 20:55
03/12/09 20:55
Joined: Aug 2008
Posts: 49
V
Vyse220 Offline OP
Newbie
Vyse220  Offline OP
Newbie
V

Joined: Aug 2008
Posts: 49
Quote:
You can achieve "some sort" of parabolic movement simply by making the velocity vector of the particle always pointing at the player. To give it a little more movement, make the velocity vector's amplitude increase gradually, this way the particle will "fall" a little (to the bottom of the screen) before gaining velocity towards the player. (This is known as the predator-prey model)

Thx for it, but can you explane me how to set a vector from the destroyed enemy to the player and move one object towards it please?

Re: Can you help me with this function? [Re: Vyse220] #255833
03/12/09 21:32
03/12/09 21:32
Joined: Jan 2009
Posts: 86
Brasil - RS
D
DiegoFloor Offline
Junior Member
DiegoFloor  Offline
Junior Member
D

Joined: Jan 2009
Posts: 86
Brasil - RS
You 'ent_removed' the enemy, of course. But do you need the enemy position for that? I thought that trail of particles was some sort of new entity, and we had to use the head of it as the position. You're supposed to work with the particle's velocity.

Page 1 of 2 1 2

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