Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by EvanTJ. 11/28/26 18:19
Experiences with cTrader
by JeyKey II. 11/27/26 09:04
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (EvanTJ, Quad, AndrewAMD), 4,715 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 4 1 2 3 4
Re: New guy needs help please :) [Re: EvilSOB] #262798
04/25/09 22:16
04/25/09 22:16
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
Dont suppose you know where I could get some models /w animations?

Re: New guy needs help please :) [Re: EvilSOB] #262800
04/25/09 22:53
04/25/09 22:53
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
Thanks its looking better now smile just one thing left I cant figure out is how to play two different animations I have been reading the workshop again and again but I think I need a break cause I cant understand it lol, but I want a stand still animation and the walk one but either the walk plays non stop or if I have the stand one on then that plays over the walk non stop aswell.

Code:
action main_player() //not player, since it's a global pointer
{
   while(1)
   { 
    my.pan += 19*(key_a-key_d)*time_step; 

	   var dist_ahead = 2*(key_w-key_s)*time_step; //wiki
      dist_ahead = sign(dist_ahead)*(abs(dist_ahead) + 0.5); // adapt the speed on slopes
      c_move(me,vector(dist_ahead,0,0),vector(0,0,0),GLIDE); // move the player

     ent_animate(me,"walk",walk_percentage,ANM_CYCLE); // walk animation   loop
     walk_percentage += 4 * time_step;
    
     ent_animate(me,"stand",walk_percentage, 0); //standing still animation
     walk_percentage = 0 * time_step;
     
    if (key_space) me.z +=10;
    if (me.z > 20) me.z -=0.8;
    
    camera.x = my.x - 60; // keep the camera 200 quants behind the player
		camera.y = my.y; // using the same y with the player
		camera.z = my.z+30; // and place it at z = 700 quants
		camera.tilt = -25; // make it look downwards


    wait (1);
   }
} 


Sorry for the double post as well did not remember I already posted :S.

Last edited by JakeBilbe; 04/26/09 00:21.
Re: New guy needs help please :) [Re: JakeBilbe] #262807
04/26/09 01:03
04/26/09 01:03
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
No problem with the double posting, I needed your code anyway.
Try this untested adjustments to your code and tell me what happens.
Code:
action main_player() //not player, since it's a global pointer
{
   var dist_ahead, walk_percentage=0, stand_percentage=0;
   while(1)
   { 
      my.pan += 19*(key_a-key_d)*time_step; 
      dist_ahead = 2*(key_w-key_s)*time_step; 
      if(dist_ahead)   //if dist is NOT zero
      {
         dist_ahead = sign(dist_ahead)*(abs(dist_ahead) + 0.5); // adapt the speed on slopes
         c_move(me,vector(dist_ahead,0,0),NULL,GLIDE); // move the player
         ent_animate(me,"walk",walk_percentage,ANM_CYCLE); // walk animation   loop
         walk_percentage += 4 * time_step;
         stand_percentage = 0;
      }
      else
      {
         ent_animate(me,"stand",stand_percentage, 0); //standing still animation, now allows stand to have "figit-ing"
         stand_percentage += 4 * time_step;
         walk_percentage = 0;
      }
      if((key_space)&&(me.z<=20))   c_move(me,vector(0,0,+10),NULL,GLIDE);   //only add jump when "on-ground"( Im guessing my.z=20 is on the ground? )
      else if(me.z > 20)   c_move(me,vector(0,0,-0.8),NULL,GLIDE);  //fall now allows you to land "on" things
      //
      camera.x = my.x - 60; // keep the camera 200 quants behind the player
      camera.y = my.y;    // using the same y with the player
      camera.z = my.z+30; // and place it at z = 700 quants
      camera.tilt = -25;  // make it look downwards
      wait (1);
   }
}

Sorry if its gotten "alot" more complex, I got carried away laugh
Any questions on what Ive added or modded just ask...

PS :: Try looking for models etc on the Acknex Unlimited site. Link is at the bottom of the forum pages as resources


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: New guy needs help please :) [Re: EvilSOB] #262808
04/26/09 01:20
04/26/09 01:20
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
Lol actually I kinda understand that but I get an error saying " Error in if((key_space)&&(me.z<=20)) c_move(me,vector(0,0,+10),NULL,GLIDE); //only add jump when "on-ground"( Im guessing my.z=20 is on the ground?" and me.z was the height I wanted when reached to activate the me.z -=1.8 so when they press jump it goes beyond 21 there for he just glides back down slowly, its a cool jump effect.

Re: New guy needs help please :) [Re: JakeBilbe] #262809
04/26/09 01:55
04/26/09 01:55
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Ah, my bad, sorry. Remember I re-coded yours straight out of my head, so I think I did well.
Keep the numbers you want to get the effect you want. I wasnt sure if your "my.z=0" was ACTUALLY the ground.
My syntax error in this line is because of the "vector(0,0,+10)" entry.
3DGS lets you use "-" in front of a number, but cries if you use "+".
The vector SHOULD be "vector(0,0,10)" and that will take the error away.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: New guy needs help please :) [Re: EvilSOB] #262810
04/26/09 02:01
04/26/09 02:01
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
Its okay least you fixed it lol. Dont suppose you could help me with one last problem when I jump I want it to play a sound so I have this code at the top
Code:
SOUND* woosh = "woosh.wav"; //jumping sound
and then in my action main_player I have this inside the while(1)
Code:
if((key_space)&&(me.z<=20))   c_move(me,vector(0,0,10),NULL,GLIDE);   //only add jump when "on-ground"( Im guessing my.z=20 is on the ground? )
      else if(me.z > 20)   c_move(me,vector(0,0,-0.8),NULL,GLIDE);  //fall now allows you to land "on" things
ent_playsound(main_player,woosh,100); //jump effect sound
but when the game loads it says error in main_player.

Last edited by JakeBilbe; 04/26/09 02:06.
Re: New guy needs help please :) [Re: JakeBilbe] #262811
04/26/09 02:27
04/26/09 02:27
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Easy one. Ent_playsound want an ENTITY as a parameter, and youve given it an action name.
use "ent_playsound(me,woosh,100); //jump effect sound" instead

Thats the answer to the ERROR, but the effect will be horrible. It will try to play the sound
every time the loop goes through, so it will start multiple copies of the sound every second.
Try this instead
Code:
      if((key_space)&&(me.z<=20))
      {   c_move(me,vector(0,0,10),NULL,GLIDE);   //only add jump when "on-ground"( Im guessing my.z=20 is on the ground? )
          ent_playsound(me,woosh,100); //jump effect sound only at junp start
      }
      else if(me.z > 20)   
      {
         c_move(me,vector(0,0,-0.8),NULL,GLIDE);  //fall now allows you to land "on" things
      }





"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: New guy needs help please :) [Re: EvilSOB] #262812
04/26/09 02:33
04/26/09 02:33
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
Ah I see thanks smile you have helped me alot now I can start making models and such laugh.

Re: New guy needs help please :) [Re: JakeBilbe] #262813
04/26/09 02:37
04/26/09 02:37
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Enjoy laugh


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 4 of 4 1 2 3 4

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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