Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 17,416 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
kindly convert this to C script please... #249181
01/31/09 19:34
01/31/09 19:34
Joined: Jan 2009
Posts: 33
Philippines, Quezon City
K
Kaizen_31 Offline OP
Newbie
Kaizen_31  Offline OP
Newbie
K

Joined: Jan 2009
Posts: 33
Philippines, Quezon City
action enemy_action()// attached to the dummy enemy that is sensitive to player's sword
{

my.healthpoints = 50; // give the enemies few health points - they'll die immediately
while (my.healthpoints > 0) // still alive?
{
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp); // rotate towards the player at all times
my.tilt = 0;
wait (1);
}
my.passable = on; // the corpse can't be hit by the sword from now on; the enemy is dead here
snd_play (dead_wav, 50, 0); // sword sound
while (my.skill10 < 99)
{
ent_animate(my, "death", my.skill10, null);
my.skill10 += 4 * time_step; // "death" animation speed
wait (1);
}
my.transparent = on;
my.alpha = 100;
while (my.alpha > 0)
{
my.alpha -= 4 * time_step;
wait (1);
}
ent_remove (my);
}

Re: kindly convert this to C script please... [Re: Kaizen_31] #249183
01/31/09 19:46
01/31/09 19:46
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
C-Script:
Code:
action enemy_action // attached to the dummy enemy that is sensitive to player's sword
{
	my.healthpoints = 50; // give the enemies few health points - they'll die immediately
	
	while (my.healthpoints > 0) // still alive?
	{
		vec_set(temp, player.x);
		vec_sub(temp, my.x);
		vec_to_angle(my.pan, temp); // rotate towards the player at all times
		my.tilt = 0;
		wait (1);
	}

	my.passable = on; // the corpse can't be hit by the sword from now on; the enemy is dead here
	snd_play (dead_wav, 50, 0); // sword sound
	
	while (my.skill10 < 99)
	{
		ent_animate(my, "death", my.skill10, null);
		my.skill10 += 4 * time_step; // "death" animation speed
		wait (1);
	}
	
	my.transparent = on;
	my.alpha = 100;
	
	while (my.alpha > 0)
	{
		my.alpha -= 4 * time_step;
		wait (1);
	}

	ent_remove (my);
}



Lite-C:
Code:
action enemy_action() // attached to the dummy enemy that is sensitive to player's sword
{
	my.healthpoints = 50; // give the enemies few health points - they'll die immediately
	
	while (my.healthpoints > 0) // still alive?
	{
		vec_set(temp, player.x);
		vec_sub(temp, my.x);
		vec_to_angle(my.pan, temp); // rotate towards the player at all times
		my.tilt = 0;
		wait (1);
	}

	set(my,PASSABLE); // the corpse can't be hit by the sword from now on; the enemy is dead here
	snd_play (dead_wav, 50, 0); // sword sound
	
	while (my.skill10 < 99)
	{
		ent_animate(my, "death", my.skill10, NULL);
		my.skill10 += 4 * time_step; // "death" animation speed
		wait (1);
	}
	
	set(my,TRANSLUCENT);
	my.alpha = 100;
	
	while (my.alpha > 0)
	{
		my.alpha -= 4 * time_step;
		wait (1);
	}

	ent_remove (my);
}


Last edited by Xarthor; 01/31/09 19:47.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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