|
Re: Kingdom Hearts Movement Tutorial
[Re: Orange Brat]
#86294
08/16/06 14:09
08/16/06 14:09
|
Joined: Nov 2003
Posts: 1,659 San Francisco
JetpackMonkey
Serious User
|
Serious User
Joined: Nov 2003
Posts: 1,659
San Francisco
|
wow!! awesome, easy to read and very complete tutorial! though movement scripting isn't really my forte, this tutorial will be very useful for learning about how it all works. I'd make a little recommendation to make it more readable, though-- switch magic numbers with some more readable defines.. like jumping_mode = 0 or 1 or 2, could be replaced with define not_jumping, 0 define jump_upwards, 1 define jump_coming_down, 2 so jumping_mode = not_jumping etc! magic numbers always make me confused 
|
|
|
Re: Kingdom Hearts Movement Tutorial
[Re: Orange Brat]
#86295
08/20/06 10:59
08/20/06 10:59
|
Joined: Oct 2004
Posts: 1,856
TheExpert
Senior Developer
|
Senior Developer
Joined: Oct 2004
Posts: 1,856
|
I've tried it your script : it's pretty damn good : fantastic  it will deserve to be in the 3DGS official package with teh script of the ninja  thanks a lot for sharing 
|
|
|
Re: Kingdom Hearts Movement Tutorial
[Re: DavidLancaster]
#86297
09/05/06 06:30
09/05/06 06:30
|
Joined: Oct 2003
Posts: 206
nkl
Member
|
Member
Joined: Oct 2003
Posts: 206
|
Hi DavidLancaster I study your tutorial. This is a very excellent tutorial. I want to add enemy pain effect and player climb ladder effect. I add following code in the player.wdl Code:
DEFINE pain,12; DEFINE knockdown,13; DEFINE ladder, 14;
I add the pain animation and climb ladder animation in the animation.wdl Code:
FUNCTION handle_animation(animation_speed) { IF (animation_speed <= 0) { animation_speed = 1; } IF (my.animblend != blend && my.blendframe != nullframe) { my.animate2 = 0; my.animblend = blend; } IF (my.animblend == blend) { IF (my.currentframe == stand) { ent_animate(my,"stand",my.animate,anm_cycle); } IF (my.currentframe == run) { ent_animate(my,"run",my.animate,anm_cycle); } IF (my.currentframe == walk) { ent_animate(my,"walk",my.animate,anm_cycle); } IF (my.currentframe == jump) { ent_animate(my,"jump",my.animate,0); } IF (my.currentframe == attack_a) { ent_animate(my,"attack_a",my.animate,0); } IF (my.currentframe == attack_b) { ent_animate(my,"attack_b",my.animate,0); } IF (my.currentframe == attack_c) { ent_animate(my,"attack_c",my.animate,0); } IF (my.currentframe == attack_d) { ent_animate(my,"attack_d",my.animate,0); } IF (my.currentframe == attack_e) { ent_animate(my,"attack_e",my.animate,0); } IF (my.currentframe == attack_f) { ent_animate(my,"attack_f",my.animate,0); } IF (my.blendframe == stand) { ent_blend("stand",0,my.animate2); } IF (my.blendframe == run) { ent_blend("run",0,my.animate2); } IF (my.blendframe == walk) { ent_blend("walk",0,my.animate2); } IF (my.blendframe == jump) { ent_blend("jump",0,my.animate2); } IF (my.blendframe == fall) { ent_blend("jump",60,my.animate2); } IF (my.blendframe == attack_a) { ent_blend("attack_a",0,my.animate2); } IF (my.blendframe == attack_b) { ent_blend("attack_b",0,my.animate2); } IF (my.blendframe == attack_c) { ent_blend("attack_c",0,my.animate2); } IF (my.blendframe == attack_d) { ent_blend("attack_d",0,my.animate2); } IF (my.blendframe == attack_e) { ent_blend("attack_e",0,my.animate2); } IF (my.blendframe == attack_f) { ent_blend("attack_f",0,my.animate2); } // ****************** // ****************** add new code IF (my.blendframe == pain) { ent_blend("pain",0,my.animate2); } IF (my.blendframe == knockdown) { ent_blend("knockdown",0,my.animate2); } IF (my.blendframe == ladder) { ent_blend("ladder",0,my.animate2); } // ****************** end add new code // ******************
my.animate2 += 45 * time; IF (my.animate2 >= 100) { my.animate = 0; my.animblend = my.blendframe; my.blendframe = nullframe; } } // ****************** // ****************** add new code IF (my.animblend == pain) { ent_animate(my,"pain",my.animate,anm_cycle); my.animate += 5 * animation_speed * time; my.animate %= 100; my.currentframe = pain; } IF (my.animblend == knockdown) { ent_animate(my,"knockdown",my.animate,anm_cycle); my.animate += 5 * animation_speed * time; my.animate %= 100; my.currentframe = knockdown; } IF (my.animblend == ladder) { ent_animate(my,"ladder",my.animate,anm_cycle); my.animate += 5 * animation_speed * time; my.animate %= 100; my.currentframe = ladder; } // ****************** end add new code // ****************** IF (my.animblend == stand) { ent_animate(my,"stand",my.animate,anm_cycle); my.animate += 5 * animation_speed * time; my.animate %= 100; my.currentframe = stand; } IF (my.animblend == run) { ent_animate(my,"run",my.animate,anm_cycle); my.animate += 8 * animation_speed * time; my.animate %= 100; my.currentframe = run; } IF (my.animblend == walk) { ent_animate(my,"walk",my.animate,anm_cycle); my.animate += 8 * animation_speed * time; my.animate %= 100; my.currentframe = walk; } IF (my.animblend == jump || my.animblend == fall) { IF (my.jumping_mode == 3) { my.animate = 60; } ent_animate(my,"jump",my.animate,0); my.animate += 10 * animation_speed * time; my.currentframe = jump; IF (my.animate >= 60 && my.jumping_mode == 1) { my.jumping_mode = 2; } IF (my.animate >= 100) { ent_animate(my,"jump",100,0); my.animate = 100; my.blendframe = stand; IF (my.moving == 1) { IF (key_shift == 1) { my.blendframe = walk; } ELSE { my.blendframe = run; } } } } IF (my.animblend == attack_a) { ent_animate(my,"attack_a",my.animate,0); my.animate += 20 * animation_speed * time; my.currentframe = attack_a; IF (my.animate >= 100) { ent_animate(my,"attack_a",100,0); my.animate = 100; my.blendframe = stand; IF (my.moving == 1) { IF (key_shift == 1) { my.blendframe = walk; } ELSE { my.blendframe = run; } } IF (combo_continue == 1) { combo_continue = 0; my.blendframe = attack_b; } ELSE { my.movement_mode = 0; } } } IF (my.animblend == attack_b) { ent_animate(my,"attack_b",my.animate,0); my.animate += 15 * animation_speed * time; my.currentframe = attack_b; IF (my.animate >= 100) { ent_animate(my,"attack_b",100,0); my.animate = 100; my.blendframe = stand; IF (my.moving == 1) { IF (key_shift == 1) { my.blendframe = walk; } ELSE { my.blendframe = run; } } IF (combo_continue == 1) { combo_continue = 0; my.blendframe = attack_c; } ELSE { my.movement_mode = 0; } } } IF (my.animblend == attack_c) { ent_animate(my,"attack_c",my.animate,0); my.animate += 10 * animation_speed * time; my.currentframe = attack_c; IF (my.animate >= 100) { ent_animate(my,"attack_c",100,0); my.animate = 100; my.blendframe = stand; IF (my.moving == 1) { IF (key_shift == 1) { my.blendframe = walk; } ELSE { my.blendframe = run; } } IF (combo_continue == 1) { my.jumping_mode = 10; my.force_z = 12; my.gravity = 4; combo_continue = 0; my.blendframe = attack_d; } ELSE { my.movement_mode = 0; } } } IF (my.animblend == attack_d) { handle_sword_collision(); ent_animate(my,"attack_d",my.animate,0); my.animate += 15 * animation_speed * time; my.currentframe = attack_d; IF (my.animate >= 100) { ent_animate(my,"attack_d",100,0); my.animate = 100; my.blendframe = stand; IF (my.moving == 1) { IF (key_shift == 1) { my.blendframe = walk; } ELSE { my.blendframe = run; } } IF (combo_continue == 1) { combo_continue = 0; my.blendframe = attack_e; } ELSE { my.movement_mode = 0; } } } IF (my.animblend == attack_e) { ent_animate(my,"attack_e",my.animate,0); my.animate += 15 * animation_speed * time; my.currentframe = attack_e; IF (my.jumping_mode == 0 && my.animate >= 20 && my.animate < 60) { my.gravity = 3; my.jumping_mode = 10; my.force_z = 15; } IF (my.animate >= 100) { ent_animate(my,"attack_e",100,0); my.animate = 100; my.blendframe = stand; IF (my.moving == 1) { IF (key_shift == 1) { my.blendframe = walk; } ELSE { my.blendframe = run; } } IF (combo_continue == 1) { combo_continue = 0; my.blendframe = attack_f; } ELSE { my.movement_mode = 0; } } } IF (my.animblend == attack_f) { ent_animate(my,"attack_f",my.animate,0); my.animate += 6 * animation_speed * time; my.currentframe = attack_f; IF (my.jumping_mode == 0 && my.animate >= 40 && my.animate < 60) { my.gravity = 6; my.jumping_mode = 10; my.force_z = 12; } IF (my.animate >= 100) { my.movement_mode = 0; ent_animate(my,"attack_f",100,0); my.animate = 100; my.blendframe = stand; IF (my.moving == 1) { IF (key_shift == 1) { my.blendframe = walk; } ELSE { my.blendframe = run; } } } } IF (my.animblend >= attack_a && my.animblend <= attack_f) { handle_sword_collision(); } IF (my.animblend != blend && my.blendframe != nullframe) { my.animate2 = 0; my.animblend = blend; } }
How do I add enemy pain effect and player climb ladder effect? Thanks for any advice. Thanks already.
|
|
|
|