2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Whats Normal About "Action Command"
[Re: MrCode]
#139358
07/03/07 22:16
07/03/07 22:16
|
Joined: Feb 2006
Posts: 126 USA,
manic7creations
OP
Member
|
OP
Member
Joined: Feb 2006
Posts: 126
USA,
|
Does my model post to do any kind of animations with this code or not, But my character moves and is animated the whole time with the code below. I have 3DGS 6.6V. Or is there a bug in 3DGS? or Whats What?
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
var video_mode = 7; // 800x600 pixels var video_depth = 32; // 32 bit mode
////////////////////////////////////////////////////////////////////
string W1_wmb = <W1.wmb>;
////////////////////////////////////////////////////////////////////
function main() { fps_max = 30; level_load (W1_wmb); wait (3); camera.x = -12; //set a static position for the camera camera.y = 740; camera.z = -2361; camera.pan = 90; // set the correct orientation for the camera camera.tilt = -20; // using its pan and tilt angles }
action cbabe { my.fat = off; // the first 3 lines of code my.narrow = off; // enable the new c_setminmax(my); // collision detection system used by A6.2 or newer versions while (1) { // move the car using absolute_speed if (key_cuu == on) // press and hold the "Up" arrow key to move the car { c_move(my, nullvector, vector(0, 4, 0), glide); camera.y += 500; } if (key_cud == on) // press and hold the "Down" arrow key to move the car { c_move(my, nullvector, vector(0, -4, 0), glide); camera.y -= 500; } if (key_cul == on) // press and hold the "Left" arrow key to move the car { c_move(my, nullvector, vector(-4, 0, 0), glide); camera.x -= 1; } if (key_cur == on)// press and hold the "Right" arrow key to move the car { c_move(my, nullvector, vector(4, 0, 0), glide); camera.x += 1; } //rightr if (key_d == on) { my.pan += 1; // increase the pan angle of the car } if (key_a == on) { my.pan -= 1; // decrease the pan angle of the car } if (key_space == on) // press and hold the "Space" key to move the car { c_move (my, vector(4, 0, 0), nullvector, glide); } wait (1); } }
//////////////////////////////////////////////////////////////////////////
Last edited by manic7creations; 07/03/07 22:18.
|
|
|
Re: Whats Normal About "Action Command"
[Re: Joey]
#139360
07/03/07 23:09
07/03/07 23:09
|
Joined: Feb 2006
Posts: 126 USA,
manic7creations
OP
Member
|
OP
Member
Joined: Feb 2006
Posts: 126
USA,
|
Joey, My model does have animations with the code, "but does it post to" with to code sample I provided. I thought you have to program them individual actions individualy right????????????
Last edited by manic7creations; 07/03/07 23:10.
|
|
|
Re: Whats Normal About "Action Command"
[Re: Joey]
#139362
07/04/07 01:23
07/04/07 01:23
|
Joined: Feb 2006
Posts: 126 USA,
manic7creations
OP
Member
|
OP
Member
Joined: Feb 2006
Posts: 126
USA,
|
"your code doesn't animate the model, if that's what you're asking for. normally you have to write code for it, that's also correct"
That is what I am looking for out of you.
Last edited by manic7creations; 07/04/07 01:25.
|
|
|
Re: Whats Normal About "Action Command"
[Re: manic7creations]
#139363
07/04/07 01:40
07/04/07 01:40
|
Joined: Mar 2007
Posts: 677 0x00000USA
MrCode
User
|
User
Joined: Mar 2007
Posts: 677
0x00000USA
|
Code:
var walk_speed; var breath_speed; var jump_speed;
...
if(key_cuu== on) { c_move(my,vector(6 * time_step,0,0),nullvector,glide); ent_animate(my,"walk",walk_speed,anm_cycle); walk_speed+= 7 * time_step; } else { ent_animate(my,"stand",breath_speed,anm_cycle); breath_speed+= 3 * time_step; } if(key_cud== on) { c_move(my,vector(-6 * time_step,0,0),nullvector,glide); ent_animate(my,"walk",walk_speed,anm_cycle); walk_speed+= -7 * time_step; } if(key_cul== on) { my.pan+= 10 * time_step; } if(key_cur== on) { my.pan-= 10 * time_step; } if(key_j== on) { c_move(my,vector(0,0,15 * time_step),nullvector,glide); ent_animate(my,"jump",jump_speed,anm_cycle); jump_speed+= 14 * time_step; }
Kinda the long way, but this is from an old script of mine, so it's very basic. But that's how you can walk around with animations (if you already have "jump", "walk", and "breath" as animation scenes). Hope that clears things up.
void main()
{
cout << "I am MrCode,";
cout << "hear me roar!";
system("PAUSE");
}
|
|
|
|