Wieso geht das nicht!! :mad:

Posted By: MDMDFSS

Wieso geht das nicht!! :mad: - 09/12/08 13:09

ich arbeite an einen Player der springen und kämpfen kann nur das mit den springen geht nicht, hiers ist meine Arbeit (Ich habe A6.40) :


------------------------------------------------------------

////////////////////////////////////////////////////////

var video_mode = 7; // 800x600
var video_depth = 16; // 16 bit mode

var player_distance; // moves the player
var enemy_distance; // moves the enemy

var jump_z; //temporary variable, is copied into player_diff.z before the move instruction
var jump_force = 10; //change this variable to affect how high the player jumps
var jumping_mode = 0; //0 for not jumping, 1 if jumping
var z_force = 0;
var center[3];
var result = 0;


define sword_base = skill12; // using skill12, 13, 14 to store the sword_base coords
define sword_tip = skill15; // using skill15, 16, 17 to store the sword_tip coords
define healthpoints = skill18; // just another name for skill18

//////////////////////////////////////////////////////////////

font swc_font = <font.pcx>, , 24, 23; // sword combat font

//////////////////////////////////////////////////////////////

bmap spark_map = <spark.pcx>; // for spark particles
bmap blood_map = <blood.pcx>; // for blood particles

//////////////////////////////////////////////////////////////

sound beep_sound = <beep.wav>;
sound sword_snd = <sword.wav>;

//////////////////////////////////////////////////////////////

function particle_sparks();
function particle_blood();
function fade_particle();

//////////////////////////////////////////////////////////////

string level1_wmb = <level1.wmb>;
string health_str = "Player Health";

///////////////////////////////////////////////////////////////

entity* enemy; // useful only if you want to display its health

///////////////////////////////////////////////////////////////

panel health_panel // displays the numbers
{
pos_x = 0;
pos_y = 0;
digits = 120, 575, 4, swc_font, 1, player.healthpoints;
flags = refresh, visible;
}

text health_text // displays the text
{
pos_x = 0;
pos_y = 550;
font = swc_font;
string = health_str;
flags = visible;
}

////////////////////////////////////////////////////////////////

function main()
{
level_load (level1_wmb);
wait (2); // wait for the level to be loaded
clip_size = 0; // show all the triangles for all the models
on_d = null; // disable the debug panel (key "D") because it is used for movement
fps_max = 40; // lock the frame rate to 40 fps
}

action player_fight // attached to the player
{
player = me; // I'm the player
player.healthpoints = 100; // and I have 100 health points
while (player.healthpoints > 0) // as long as I'm alive
{
camera.x = player.x - 150 * cos(player.pan); // 200 = distance between the player and the camera
camera.y = player.y - 150 * sin(player.pan); // same value here
camera.z = player.z + 20; // above the player
camera.pan = player.pan; // looks in the same direction with the player
camera.tilt = -12; // look down at the player

my.pan += 5 * (key_a - key_d) * time - 60 * mouse_force.x * time; // rotates with the keys A and D or with the mouse
player_distance.x = 20 * (key_w - key_s) * time; // moves forward / backward with W / S
player_distance.y = 0;
player_distance.z = 0;

if ((key_w == 1) || (key_s == 1)) // the player is walking
{
ent_cycle("run", my.skill20); // play walk frames animation
my.skill20 += 5 * time; // "walk" animation speed
if (my.skill20 > 100) {my.skill20 = 0;} // loop animation
}
else // the player is standing
{
ent_cycle("stand", my.skill21); // play stand frames animation
my.skill21 += 2 * time; // "stand" animation speed
if (my.skill21 > 100) {my.skill21 = 0;} // loop animation
}

ent_move(player_distance, nullvector);

if (key_j == 1) // if we press the left mouse button
{
my.skill22 = 0; // reset "attack" frames
while (my.skill22 < 100)
{
ent_vertex(my.sword_tip, 2698); // sword tip vertex coords - get the value in Med
ent_vertex(my.sword_base, 2698); // sword base vertex coords - get the value in Med
trace_mode = ignore_me + ignore_passable; // ignore me (the player) and all the entities that are passable
trace (my.sword_base, my.sword_tip); // trace between these sword positions
if (result != 0) // the player has hit something
{
effect (particle_sparks, 10, target, normal);
if (you != null) {you.healthpoints -= 5 * time;} // if it hasn't hit a wall, decrease health
ent_playsound (my, sword_snd, 50); // sword sound
}
ent_cycle("attack_a", my.skill22); // play attack frames animation
my.skill22 += 8 * time; // "attack" animation speed
wait (1);
}
while (key_j == 1) {wait (1);} // can't use autofire on a sword smile
}
wait (1);
}
while (my.skill23 < 90) // the player is dead
{
ent_cycle("knockdown", my.skill23); // play death frames animation
my.skill23 += 3 * time; // "death" animation speed
wait (1);
}
my.passable = on; // the corpse can't be hit by the enemy sword from now on
}

