Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Aku_Aku, 7th_zorro, Ayumi), 1,050 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 2 of 7 1 2 3 4 5 6 7
Re: Kingdom Hearts Movement Tutorial [Re: Orange Brat] #86289
08/16/06 08:53
08/16/06 08:53
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
I have found one inconsistency in the scripting. You use c_move and c_scan, but in the player.wdl all of your traces are old trace. I converted over to c_trace and used the same trace modes, but it made the player hover way up in the air for whatever reason. Actually, one of the traces doesn't have a movement mode, so perhaps that's the problem.

EDIT: I see it's in the docs...I'll play with it a bit and see what I can come up with.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Kingdom Hearts Movement Tutorial [Re: Orange Brat] #86290
08/16/06 09:08
08/16/06 09:08
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline OP
User
DavidLancaster  Offline OP
User

Joined: Nov 2004
Posts: 862
Australia
I pointed that out in the documentation, I attempted to use c_trace and simply couldn't get it to work, perhaps because of my inexperience with the instruction, if you can figure out how to get it working please let me know.

Re: Kingdom Hearts Movement Tutorial [Re: DavidLancaster] #86291
08/16/06 09:19
08/16/06 09:19
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline

Serious User
TWO  Offline

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Wow, I never tuched a tutorial, but yours will be the first one *downloading*

Re: Kingdom Hearts Movement Tutorial [Re: Orange Brat] #86292
08/16/06 09:59
08/16/06 09:59
Joined: Jan 2005
Posts: 79
T
taipan Offline
Junior Member
taipan  Offline
Junior Member
T

Joined: Jan 2005
Posts: 79
i heard theres a new religion, axysphenomenism super great contrib for the community


- A 3D world can be flawless...I want to live there
Re: Kingdom Hearts Movement Tutorial [Re: taipan] #86293
08/16/06 10:18
08/16/06 10:18
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Here's a small contrib to the camera. It's the alpha fade from the new templates. Simply add this to the end of the handle_camera function. Also, you can use c_trace in that function without any problems as long as enable_polycollision is greater than 0.5. When the next version of 3DGS is released, this limitation will be lifted(see beta page), and you'll be able to use 0 or 0.5 with trace_hit/c_trace(properly).

Code:

var fade_toggle = 1; //0 = off; 1 = on
var fade_start = 90;
var fade_end = 60;
var temp3[3];

if(fade_toggle == 1)
{
vec_diff(temp.x, my.x, camera.x);
if(fade_start > 0)
{
temp3.x = vec_length(temp.x); // distance from camera to target
if(temp3.x < fade_start)
{
my.transparent = on; // fade to zero depending distance to fade end
player_weapon.transparent = on;
my.shadow = off;
player_weapon.shadow = off;
//NOTE: use 1st max to avoid negative alpha
//use 2nd max to avoid divide by zero
my.alpha = 100 * max(0, ((temp3.x - fade_end) / max(1,(fade_start - fade_end))));
player_weapon.alpha = my.alpha;
}
else
{
my.transparent = off;
player_weapon.transparent = off;
my.shadow = on;
player_weapon.shadow = on;
}
}
}




My User Contributions master list - my initial post links are down but scroll down page to find list to active links
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 Offline
Serious User
JetpackMonkey  Offline
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 Offline
Senior Developer
TheExpert  Offline
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: TheExpert] #86296
08/20/06 13:04
08/20/06 13:04
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline OP
User
DavidLancaster  Offline OP
User

Joined: Nov 2004
Posts: 862
Australia
Good suggestion jetpack, I'll make those changes as soon I can. I'm glad this tutorial has turned out to be useful, thanks for everyones' comments

Re: Kingdom Hearts Movement Tutorial [Re: DavidLancaster] #86297
09/05/06 06:30
09/05/06 06:30
Joined: Oct 2003
Posts: 206
N
nkl Offline
Member
nkl  Offline
Member
N

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.

Re: Kingdom Hearts Movement Tutorial [Re: Orange Brat] #86298
09/06/06 21:58
09/06/06 21:58
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline
Expert
Locoweed  Offline
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Sweet! Great stuff.

Loco


Professional A8.30
Spoils of War - East Coast Games
Page 2 of 7 1 2 3 4 5 6 7

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