Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 3 1 2 3
Re: FPS TROUBLE (ima noob) [Re: darkinferno] #273187
06/21/09 20:56
06/21/09 20:56

R
ricky5564 OP
Unregistered
ricky5564 OP
Unregistered
R



lol... thats just a big breakthrough wit my progress... but i still cant start my character walking script.... this is really hard for me

Re: FPS TROUBLE (ima noob) [Re: ] #273239
06/22/09 07:36
06/22/09 07:36
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
Player movement isn't that difficult...
Alright, let's see...

Follow this code now, I'll comment it as good as I can.
DON'T COPY AND PASTE, READ it and try to UNDERSTAND, ok?
That will help you more.

Code:
//////////////////////////////////////////////////////
//// first, we define a skill that stores the player's
//// health:

#define health skill1  // skill1 is now called health
////////////////////////////////////////////////
/// a skill for the animation percent

#define animate skill2


////////
// now, we define three more skills that store the player'S
// speed

#define move_x skill3  // speed forward/backwards
#define move_y skill4  // speed sidewards
#define move_z skill5  // speed up/down


/////////////////////////////////////////////////
/// Ok, now we have to define an action that we assign
/// to the player model in WED

action player_ent()
{
  // we attach the predefined player pointer to it to 
  // identify it later
  player = me; 
 
  my.health = 100;  // he's at full health
  
  /// now, a loop; we want to control him all the time

  while(1)
  {
     ///////////////////////////////////
     // if he's dead (health <= 0), we exit the loop
    
     if(my.health <= 0)
     break;  // this statement exits the loop
   
     ///////////////////////////////////////////
     /// we move him using w,a,s,d keys, ok?
 
     my.move_x = (key_w-key_s)*22*time_step;
     my.move_y = (key_a-key_d)*22*time_step;

     /// this is the function that moves him, using
     // the speed vector skill we control
     c_move(my,my.move_x,nullvector,GLIDE | USE_BOX);

     //////////////////////////////////////////////
     // now, a VERY simple animation system:

    if((my.move_x + my.move_y) != 0)  // if moving
    {
        ent_animate(my,"walk",my.animate,ANM_CYCLE);
        my.animate += 10*time_step;
        my.animate %= 100;  // this sets animate to 0 if 100 is reached.
    }
    else  // if standing still
    {
        ent_animate(my,"stand",my.animate,ANM_CYCLE);
        my.animate += 5*time_step;
        my.animate %= 100;
    }

    wait(1);

  }

  ///////////////////////////////////////
  /// and now, a simple death

  my.animate = 0;
  while(my.animate < 80)
  {
    ent_animate(my,"die",my.animate,ANM_CYCLE);
    my.animate += 10*time_step;
    my.animate%= 100;
    wait(1);
  }

  set(my,PASSABLE);  // make him passable




You'll have to name your animations walk, stand and die.
Well, now after you read it, simply ask for the things you didn't understand, I'll be glad to help.
And if you understood everything, we can go on with the camera.

Btw, a game with a behind-the-back camera isn't a FPS but a TPS (Third Person Shooter). grin

Last edited by the_clown; 06/22/09 07:58.
Re: FPS TROUBLE (ima noob) [Re: the_clown] #273869
06/24/09 19:05
06/24/09 19:05

R
ricky5564 OP
Unregistered
ricky5564 OP
Unregistered
R



thanks dude my whole gole from for this FPS is to learn the program and script .. i am not a copy and paster

Re: FPS TROUBLE (ima noob) [Re: the_clown] #273870
06/24/09 19:07
06/24/09 19:07

R
ricky5564 OP
Unregistered
ricky5564 OP
Unregistered
R



oh and lol it was hard for me to script the camera behind the character... so i just called it an fps for now but thnkz 2 u i might be able to make it a tbs

Re: FPS TROUBLE (ima noob) [Re: ] #274034
06/25/09 12:25
06/25/09 12:25
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
Nice to see that I could help you. smile

Page 3 of 3 1 2 3

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