Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Kollisions Frage #329473
06/20/10 10:47
06/20/10 10:47
Joined: Dec 2008
Posts: 222
janerwac13 Offline OP
Member
janerwac13  Offline OP
Member

Joined: Dec 2008
Posts: 222
Sorry leute,
Ich habe ein Problem mit der Kollision und wollte fragen ob ihr mir helfen könntet ? Den momentan ist es so das wenn ich mit meiner figur laufe immer auf dem Boden bleibe also wenn ich in eine Schlucht laufe fällt er nicht sondern ist plöp auf dem boden.
Quote:

action walking_guard()
{

while (1)
{

player = my; // I'm the player
vec_set (camera.x, player.pan);
vec_rotate (camera.x, player.pan);
vec_add (camera.x, player.x);
camera.pan = 90; // look down at the player
camera.y = -500;
player_speeds.x = 20 * (key_space) * time_step; // move forward / backward with W / S, 10 gives the movement speed
player_speed.x = 10 * (key_w - key_s) * time_step; // move forward / backward with W / S, 10 gives the movement speed
player_speed.y = 0;
player_speed.z = 0;
c_setminmax(my); // set my bounding box to my real size
c_trace (my.x, temp.x, IGNORE_ME | USE_BOX | IGNORE_PUSH);
c_move (my, player_speed.x, nullvector, USE_BOX | ACTIVATE_PUSH);
if (key_w || key_s)
{
ent_animate(me,"walk",walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage+= 8 * time_step; // "8" controls the animation speed
}
else // the player is standing still?
{
ent_animate(my, "stand", walk_percentage, ANM_CYCLE);
walk_percentage+= 1 * time_step; // "1" controls the animation speed

}
if (key_space)
{
c_move (my, player_speeds.x, nullvector, USE_BOX | ACTIVATE_PUSH);
ent_animate(me,"run",walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage+= 10 * time_step; // "8" controls the animation speed
}
if (key_a)
{
my.z += 350 * time_step; // move the entity along the x axis
ent_animate(me,"stand",walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage+= 10 * time_step; // "8" controls the animation speed
}
wait (1);
}
}


Last edited by janerwac13; 06/20/10 10:48.
Re: Kollisions Frage [Re: janerwac13] #329483
06/20/10 13:32
06/20/10 13:32
Joined: Nov 2008
Posts: 216
J
jane Offline
Member
jane  Offline
Member
J

Joined: Nov 2008
Posts: 216
Hallo,

Dir fehlt in der Action ein trace nach unten, um die Distanz zum Boden zu
berechnen.

Schau doch mal im Handbuch unter "c_move" nach, dort ist am Ende eine
komplette Bewegungs-Action, die Punkte: // determine the ground distance by a downwards trace und: // apply gravity when the player is in the air
sind hier für die kontrollierte Gravitation zuständig.

Re: Kollisions Frage [Re: jane] #329501
06/20/10 16:43
06/20/10 16:43
Joined: Dec 2008
Posts: 222
janerwac13 Offline OP
Member
janerwac13  Offline OP
Member

Joined: Dec 2008
Posts: 222
jane ich hab es probiert es hat nicht geklppt frown
Aber, dann hab ich etws anderes probiert das hat nun geklappt doch nun ist
eine hlfte der figur in den blocken des level eingetaucht.

Re: Kollisions Frage [Re: janerwac13] #329502
06/20/10 16:44
06/20/10 16:44
Joined: Dec 2008
Posts: 222
janerwac13 Offline OP
Member
janerwac13  Offline OP
Member

Joined: Dec 2008
Posts: 222
jane ich hab es probiert es hat nicht geklppt frown
Aber, dann hab ich etws anderes probiert das hat nun geklappt doch nun ist
eine hlfte der figur in den blocken des level eingetaucht.

action walking_guard()
{

while (1)
{

player = my; // I'm the player
vec_set (camera.x, player.pan);
vec_rotate (camera.x, player.pan);
vec_add (camera.x, player.x);
camera.pan = 90; // look down at the player
camera.y = -500;
var player_down;
var dist_ahead = 5*(key_w-key_s)*time_step;
player_speeds.x = 20 * (key_space && key_w) * time_step; // move forward / backward with W / S, 10 gives the movement speed
player_speed.x = 10 * (key_w - key_s) * time_step; // move forward / backward with W / S, 10 gives the movement speed
player_speed.y = 0;
player_speed.z = 0;
c_move (my, player_speed.x, nullvector, GLIDE);
c_trace(my.x,vector(my.x,my.y,my.z-2500),IGNORE_ME|IGNORE_SPRITES|IGNORE_CONTENT);
my.z = hit.z - hit.y;
if (key_w || key_s)
{
ent_animate(me,"walk",walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage+= 8 * time_step; // "8" controls the animation speed
}
else // the player is standing still?
{
ent_animate(my, "stand", walk_percentage, ANM_CYCLE);
walk_percentage+= 1 * time_step; // "1" controls the animation speed

}
if (key_space && key_w)
{
c_move (my, player_speeds.x, nullvector, USE_BOX | ACTIVATE_PUSH);
ent_animate(me,"run",walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage+= 10 * time_step; // "8" controls the animation speed
}
if (key_a)
{
my.z += 350 * time_step; // move the entity along the x axis
ent_animate(me,"stand",walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage+= 10 * time_step; // "8" controls the animation speed
}
wait (1);
}
}

Re: Kollisions Frage [Re: janerwac13] #329503
06/20/10 16:49
06/20/10 16:49
Joined: Sep 2009
Posts: 496
P
Progger Offline
Senior Member
Progger  Offline
Senior Member
P

Joined: Sep 2009
Posts: 496
versuch mal c_setminmax(my);
WFG Progger


asking is the best Way to get help laugh laugh laugh
Re: Kollisions Frage [Re: Progger] #329512
06/20/10 17:19
06/20/10 17:19
Joined: Dec 2008
Posts: 222
janerwac13 Offline OP
Member
janerwac13  Offline OP
Member

Joined: Dec 2008
Posts: 222
hab ich schon!
funktioniert nicht.

Re: Kollisions Frage [Re: janerwac13] #329514
06/20/10 17:34
06/20/10 17:34
Joined: Dec 2008
Posts: 222
janerwac13 Offline OP
Member
janerwac13  Offline OP
Member

Joined: Dec 2008
Posts: 222
ok nun han ich es mit der my.z funktion hinbekommen.


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