Gamestudio Links
Zorro Links
Newest Posts
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
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
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
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
K of H enemy level #126734
04/26/07 21:33
04/26/07 21:33
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
I'm known in my neighborhood as King Klutz Koder of Montana, the Head Wrangler of Empty Pointers.

So be forewarned.

I had hoped that someone who knew what they were doing would come forward with an
enemy code for David Lancaster's Kingdom of Hearts* tutorial and example level.
Nobody has, so I've cobbled up this melange of code and perhaps one of the
fine knowledgable coders frequenting this forum will develop it past its baby steps.

The original restrictions of David Lancaster's contribution still apply.

You can download either an exe file or the folder at Kingdom of Hearts Enemies approx. 13 MBs.

It's fun and it shows the possibilities.

If you fix a bug, find an improvement, or just want
to curse me, please write to: jazzdude-at-digisys-dot-net .

*to avoid trademark/copyright infringement

Last edited by JazzDude; 04/27/07 00:55.
Re: K of H enemy level [Re: JazzDude] #126735
04/27/07 18:59
04/27/07 18:59
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Thxn, this is really helpfull JazzDude
Great effort ^^

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] #126736
04/27/07 19:13
04/27/07 19:13
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Thanks, Frazzle--

I hope you can improve it.

Re: K of H enemy level [Re: JazzDude] #126737
04/27/07 22:50
04/27/07 22:50
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Bug fix for the enemy action posted on the download page.

Re: K of H enemy level [Re: JazzDude] #126738
04/28/07 15:58
04/28/07 15:58
Joined: Oct 2003
Posts: 206
N
nkl Offline
Member
nkl  Offline
Member
N

Joined: Oct 2003
Posts: 206
this is really helpfull JazzDude.
But I can not download the "Bug fix for the enemy action" posted on the download page.

Last edited by nkl; 04/28/07 15:59.
Re: K of H enemy level [Re: nkl] #126739
04/28/07 16:35
04/28/07 16:35
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Thanks for letting me know. I fixed it.

Re: K of H enemy level [Re: JazzDude] #126740
04/28/07 17:26
04/28/07 17:26
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Another little pointer bug fix:

Add the red correction to the this function:

Code:
FUNCTION handle_sword_collision 
{
you = null;
ent_vertex(my.weapon_tip, 54); // weapon tip vertex coords - get the value in Med
ent_vertex(my.weapon_base, 244); // weapon base vertex coords - get the value in Med
c_trace (my.weapon_base, my.weapon_tip, ignore_me | ignore_passable|use_box);
if (result != 0) && (you != null)
{
you.health -= 5;
IF (airborne_attack == 1 && my.animblend == attack_a)
{
my.movement_mode = 2;
}
IF (target_enemy == null)
{
target_enemy = you;
player_lock_on = 1;
}
}
}



Re: K of H enemy level [Re: JazzDude] #126741
04/29/07 09:36
04/29/07 09:36
Joined: Oct 2005
Posts: 528
Italy
M
Mondivirtuali Offline
User
Mondivirtuali  Offline
User
M

Joined: Oct 2005
Posts: 528
Italy
It is awesome.

Re: K of H enemy level [Re: Mondivirtuali] #126742
04/29/07 17:57
04/29/07 17:57
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
One bug I found out when I played around with the coded is the following line in the enemy his action of enemy.wdl:
Code:
 
// the bugs are situated in red UUB code.
ACTION enemy
{
you = player; // remove this line
my.shadow = on;
my.health = 100;
ent_create("club.mdl",my.x,attach_club);
my.enable_scan = 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);
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.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);
c_move(my,vector(5*time,0,0),my.move_x,use_aabb | ignore_passable | glide);
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)< 70)&& (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, 54); // weapon tip vertex coords - get the value in Med
ent_vertex(my.weapon_base, 244); // weapon base vertex coords - get the value in Med
c_trace (my.weapon_base, my.weapon_tip, ignore_me | ignore_passable|use_box);
if (result != 0) ///made a hit
{
player.health -= 1; // it causes an empty pointer situation if you place the you pointer so just replace it with player
hit_sound();
}
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)
{
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);
}
}

}



Another bug I found out is when you're dead, the player is still able to move around and kill the rest of the enemies ^^
Btw, this version uses the extra code that JazzDude edited later.

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] #126743
04/30/07 23:46
04/30/07 23:46
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Thanks, Frazzle,

Yes, that player keeps trying to rise up and carry on the fight. Also the health loss is multiple on each hit and goes into negative numbers.

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

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