Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 730 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: enemy following a path [Re: Vyse220] #225735
09/05/08 21:38
09/05/08 21:38
Joined: Jun 2008
Posts: 428
Rasch Offline
Senior Member
Rasch  Offline
Senior Member

Joined: Jun 2008
Posts: 428
Maybe it works with that code. I think i would do it another way

Code:
function destroy_them
{
	if (event_type == EVENT_ENTITY) 
	{
		if (you.skill40 == 99) // a ship was hit?
		{
			score_value += 100; // get 100 points for a ship
			my.skill10 = 0;
			effect(particles_explo2, 30, my.x, nullvector);
			wait(1)
			ent_remove(me);
		}
		else
		{
			if(my.skill40 = 1)
			{
				my.skill10 = 0;
				effect(particles_explo2, 30, my.x, nullvector);
				wait(1)
				ent_remove(me);
			}
		}
	}  
}

action enemy_follow_path
{
	var dist = 0; // entity walk speed
	var LastPos[3];
	var Dir[3];
	
	while (player == null) {wait (1);}
	
	my.z = player.z;
	my.ENABLE_ENTITY = on;
	my.event = destroy_them;
	
	my.skill40 = 1;
	my.skill10 = 1;
	
	path_set(my, "path_002"); //he name of your path set in WED

	while(my.skill10 == 1)
	{
		path_spline(me,my.x,dist); // spline curve for smooth walking
		dist += 12*time_step; // change this to change the walk speed
		c_move(me,vector(1*time_step,0,0),nullvector,IGNORE_YOU); // this is for collision but you donīt need
		vec_diff(Dir,my.x,LastPos);
		vec_to_angle(my.pan,Dir);
		vec_set(LastPos,my.x);
		my.MOVEMENT_SPEED += 10 * time_step;

		wait(1);
	}
}


Hereīs a example of the code!

> Click Here <

Re: enemy following a path [Re: Rasch] #227717
09/15/08 20:55
09/15/08 20:55
Joined: Aug 2008
Posts: 49
V
Vyse220 Offline OP
Newbie
Vyse220  Offline OP
Newbie
V

Joined: Aug 2008
Posts: 49
tryed with that code, but it doesn't work, the bullet don't touch the enemy seems like it's passable (but passable == off)
Don't know what the problem, i'm gonna get crazy Oo

Re: enemy following a path [Re: Vyse220] #228469
09/19/08 18:32
09/19/08 18:32
Joined: Aug 2008
Posts: 49
V
Vyse220 Offline OP
Newbie
Vyse220  Offline OP
Newbie
V

Joined: Aug 2008
Posts: 49
sorry the double post, but no one can help me?
i really don't know what's the problem

Page 2 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