if (key_space == 1) // if we press the space button
{
ent_cycle("jump", my.skill22);
my.skill22 += 5 * time;
wait (1);
(jumping_mode == 1) {
}
(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
(jumping_mode == 0) {
(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}
(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}
}


action enemy_fight // attached to the enemy
{
enemy = me; // I'm the enemy
enemy.healthpoints = 10; // and I have 100 healthpoints
while (my.healthpoints > 0) // as long as I'm alive
{
if (vec_dist (my.x, player.x) < 500 && player.healthpoints > 0) // the player approaches the enemy
{
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp);
my.tilt = 0; // I'm a maniac smile
enemy_distance.x = 7 * time;
enemy_distance.y = 0;
enemy_distance.z = 0;
ent_move(enemy_distance, nullvector);
ent_cycle("run", my.skill19); // play walk frames animation
my.skill19 += 5 * time; // "walk" animation speed
if (my.skill19 > 100) {my.skill19 = 0;} // loop animation
if (vec_dist (my.x, player.x) < 60) // if the player comes closer than 50 quants attack him
{
my.skill20 = 0; // reset "attack" frames
while (my.skill20 < 100)
{
ent_vertex(my.sword_tip, 2698); // sword tip vertex coords - get the value in Med
ent_vertex(my.sword_base, 2698); // sword base vertex coords - get the value in Med
trace_mode = ignore_me + ignore_passable;
trace (my.sword_base, my.sword_tip); // trace between these sword positions
if (result != 0) // hit something, could be the player or another enemy
{
effect (particle_blood, 2, target, normal);
if (you != null) {you.healthpoints -= 4 * time;}
ent_playsound (my, sword_snd, 50); // sword sound
}
ent_cycle("attack_c", my.skill20); // play attack frames animation
my.skill20 += 5 * time; // "attack" animation speed
wait (1);
}
waitt (6); // slows down the enemy and reduces the number of traces per second
}
}
else // the player is farther than 200 quants away
{
ent_cycle("stand", my.skill21); // play stand frames animation
my.skill21 += 2 * time; // "stand" animation speed
if (my.skill21 > 100) {my.skill21 = 0;} // loop animation
}
wait (1);
}
while (my.skill22 < 80) // the enemy is dead
{
my.event = null;
my.enable_shoot = on;
my.enable_scan = on;
my.transparent = on;
my.bright = on;
my.alpha = 100;
ent_cycle("knockdown", my.skill22);
my.skill22 += 4 * time;
wait(1);}
my.passable = on;
wait(20);
while(my.alpha > 0)
{
my.alpha -= time * 5;
my.z -= time * 0.5;
wait(1);
}
ent_remove(my);
}

function particle_sparks()
{
temp.x = random(2) - 1;
temp.y = random(2) - 1;
temp.z = random(1) - 1.5;
vec_add (my.vel_x, temp);
my.alpha = 30 + random(50);
my.bmap = spark_map;
my.size = 10;
my.flare = on;
my.bright = on;
my.move = on;
my.lifespan = 20;
my.function = fade_particle;
}

function particle_blood()
{
temp.x = random(2) - 1;
temp.y = random(2) - 1;
temp.z = random(1) - 1.5;
vec_add (my.vel_x, temp);
my.alpha = 70 + random(30);
my.bmap = blood_map;
my.size = 6;
my.flare = on;
my.bright = on;
my.move = on;
my.lifespan = 20;
my.function = fade_particle;
}

function fade_particle()
{
my.alpha -= 5 * time;
if (my.alpha < 0) {my.lifespan = 0;}
}
Posted By: MDMDFSS

Re: Wieso geht das nicht!! :mad: - 09/12/08 13:10

die Problemstelle ist:


if (key_space == 1) // if we press the space button
{
ent_cycle("jump", my.skill22);
my.skill22 += 5 * time;
wait (1);
(jumping_mode == 1) {
}
(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
(jumping_mode == 0) {
(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}
(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}
}
Posted By: MDMDFSS

Re: Wieso geht das nicht!! :mad: - 09/12/08 13:11

dancke in vorraus!!!!
Posted By: HPW

Re: Wieso geht das nicht!! :mad: - 09/12/08 13:37

Den Code konntest du so ausführen ohne Fehlermeldung? O_o
Ich weiss nicht obs nur ein Kopierfehler hier im Forum von dir ist, oder ob das so genau in deinem Script steht, aber da fehlen die "if" bei deinen Abfragen:

Code:
...
if (z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; } 
if (jumping_mode == 0)
{
  if (z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; } 
} 
  if (z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; } 
}
...

Posted By: MDMDFSS

Re: Wieso geht das nicht!! :mad: - 09/12/08 17:34

nein ich konnte es nicht ausführen ohne Fehlermeldungen, die Fehlermeldungen nerven total.
Posted By: MDMDFSS

Re: Wieso geht das nicht!! :mad: - 09/12/08 17:38

Ich habe zuerst alles ohne springen geschrieben und das ging prima, dann fand ich er müsste springen können und habe versucht sowas hinzuzufügen, ging aber nicht. frown
Posted By: HPW

Re: Wieso geht das nicht!! :mad: - 09/12/08 19:26

Gehts denn jetzt wenn du die "if" da hin schreibst wie in meinem Codesnipsel?
Posted By: MDMDFSS

Re: Wieso geht das nicht!! :mad: - 09/12/08 21:00

nein immernoch das selbe Problem
Posted By: HPW

Re: Wieso geht das nicht!! :mad: - 09/12/08 21:30

Welche Fehlermeldungen kommen denn? Kann man da was raus erkennen oder sind es nichtssagende Fehlermeldungen? Am besten schriebst du die mal hier rein, wenn die eine Aussage haben.
Programmierst du mit einer name.c oder einer name.wdl Datei?
Bei einer name.c Datei sollten viele deiner Deklarationen anderst aussehen, wie z.b. anstelle von string health_str = "Player Health"; solltest du STRING* health_str = "Player Health"; schreiben. Verendest du allerdings die Dateiendung wdl, dann sind deine Deklarationen richtig.
Posted By: MDMDFSS

Re: Wieso geht das nicht!! :mad: - 09/13/08 14:28

aber alle strings gehen das einzigste was nicht geht ist der gravity oder die physic
Posted By: HPW

Re: Wieso geht das nicht!! :mad: - 09/13/08 14:45

Also wenn Fehlermeldungen kommt stimmt was nicht und da ist es wichtig erstmal alle Fehlermeldungen weg zu bekommen und wenn es dann immer noch nicht richtig funktioniert, dann kann man immer noch nach Logikfehlern bzw. Workarounds suchen.

Also ohne die passenden Fehlermeldungen oder eine Beschreibung deinerseits zu welchen Ereignissen genau die Fehler auftauchen, wird dir wohl hier keiner weiterhelfen können.
Posted By: Karotte

Re: Wieso geht das nicht!! :mad: - 09/13/08 16:50

alles ab key_space musst du nur in die while schleife machen

edit:

hier, wie es aussehen muss:

Code:
action player_fight // attached to the player
{
player = me; // I'm the player
player.healthpoints = 100; // and I have 100 health points
while (player.healthpoints > 0) // as long as I'm alive
{
camera.x = player.x - 150 * cos(player.pan); // 200 = distance between the player and the camera
camera.y = player.y - 150 * sin(player.pan); // same value here
camera.z = player.z + 20; // above the player
camera.pan = player.pan; // looks in the same direction with the player
camera.tilt = -12; // look down at the player

my.pan += 5 * (key_a - key_d) * time - 60 * mouse_force.x * time; // rotates with the keys A and D or with the mouse
player_distance.x = 20 * (key_w - key_s) * time; // moves forward / backward with W / S
player_distance.y = 0;
player_distance.z = 0;

if (key_space == 1) // if we press the space button
{
ent_cycle("jump", my.skill22);
my.skill22 += 5 * time;
wait (1);
if(jumping_mode == 1) {
}
if(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
(jumping_mode == 0) {
if(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}
if(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}
if ((key_w == 1) || (key_s == 1)) // the player is walking
{
ent_cycle("run", my.skill20); // play walk frames animation
my.skill20 += 5 * time; // "walk" animation speed
if (my.skill20 > 100) {my.skill20 = 0;} // loop animation
}
else // the player is standing
{
ent_cycle("stand", my.skill21); // play stand frames animation
my.skill21 += 2 * time; // "stand" animation speed
if (my.skill21 > 100) {my.skill21 = 0;} // loop animation
}

ent_move(player_distance, nullvector);

if (key_j == 1) // if we press the left mouse button
{
my.skill22 = 0; // reset "attack" frames
while (my.skill22 < 100)
{
ent_vertex(my.sword_tip, 2698); // sword tip vertex coords - get the value in Med
ent_vertex(my.sword_base, 2698); // sword base vertex coords - get the value in Med
trace_mode = ignore_me + ignore_passable; // ignore me (the player) and all the entities that are passable
trace (my.sword_base, my.sword_tip); // trace between these sword positions
if (result != 0) // the player has hit something
{
effect (particle_sparks, 10, target, normal);
if (you != null) {you.healthpoints -= 5 * time;} // if it hasn't hit a wall, decrease health
ent_playsound (my, sword_snd, 50); // sword sound
}
ent_cycle("attack_a", my.skill22); // play attack frames animation
my.skill22 += 8 * time; // "attack" animation speed
wait (1);
}
while (key_j == 1) {wait (1);} // can't use autofire on a sword smile
}
wait (1);
}
while (my.skill23 < 90) // the player is dead
{
ent_cycle("knockdown", my.skill23); // play death frames animation
my.skill23 += 3 * time; // "death" animation speed
wait (1);
}
my.passable = on; // the corpse can't be hit by the enemy sword from now on
}
} 


und für die gravitation verwendest du am besten c_move
Posted By: MDMDFSS

Re: Wieso geht das nicht!! :mad: - 09/17/08 12:46

Sorry, Karotte jetzt geht ganichts!
Posted By: MDMDFSS

Re: Wieso geht das nicht!! :mad: - 09/17/08 13:18

ok hier sind die fehlermeldungen:


if (key_space == 1)
145:0 Error(19): Parameter unknow if bad keyword in {}

ent_cycle("jump", my.skill22);
146:0 Error(19): Parameter unknow ent_cycle keyword in {}

my.skill22 += 5 * time;
147:0 Error (19): Parameter unknow my.skill22 keyword in {}

wait (1);
148:0 Error (19) Parameter unknow wait (1); keyword in {}

(jumping_mode == 1) {
149:0 Error (6) script error

if (z_force > -20) {
151:0 Error (19) Parameter unknow keyword in {}

z_force -= 3 * time;
151:0 Error (19) Parameter unknow z_force keyword in {}

ELSE {
151:0 Error (19) Parameter unknow ELSE keyword in {}

z_force = -20; }
151:0 Error (19) Parameter unknow keyword in {}

if (jumping_mode == 0)
153:0 Error (19) Parameter unknow keyword in {}

if (z_force > -20)
154:0 Error (6) script error

z_force -= 3 * time;
154:0 Error (19) Parameter unknow z_force keyword in {}

ELSE {
154:0 Error (19) Parameter unknow ELSE keyword in {}

z_force = -20;
154:0 Error (19) Parameter unknow z_force keyword in {}

if (z_force > -20)
156:0 Error (6) script error

z_force -= 3 * time;
156:0 Error (19) Parameter unknow z_force keyword in {}

ELSE {
156:0 Error (19) Parameter unknow ELSE keyword in {}

z_force = -20;
156:0 Error (19) Parameter unknow z_force keyword in {}



Die Probleme sind alle wieder in:

if (z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
if (jumping_mode == 0)
{
if (z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}
if (z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}

frown






Posted By: Oxy

Re: Wieso geht das nicht!! :mad: - 09/17/08 15:42

der code:

if (key_space == 1) // if we press the space button
{
ent_cycle("jump", my.skill22);
my.skill22 += 5 * time;
wait (1);
(jumping_mode == 1) {
}
(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
(jumping_mode == 0) {
(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}
(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}
}

hat vieeeele fehler


setz erstmal diesen ein, und dann arbeite dich vor
hier sind zumindes die syntaxfehler bearbeitet



if (key_space == 1) // if we press the space button
{
ent_cycle("jump", my.skill22);
my.skill22 += 5 * time;
wait (1);

if (jumping_mode == 1) {
(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}

if (jumping_mode == 0) {
if(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}



} //end if


} //ende action



(mich wundert wie du so viel code schreiben kannst wenn so grundsätzliche fehler
enthalten sind....
Tip: mach beim schreiben ab ubd zu auch mal einen build,
eine andere syntaxprüfung hat 3dgs nicht)




Posted By: MDMDFSS

Re: Wieso geht das nicht!! :mad: - 09/17/08 17:46

ok sind schon mal ein paar errors weg, aber dafür sind andere dazugekommen.
Aber kannst du mit diesen code was anfangen??? (Es geht prima!!):


include<cameras.wdl>;



var video_mode = 7;
var video_depth = 16;
var player_movement;
var jump_speed = 2;
var jump_height = 10;
var jump_time = 1;


var hold_vertex;
var holding=0;
var myspeed;

string lvl_wmb=<lvl.wmb>;



function my_gravity();
function my_jump();
function grabme();


function main()
{
clip_size = 0;
clip_range =2000;
fps_max = 90;
camera.arc=80;
level_load(lvl_wmb);
sleep(1);
}

action bart
{
player=me;
init_camera();
my.event = null;
my_jump();
my_gravity();
my.albedo=0;
my.ambient=-50;
camera.z=my.z+40;
camera.tilt=-10;
my.enable_entity=on;
//my.trigger_range=100;
myspeed=8;
while (1)
{

trace_position=camera_distance+20;
vec_set (temp, my.x);temp.x -= trace_position*cos(camera.pan);temp.y -= trace_position*sin(camera.pan);temp.z = camera.z+10;
trace_mode = ignore_me + ignore_models+ ignore_passable + use_box;
if (trace (my.pos,temp) != 0)&&(camera_distance>10){camera_distance-=20*time;}

trace_position2=camera_distance+40;
vec_set (temp, my.x);temp.x -= trace_position2*cos(camera.pan);temp.y -=trace_position2*sin(camera.pan);temp.z = camera.z+10;
trace_mode = ignore_me + ignore_models + ignore_passable + use_box;
if (trace (my.pos,temp) == 0)&&(camera_distance<maxcam_distance) {camera_distance+=6*time;}



//my.pan += 10 *(key_a - key_d) * time;
//my.pan -= 4 *mouse_force.x;
if(holding==0)
{

if ((key_w == 1) || (key_s == 1))
{

if(myspeed<16)
{
myspeed+=.5*time;
}
else
{
myspeed=16;
}
my.pan=camera.pan;
ent_cycle("walk", my.skill20);
my.skill20 += myspeed * time;
if (my.skill20 > 100) {my.skill20 = 0;}
}
else
{
myspeed=8;
ent_cycle("stand", my.skill20);
my.skill20 += 1 * time;
if (my.skill20 > 100) {my.skill20 = 0;}
}
on_mouse_right = my_jump;
}

if (jump_time !=1)
{
ent_cycle("jump", my.skill20);
my.skill20 += 1 * time;
if (my.skill20 > 100) {my.skill20 = 0;}
}



if(holding==1)
{
myspeed=8;
if ((key_w == 1) || (key_s == 1))
{
my.pan=camera.pan;
ent_cycle("walkhold", my.skill20);
my.skill20 += myspeed * time;
if (my.skill20 > 100) {my.skill20 = 0;}
}
else
{
ent_cycle("grabup", my.skill20);
my.skill20 += 1 * time;
if (my.skill20 > 100) {my.skill20 = 0;}
}

}

if (key_e == 1)
{

ent_cycle("crouch", my.skill20);

}
player_movement.x = myspeed * (key_w-key_s) * time;

my_gravity();
move_mode = IGNORE_YOU +ignore_passable+ use_box+ GLIDE;
result = ent_move(player_movement, nullvector);
wait(1);
}
}





action pickup_act
{
vec_set (temp, my.x);
temp.z -= 2000;
trace_mode = ignore_me + ignore_sprites + ignore_models + use_box;
my.z- = trace(my.x, temp);
my.ambient = -50;
my.albedo=0;
while (player==null){wait(1);}
my.enable_impact=on;
my.event=grabme;
}






function my_gravity()
{
vec_set (temp, my.x);
temp.z -= 2000;
trace_mode = ignore_me + ignore_sprites + ignore_models + use_box;
my.skill11 = trace(my.x, temp);
if (my.skill11 > 2)
{
player_movement.z -= .8 * time;
}
else
{
if (jump_time == 1)
{
player_movement.z = 0;
}
}
if (my.skill11 < 0)
{
player_movement.z += 6 * time;
}
}

function my_jump()
{
exclusive_global;
jump_time = 1;
while (jump_time > -1)
{
on_mouse_right = null;
player_movement.z = jump_height * time * jump_time;
jump_time -= 0.14 * time;
wait (1);
}
jump_time = 1;
}








function grabme()
{
my.event=null;
if(holding==0)
{

while(vec_dist(my.x,player.x)<50)&&(holding==0)
{
if (key_e == 1)
{
if(holding==0)
{
holding=1;
}
else
{
holding=0;
}
while (key_e==1)
{
vec_for_vertex(hold_vertex,player,1499);
my.x=hold_vertex.x;my.y=hold_vertex.y;my.z=hold_vertex.z;my.pan=player.pan;
wait(1);
}
}
wait(1);
}


while (holding==1)&&(vec_dist(my.x,player.x)<50)
{
proc_late();
vec_for_vertex(hold_vertex,player,1499);
my.x=hold_vertex.x;my.y=hold_vertex.y;my.z=hold_vertex.z;my.pan=player.pan;

if (key_e == 1)
{
if(holding==0)
{
holding=1;
}
else
{
holding=0;
}
while (key_e==1)
{
vec_for_vertex(hold_vertex,player,1499);
my.x=hold_vertex.x;my.y=hold_vertex.y;my.z=hold_vertex.z;my.pan=player.pan;
wait(1);
}
}


wait(1);
}
vec_set (temp, my.x);
temp.z -= 200;
trace_mode = ignore_me +ignore_sprites +ignore_models + use_box;
my.z- = trace(my.x, temp);
wait(1);
vec_set (temp, my.x);
temp.z -= 200;
trace_mode = ignore_me +ignore_sprites +ignore_models + use_box;
my.z- = trace(my.x, temp);
}


my.event=grabme;
}



wenn du den include<cameras.wdl> sehen wilst dan schreib es mir.
Posted By: HPW

Re: Wieso geht das nicht!! :mad: - 09/17/08 21:02

Die Variable time solltest du durch time_step ersetzen, time ist veraltet.
sleep() ist auch alt, dafür gibt es wait() mit negativen Zahlen. Also für wait(1) wird ein Frame gewartet und für wait(-1) wird eine Sekunde gewartet.

Welche Fehlermeldungen sind denn jetzt noch da?
Posted By: MDMDFSS

Re: Wieso geht das nicht!! :mad: - 09/18/08 12:29

Meinst du es so:

if (key_space == 1) // if we press the space button
{
ent_cycle("jump", my.skill22);
my.skill22 += 5 * time_step;
wait (-1);

if (jumping_mode == 1) {
(z_force > -20) { z_force -= 3 * time_step; } ELSE { z_force = -20; }
}

if (jumping_mode == 0) {
if(z_force > -20) { z_force -= 3 * time_step; } ELSE { z_force = -20; }
}



} //end if


} //ende action
Posted By: HPW

Re: Wieso geht das nicht!! :mad: - 09/18/08 19:39

Naja, nicht da wo du vorher wait(1) für einen Frame warten hattest, sondern da wo du sleep(1) verwendet hattest solltest du wait(-1) schreiben:

function main()
{
clip_size = 0;
clip_range =2000;
fps_max = 90;
camera.arc=80;
level_load(lvl_wmb);
wait(-1); // sleep(1); alten Code ersetzen. wink
}
Posted By: MDMDFSS

Re: Wieso geht das nicht!! :mad: - 09/23/08 17:10

jetzt sind so viele Fehlermeldungen, das ich sie nicht alle aufschreiben kann, wortwörtlich alles, plus die Fehlermeldungen die ich vorher schrieb.

weiß du was ich habe bald das Geld für 3D Gamestudios 7 pro zusammen, und da ist schon ein script vom einen schwertkämpfer der springen kann und alles.
Aber mich wird schon interesieren wieso es nicht klappen will, ich habe irgenwie keine physic ist extra das gleich wie pro???
Posted By: Gordon_Shumway

Re: Wieso geht das nicht!! :mad: - 09/27/08 21:57

Hi MDMDFSS,

wenn ich mir deine tausen Fehler so anschaue, sieht das aus, als ob du eine Klammer zu viel oder zu wenig hast.
Ich habe mir dein allerstes Script mal angesehen:
In der action player_fight // attached to the player
hast du, wenn mich nicht alles täuscht 21 mal { und 22 mal }

Ich hoffe, ich habe mich nicht verzählt, oder jemand anderes hatte das schon geschrieben.

Kannst ja mal schauen, ob es daran liegt.

G.S.
© 2024 lite-C Forums