Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,454 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: K of H enemy level [Re: JazzDude] #126744
05/01/07 11:46
05/01/07 11:46
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Hehe, thxn

Quote:


But I knew if I posted it somebody smarter than me would fix it.





This is very relative

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: K of H enemy level [Re: frazzle] #126745
05/02/07 22:25
05/02/07 22:25
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
In the ongoing effort to tweak this contribution, here's the solution to the negative health numbers:

Add the red text to this function.


Code:
FUNCTION handle_sword_collision 
{

you = null;
ent_vertex(my.weapon_tip, 1016); // weapon tip vertex coords - get the value in Med
ent_vertex(my.weapon_base, 1000); // weapon base vertex coords - get the value in Med
if(c_trace (my.weapon_base, my.weapon_tip, ignore_me | ignore_passable)!= 0)&& (you != null)
{
target_enemy.enemy_health -= 5;//*time_step;
if(target_enemy.enemy_health < 100)
{

target_enemy.enemy_health = max(target_enemy.enemy_health,0);
}


IF (airborne_attack == 1 && my.animblend == attack_a) {
my.movement_mode = 2;
}
IF (target_enemy == null)
{
target_enemy = you;
player_lock_on = 1;
}
}
}



In ACTION ENEMY, make this change:

Code:
ACTION enemy
{


my.shadow = on;
my.enemy_health = 100;
my.polygon = off;
my.passable = off;
wait(1);
vec_set(my.min_x, vector(-8,-12,-35)); //get amounts in MED from model
vec_set(my.max_x, vector(23,12,35));
my.narrow = on;
my.fat = on;
my.enable_scan = on;
my.enable_detect = on;
WHILE (1)
{
dying_dead();
IF (my.hit_by_player == 1)
{
my.move_x = player.move_x;
my.move_y = player.move_y;
my.move_z = player.move_z;
c_move(my,nullvector,my.move_x,use_aabb | ignore_passable | glide|use_box);
IF (player.animblend == blend || player.animblend < attack_a || my.animblend > attack_f) { my.hit_by_player = 0; }
}
IF (player.animblend >= stand && target_enemy == my && player_lock_on == 0) && (player.animblend < attack_a || player.animblend > attack_f) { target_enemy = null; }
IF (target_enemy == my && vec_dist(my.x,player.x) > 600) { target_enemy = null; }
wait(1);
while (my.enemy_health > 0) // as long as I'm alive
{
if (vec_dist (my.x, player.x) < 600)&& (player != null) // the player approaches the enemy
{
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp);
my.tilt = 0;
enemy_distance.x = 5 * time_step;
enemy_distance.y = 0;
enemy_distance.z = 0;
c_move(my,vector(5*time,0,0),my.move_x,use_aabb | ignore_passable | glide|use_box);
ent_animate(my,"walk", my.skill20,anm_cycle); // play walk frames animation
my.skill20 += 5 * time_step; // "walk" animation speed
if (vec_dist (my.x, player.x)< 45)&& (player != null) // if the player comes closer attack him
{
snd_play(club_snd,50,0);
my.skill21 = 0; // reset "attack" frames
while (my.skill21 < 100)&& (player != null)
{
ent_vertex(my.weapon_tip, 1016); // weapon tip vertex coords - get the value in Med
ent_vertex(my.weapon_base, 1000); // weapon base vertex coords - get the value in Med
if (c_trace (my.weapon_base, my.weapon_tip, ignore_me | ignore_passable) != 0)
{
if (you != null)
{ // if the player has hit an entity, decrease its health
player.health -= 2 * time_step;
}
if(player.health < 100){player.health = max(player.health,0);}
}
ent_animate(my,"attack", my.skill21,0); // play attack frames animation
my.skill21 += 2 * time_step; // "attack" animation speed
wait (1);
}

}
}
else // the player is farther away
{
if(player.health < 0)
{
// my.skill21 = 0;
proc_kill(4);
}
ent_animate(my,"stand", my.skill21,anm_cycle); // play stand frames animation
my.skill21 += 2 * time_step; // "stand" animation speed

}
wait (1);
}
}

}



Then add an equal sign to the death anim conditions in both the
FUNCTION handle_animation and the FUNCTION dying_dead

IF (my.health < = 0)
IF (my.enemy_health < = 0)

Re: K of H enemy level [Re: JazzDude] #126746
05/23/07 11:27
05/23/07 11:27
Joined: Sep 2006
Posts: 292
M
Mythran Offline
Member
Mythran  Offline
Member
M

Joined: Sep 2006
Posts: 292
Could you upload the entire code? I have tryed everything to make the code work but it still doesn't, i have noticed that there are some changes from the code in page one. The only time i almost made the code to work, when i entered the game my enemies dissapear... (maybe afraid of my great coding skills?)
I would be thankful if you upload the code.
Thanks in advance

Re: K of H enemy level [Re: JazzDude] #126747
05/23/07 19:00
05/23/07 19:00
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Thxn for this update JazzDude
Nice to see your still tweaking the code

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: K of H enemy level [Re: JazzDude] #126748
05/23/07 23:24
05/23/07 23:24
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Cool, thanx JazzDude, more code for me to learn from or plagarise

Page 2 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

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