Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 12,885 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
movement! #126686
04/26/07 17:12
04/26/07 17:12
Joined: Apr 2006
Posts: 160
DerLateinProfi Offline OP
Member
DerLateinProfi  Offline OP
Member

Joined: Apr 2006
Posts: 160
Ich habe in einem Tutorial einen Code gefunden nur will ich wissen wie ich dort eine Sprung function einfügen kann. Also auf Space^^

Code:
 Entity* player;

view m_camera
{
layer = 0;
pos_x = 0;
pos_y = 0;
size_x = 1024; //screen res.x
size_y = 768; //screen res.y
arc = 45;
aspect = 1;
offset_x = 0;
offset_y = 0;
ambient = 10;
fog = 10;
flags = visible;
}

action PlayerAct
{
var move_var; //We're going to use this as our move vector (X,Y,Z)
camera.visible = off; //turns off the default camera

while(player != null) //while the player object exists
{
move_var.x = 0; //resets them all back to 0
move_var.y = 0; //if we don't do thist hen the variables will addup
move_var.z = 0; //making the player move faster and faster with no stopping

m_camera.x = player.x - 300 * cos(player.pan); //this will update the cameras position
m_camera.y = player.y - 300 * sin(player.pan);
m_camera.z = player.z + 150;
m_camera.pan = player.pan;
m_camera.tilt = -20;

vec_set(temp,my.x); //copies the second vector to the first
temp.z -= 8000; //lets make the trace point way way below us

trace_mode = ignore_me+ignore_sprites+ignore_models+use_box; //see manual

result = trace(my.x,temp);
if(result > 5) //if from my pos to temp is greater than 5
{ move_var.z -= 20; } //fall speed of 20 (higher number, faster falling speed)
if(result <= 0) //if from my pos to temp is less than or equal to 0
{ move_var.z += 2; } //not touching the floor but extremely close

//Animation Variables
my.skill91 += 5*time; //walking/running
my.skill92 += 2*time; //for standing still
if(my.skill91 >= 100) { my.skill91 = 0; }
if(my.skill92 >= 100) { my.skill92 = 0; }

if(key_cuu == on) //if we press the up arrow key
{
move_var.x = 4; //give the X parameter a value of 4
ent_animate(me,"walk",my.skill91,anm_cycle+anm_add); //walk animation
//entity, frame name, percent, mode : see manual
}
if(key_cud == on) //if we press the down arrow key
{
ent_animate(me,"walk",my.skill91,anm_cycle+anm_add); //walk animation
move_var.x = -4; //give the X parameter a value of 4
}
if(key_cul == on) //if we press the left arrow key
{
my.pan += 4; //add to the pan value
}
if(key_cur == on) //if we press the right arrow key
{
my.pan -= 4; //subtract the pan value
}
while(key_any == 0)
{
ent_animate(me,"stand",my.skill92,anm_cycle+anm_add);
wait(1);
}
ent_move(move_var,nullvector); //nullvector is a 'blank' vector
wait(1);
}
}

Wenn jemand eine Antwort hat, bitte schreiben!^^

MFG:
DerLateinProfi


If there's a god He's watching can he give a ray of hope so much pain and so much sorrow www.lpp1991.de.vu
Re: movement! [Re: DerLateinProfi] #126687
04/26/07 17:29
04/26/07 17:29
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
mit oder ohne aircontrol?
EDIT:
Wie auch immer
Hier mit:
Code:
 
