2 registered members (AndrewAMD, TipmyPip),
12,420
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Bounding box problem
[Re: Vampir]
#281086
07/25/09 13:04
07/25/09 13:04
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
ich habe gar keinen C_move in meiner action, nur einen C_trace. aber sieh mal her. und sag mir eventuell was ich ändern soll.
action player_action //main player
{
//player = me;
chrisgamble=me;//geht nur eines von beiden, das erste fällt weg...
my.scale_x=0.51;my.scale_y=0.51;my.scale_z=0.51;
my.narrow = on;
my.fat = on;
wait(1);
vec_set(my.min_x,vector(-12,-12,-41);
vec_set(my.max_x,vector(12,12,25);
my.shadow =on;
my.cast =on;
my.health = 100;
my.enable_entity=on;
loadControlsDefault(); //this sets up controls and assigns keys...uses the new template misc_input file
initCameras();
camActive = 1;
cameraMove();
wait(1);
c_setminmax(my);
wait(5);
my.max_x = 12;
my.max_y = 12;
// my.max_z = 25;
my.min_x = -12;
my.min_y = -12;
// my.min_z = -41;
wait(5);
you = ent_create("drop.mdl",my.x,weapon_John);
setWeaponPlayer(my);
setWeapon(1550,1541,1566);
while(my.health > 0)
{
if (c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME |IGNORE_PASSABLE | GLIDE) > 0)
{ }
if(freeze_mode == 0)
...
|
|
|
Re: Bounding box problem
[Re: Pappenheimer]
#281131
07/25/09 17:02
07/25/09 17:02
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
hmm, aber auch wenn ich es in c_move ändere, macht dies keinen underschied  und das kombinierte model ist schon auf passable gestellt.
|
|
|
Re: Bounding box problem
[Re: ]
#281142
07/25/09 17:19
07/25/09 17:19
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
befindet sich der fehler vielleicht hier??
function environmentForces() // gravity and the like
{
you = null;
vec_set (temp,player.x);
temp.z -= 4000;
result = c_trace (player.x,temp, ignore_me + ignore_passable + ignore_passents); //distance to the ground?
result += player.min_z;
my_height = c_trace(player.x, temp, ignore_me + ignore_passable + ignore_passents);
my_height = (result + 2 * my_height) / 3;
if (16 / time_step > 10)
{
abs_force.z = -0.5 * my_height; //move him up, if stuck in the ground and fps > 10
}
else
{
if (my_height < 0)
{
player.z -= my_height;
vec_set (player._velocityx, nullvector);
vec_set (player._abs_velx, nullvector);
} // prevent shaking
}
friction = 2.1; //ground friction PLAYER SPEED!!!!!!!!!!!!!!!
}
Last edited by chris_oat; 07/25/09 17:20.
|
|
|
Re: Bounding box problem
[Re: ]
#281145
07/25/09 17:25
07/25/09 17:25
|
Joined: Sep 2006
Posts: 99 BS, Germany
Storm_Mortis
Junior Member
|
Junior Member
Joined: Sep 2006
Posts: 99
BS, Germany
|
ich bin mir nicht sicher aber hast du mal versucht im move_mode "USE_BOX" zu nutzen?
ich glaube mich zu erinnern das hat mal geholfen, kan naber auch nen anderes porb + andere umstände gewesen sein...
aber nen versuch ist es doch wert^^
it found a voice ... now it needs a body
|
|
|
Re: Bounding box problem
[Re: Storm_Mortis]
#281174
07/25/09 19:04
07/25/09 19:04
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
ok, habe es jetzt mit der box hinbekommen. nur das letzte problem jetzt, das mein player langsam schweben tut. langsam steigt er in die höhe. wie kann das den in meinen codes sein? bitte um letzte hilfe
action player_action //main player
{
chrisgamble=me;
wait(1);
my.scale_x=0.51;my.scale_y=0.51;my.scale_z=0.51;
player = me;
// my.polygon = on;
my.narrow = on;
my.fat = on;
my.shadow =on;
my.cast =on;
my.health = 100;
my.enable_entity=on;
loadControlsDefault(); //this sets up controls and assigns keys...uses the new template misc_input file
initCameras();
camActive = 1;
cameraMove();
wait(1);
c_setminmax(my);
wait(5);
my.max_x = 14;
my.max_y = 14;
// my.max_z = 25;
my.min_x = -14;
my.min_y = -14;
// my.min_z = -41;
wait(5);
you = ent_create("drop.mdl",my.x,weapon_John);
setWeaponPlayer(my);
setWeapon(1550,1541,1566);
while(my.health > 0)
{
if (c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | GLIDE) > 0)
{ }
function environmentForces() // gravity and the like
{
you = null;
vec_set (temp,player.x);
temp.z -= 4000;
result = c_trace (player.x,temp, ignore_me + ignore_passable + ignore_passents); //distance to the ground?
result += player.min_z;
my_height = c_trace(player.x, temp, ignore_passable + ignore_passents +USE_BOX);
my_height = (result + 2 * my_height) / 3;
if (16 / time_step > 10)
{
abs_force.z = -0.5 * my_height; //move him up, if stuck in the ground and fps > 10
}
else
{
if (my_height < 0)
{
player.z -= my_height;
vec_set (player._velocityx, nullvector);
vec_set (player._abs_velx, nullvector);
} // prevent shaking
}
friction = 2.1; //ground friction PLAYER SPEED!!!!!!!!!!!!!!!
}
|
|
|
Re: Bounding box problem
[Re: ]
#281184
07/25/09 20:46
07/25/09 20:46
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
Tut mir leid, wenn ich jetzt nicht so konstruktiv klinge, aber der Code ist mir ein Rätsel: darin sind 3 Traces nach unten enthalten, wo für die eine Figur nur ein einziger nötig wäre. Jeder davon wieder etwas anders. Außerdem enthält die Funktion environmental_forces überhaupt keine Umwelteinflüsse. Und von der "if (c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | GLIDE) > 0)" sieht man nicht, was sie für Folgen hat...
Kennst Du den Movement und Gravity Code aus dem Manual? Er müsste unter dem Stichpunkt "c_move" enthalten sein und sehr gut. Allerdings müsste man einen Sprungmodus erst noch einbauen, wenn man den braucht.
|
|
|
Re: Bounding box problem
[Re: Vampir]
#281262
07/26/09 13:56
07/26/09 13:56
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
hi, ich bins mal wieder  habe jetzt einen etwas neueren GRAVITY Code:
function gravity2(){
vec_set(temp, my.x);
temp.z = -999999;
trace_mode = ignore_me + use_box + ignore_models + ignore_sprites;
-trace(my.x, temp);
if(result > 20){my.skill3 -= 2 * time;}
else{my.skill3 = -trace(my.x, temp) * 1;}
}
action player_action //main player
{
wait(1);
my.scale_x=0.51;my.scale_y=0.51;my.scale_z=0.51;
player = me;
my.narrow = on;
my.fat = on;
my.shadow =on;
my.cast =on;
my.health = 100;
my.enable_entity=on;
loadControlsDefault();
initCameras();
camActive = 1;
cameraMove();
wait(1);
c_setminmax(my);
wait(5);
my.max_x = 14;
my.max_y = 14;
my.max_z = 25;
my.min_x = -14;
my.min_y = -14;
my.min_z = -35;
wait(5);
you = ent_create("drop.mdl",my.x,weapon_John);
setWeaponPlayer(my);
setWeapon(1550,1541,1566);
while(my.health > 0)
{
if(freeze_mode == 0)
{
if (mouse_right)
{
gravity2(); //calculate
..
probleme jetzt noch, das der spieler noch ziemlich stark in boden stecken bleibt und das die von mir festgelegt BBox noch immer nicht für die kollision genommen wird. kann mir da noch jemand helfen?
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|