Gamestudio Links
Zorro Links
Newest Posts
FXCM demo test failed
by qin. 01/13/26 02:32
Camera always moves upwards?
by NeoDumont. 01/12/26 09:39
Alpaca Plugin v1.5.2 Release
by kzhao. 01/11/26 13:42
Alpaca Plugin v1.4.0
by kzhao. 01/11/26 13:38
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (qin), 3,155 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
promfast, joe_kane, Namitha_NN, Syndrela, agasior
19190 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