action PlayerAct
{
var jump_force;
var move_var; //We're going to use this as our move vector (X,Y,Z)
var dist_to_ground;
camera.visible = off; //turns off the default camera

while(player != null) //while the player object exists
{
move_var.x = 0; //resets them all back to 0
move_var.y = 0; //if we don't do thist hen the variables will addup
move_var.z = 0; //making the player move faster and faster with no stopping

dist_to_ground=0;

m_camera.x = player.x - 300 * cos(player.pan); //this will update the cameras position
m_camera.y = player.y - 300 * sin(player.pan);
m_camera.z = player.z + 150;
m_camera.pan = player.pan;
m_camera.tilt = -20;

vec_set(temp,my.x); //copies the second vector to the first
if(jump_force<=0) //nicht beim springen
{
temp.z -= 8000; //lets make the trace point way way below us
trace_mode = ignore_me+ignore_sprites+ignore_models+use_box; //see manual

dist_to_ground = trace(my.x,temp);
if(dist_to_ground > 5) //if from my pos to temp is greater than 5
{ move_var.z -= 20; } //fall speed of 20 (higher number, faster falling speed)
if(dist_to_ground <= 0) //if from my pos to temp is less than or equal to 0
{ move_var.z += 2; } //not touching the floor but extremely close
}
else
{
temp.z += 8000;
trace_mode = ignore_me+ignore_sprites+ignore_models+use_box; //see manual

result = trace(my.x,temp);
if(dist_to_ground > 5) //if from my pos to temp is greater than 5
{
move_var.z=15*time; //spiel damit rum
jump_force-=50*time; //spiel damit rum
}
else
{
jump_force=0;
}
if(dist_to_ground <= 0) //if from my pos to temp is less than or equal to 0
{ move_var.z -= 2; } //not touching the floor but extremely close
}
//Animation Variables
my.skill91 += 5*time; //walking/running
my.skill92 += 2*time; //for standing still
if(my.skill91 >= 100) { my.skill91 = 0; }
if(my.skill92 >= 100) { my.skill92 = 0; }

if(key_cuu == on) //if we press the up arrow key
{
move_var.x = 4; //give the X parameter a value of 4
ent_animate(me,"walk",my.skill91,anm_cycle+anm_add); //walk animation
//entity, frame name, percent, mode : see manual
}
if(key_cud == on) //if we press the down arrow key
{
ent_animate(me,"walk",my.skill91,anm_cycle+anm_add); //walk animation
move_var.x = -4; //give the X parameter a value of 4
}
if(key_cul == on) //if we press the left arrow key
{
my.pan += 4; //add to the pan value
}
if(key_cur == on) //if we press the right arrow key
{
my.pan -= 4; //subtract the pan value
}
if(key_Space&&jump_force<=0&&dist_to_ground<6)
{
jump_force=200;
}
while(key_any == 0)
{
ent_animate(me,"stand",my.skill92,anm_cycle+anm_add);
wait(1);
}
ent_move(move_var,nullvector); //nullvector is a 'blank' vector
wait(1);
}
}



Grüße
Jannes

Last edited by derOmega; 04/26/07 17:33.

Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: movement! [Re: Puppeteer] #126688
04/26/07 17:30
04/26/07 17:30
Joined: Apr 2006
Posts: 160
DerLateinProfi Offline OP
Member
DerLateinProfi  Offline OP
Member

Joined: Apr 2006
Posts: 160
Also so wie in einem EGO-Shooter!^^


If there's a god He's watching can he give a ray of hope so much pain and so much sorrow www.lpp1991.de.vu
Re: movement! [Re: DerLateinProfi] #126689
04/26/07 17:34
04/26/07 17:34
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
gibt ja beides
ah ja du solltest vll noch die ani editieren
EDIT:
Aber nicht getestet

Last edited by derOmega; 04/26/07 17:36.

Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: movement! [Re: Puppeteer] #126690
04/26/07 17:40
04/26/07 17:40
Joined: Apr 2006
Posts: 160
DerLateinProfi Offline OP
Member
DerLateinProfi  Offline OP
Member

Joined: Apr 2006
Posts: 160
Also man soll springen können und dabei wie bei Unreal Turnament sich drehen können. ^^ Ich wollte nur wissen ob das tutorial geht und wie ich da ne sprung funktion reinsetzen soll!^^ Das mit den Animationen ist schon klar!


If there's a god He's watching can he give a ray of hope so much pain and so much sorrow www.lpp1991.de.vu
Re: movement! [Re: DerLateinProfi] #126691
04/26/07 17:43
04/26/07 17:43
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Gut!!
Geht er denn?


Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: movement! [Re: Puppeteer] #126692
04/26/07 17:54
04/26/07 17:54
Joined: Apr 2006
Posts: 160
DerLateinProfi Offline OP
Member
DerLateinProfi  Offline OP
Member

Joined: Apr 2006
Posts: 160
Naja... Ich weiß nicht wo ich den einsetzen soll!^^ (ich noob) Wenn ich in den tamplates alle Includes wegmache und dafür eine einfüge wo der code drinsteht, dann sagt der mir das my.skill und anderes nicht funzt!^^


If there's a god He's watching can he give a ray of hope so much pain and so much sorrow www.lpp1991.de.vu
Re: movement! [Re: DerLateinProfi] #126693
04/26/07 17:57
04/26/07 17:57
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
zeig mal her


Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: movement! [Re: Puppeteer] #126694
04/27/07 15:39
04/27/07 15:39
Joined: Apr 2006
Posts: 160
DerLateinProfi Offline OP
Member
DerLateinProfi  Offline OP
Member

Joined: Apr 2006
Posts: 160
Was herzeigen? Die Fehler oder das Tutorial?


If there's a god He's watching can he give a ray of hope so much pain and so much sorrow www.lpp1991.de.vu
Re: movement! [Re: DerLateinProfi] #126695
04/27/07 16:41
04/27/07 16:41
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Die Fehler


Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Page 1 of 2 1 2

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