0 registered members (),
1,459
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Whats wrong here?
#291554
09/26/09 12:27
09/26/09 12:27
|
Joined: Jul 2009
Posts: 150
Blackchuck
OP
Member
|
OP
Member
Joined: Jul 2009
Posts: 150
|
When I start my game, it waits 2 secones and then it closes down, without any warning, errors or stuff like that. I meen whats wrong there everithing looks fine; _____________________________________________________________________
/////////////////////////////////////////////////////////////// #include <acknex.h> #include <default.c> /////////////////////////////////////////////////////////////// PANEL* pSplash = { bmap = "logo_800.jpg"; } /////////////////////////////////////////////////////////////// VECTOR player_force; /////////////////////////////////////////////////////////////// ENTITY* ball; ///////////////////////////////////////////////////////////////
function main() { video_screen = 1; video_mode = 7; shadow_stencil = 1; sound_vol = 100; level_load("extrem1.wmb"); ent_createlayer("blood_gsmall+6.tga", SKY | CUBE | VISIBLE, 0); handle = media_loop("1.mp3",NULL,50); player = ent_create ("ball.mdl", vector(6941, 7142, 3791), NULL); my.material = mat_metal; set(my,SHADOW); ph_setgravity(vector(0,0,-500)); phent_settype (player, PH_RIGID, PH_SPHERE); phent_setmass (player, 10, PH_SPHERE); phent_setfriction (player, 35); phent_setdamping (player, 40, 99); phent_setelasticity (player, 8, 20); while (1) { player_force.x = 230 * time_step * (key_d - key_a); player_force.y = 230 * time_step * (key_w - key_s); player_force.z = 0; phent_addtorqueglobal (player, player_force); if(key_space == 1) { phent_addvelglobal(player, vector(0,0,0), nullvector); } camera.x = player.x - 29; camera.y = player.y; camera.z = player.z + 15; camera.tilt = -5; wait (1); } }
var time;
action stones() { set(my,SHADOW); my.material = mat_metal; phent_addvelcentral(my,vector(10,10,0)); ph_setgravity(vector(0,0,-500)); phent_settype (my, PH_RIGID, PH_BOX); phent_setmass (my, 25, PH_BOX); phent_setfriction (my, 99); phent_setdamping (my, 40, 40); phent_setelasticity (my, 10, 20); } action ballgenerator1() { ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); ent_create ("stoneball.mdl", vector(29323, -28503, 4176), ball); wait(-3); return; } function ball() { set(my,SHADOW); my.material = mat_metal; phent_addvelcentral(my,vector(10,10,0)); ph_setgravity(vector(0,0,-500)); phent_settype (my, PH_RIGID, PH_SPHERE); phent_setmass (my, 99, PH_SPHERE); phent_setfriction (my, 99); phent_setdamping (my, 0, 0); phent_setelasticity (my, 8, 100); }
action slicing_blades() { set(my,SHADOW); my.material = mat_metal; my.tilt += time_step; wait(1); } while (!player) {wait (1);} while(1) { if (vec_dist (player.x, my.x) < 100) { time_factor = 0.1; } else time_factor = 1; wait (1); } action DynLight() { set (my, INVISIBLE); set (my, PASSABLE); my.red = 255; my.green = 255; my.blue = 255; my.lightrange = 1000; }
action TERRAIN() { set(my,SHADOW); my.material = mat_metal; return; }
action LAVA() { set(my,SHADOW); set( my, POLYGON); my.material = mat_metal; my.emask |= ENABLE_DETECT | ENABLE_SHOOT | ENABLE_ENTITY | ENABLE_SCAN; c_setminmax(my); while (!player) {wait (1);} while(1) { if (vec_dist (player.x, my.x) < 25) { level_load ("extrem1.wmb"); } } }
I have know Gamestudio/A7 Commercial Edition 7.84
|
|
|
Re: Whats wrong here?
[Re: Blackchuck]
#291580
09/26/09 16:12
09/26/09 16:12
|
Joined: Sep 2006
Posts: 99 BS, Germany
Storm_Mortis
Junior Member
|
Junior Member
Joined: Sep 2006
Posts: 99
BS, Germany
|
first take a look at you acklog.txt! there are errors listet in most cases... if you dont have one, chekc in sed -> preferences -> diag
maybe you'll find you error right away^^
hope this was helpful!
it found a voice ... now it needs a body
|
|
|
Re: Whats wrong here?
[Re: Storm_Mortis]
#291582
09/26/09 16:20
09/26/09 16:20
|
Joined: Jul 2009
Posts: 150
Blackchuck
OP
Member
|
OP
Member
Joined: Jul 2009
Posts: 150
|
thanke you, but both didn`t find something.
I have know Gamestudio/A7 Commercial Edition 7.84
|
|
|
Re: Whats wrong here?
[Re: Blackchuck]
#291585
09/26/09 16:23
09/26/09 16:23
|
Joined: Sep 2006
Posts: 99 BS, Germany
Storm_Mortis
Junior Member
|
Junior Member
Joined: Sep 2006
Posts: 99
BS, Germany
|
Well thats kinda strange ... but i don,t have time to take a look myself atm ... sry.
try to comment things that aren't needed to start, and than (re-)add part by part to find the eroor. could help...
it found a voice ... now it needs a body
|
|
|
Re: Whats wrong here?
[Re: Mageron]
#291589
09/26/09 16:30
09/26/09 16:30
|
Joined: Sep 2006
Posts: 99 BS, Germany
Storm_Mortis
Junior Member
|
Junior Member
Joined: Sep 2006
Posts: 99
BS, Germany
|
There is Missing a wait(1);, right! every "while" need something to wait or somewhat altering the case. if there isn't one of these, it will run endless in one frame and crash!
Last edited by Storm_Mortis; 09/26/09 16:30.
it found a voice ... now it needs a body
|
|
|
Re: Whats wrong here?
[Re: Storm_Mortis]
#291685
09/27/09 14:03
09/27/09 14:03
|
Joined: Jul 2009
Posts: 150
Blackchuck
OP
Member
|
OP
Member
Joined: Jul 2009
Posts: 150
|
sry, but that didn`t work ever. Then I just deleted action LAVA() so I can test my game. But it still didn`t work, theres somewere else the problem. still thanks
I have know Gamestudio/A7 Commercial Edition 7.84
|
|
|
Re: Whats wrong here?
[Re: Blackchuck]
#292511
10/04/09 11:57
10/04/09 11:57
|
Joined: Jul 2009
Posts: 150
Blackchuck
OP
Member
|
OP
Member
Joined: Jul 2009
Posts: 150
|
Now I tryed to do this with newton, but it has the same problem. Does somebody know how to script with the newton WrapperLitec (newton Wrapper2)? Here is my try, what am I doing wrong?
/////////////////////////////////////////////////////////////// #include <acknex.h> #include <default.c> //#include <mtlFX.c> #include <d3d9.h> ///////////////////////////////
float QUANTTOMETER = 0.03125; float METERTOQUANT = 32; ///////////////////////////////////////////////////////////////
#include "NewtonMain2.18.c" #include "NewtonAPI2.18.c" ///////////////////////////////////////////////////////////////
NewtonWorld* nworld; ///////////////////////////////////////////////////////////////
#include "matrix.c" #include "newton_materials.c" #include "newton_main.c" #include "newton_debug.c" ///////////////////////////////////////////////////////////////
void quit() { newton_stop(); } ///////////////////////////////////////////////////////////////
VECTOR player_force; /////////////////////////////////////////////////////////////// function main() { video_screen = 1; video_mode = 8; shadow_stencil = 1; sound_vol = 100; level_load("extrem1.wmb"); ent_createlayer("blood_gsmall+6.tga", SKY | CUBE | VISIBLE, 0); handle = media_loop("1.mp3",NULL,50); wait(2); newton_start(); on_exit = quit;
while(1) { newton_update(); wait(1); } }
action ballplayer() { player = me; wait(3); newton_addentity(player, 5, NEWTON_SPHERE, onforceandtorque); while (1) { player_force.x = 380 * time_step * (key_d - key_a); player_force.y = 380 * time_step * (key_w - key_s); player_force.z = 0; phent_addtorqueglobal (player, player_force); camera.x = player.x - 29; camera.y = player.y; camera.z = player.z + 15; camera.tilt = -5; wait (1); } }
action Brige() { my.push=100; set(my,FLAG8); reset(my,DYNAMIC); wait(1); c_setminmax(me); }
action stone() { set(my,SHADOW); my.material = mat_metal; newton_addentity(me, 75, NEWTON_SPHERE, onforceandtorque); } ///////////////////////////////////////////////////////////////
I have know Gamestudio/A7 Commercial Edition 7.84
|
|
|
Re: Whats wrong here?
[Re: Blackchuck]
#292516
10/04/09 12:51
10/04/09 12:51
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi!
one thing that I saw.
Put a wait(2) after level_load("extrem1.wmb");
Just a question about while(1) { newton_update(); wait(1); } Is this at the right place in main. Does the code get to this part of main?
Hope this helps! Ottawa Ver 7.86.2 Pro and Lite-C
|
|
|
Re: Whats wrong here?
[Re: Ottawa]
#292520
10/04/09 13:38
10/04/09 13:38
|
Joined: Jul 2009
Posts: 150
Blackchuck
OP
Member
|
OP
Member
Joined: Jul 2009
Posts: 150
|
It`s becose when I start my without "wait(2);" the level starts but a warning shows up;
Malfunction W1600
Entity not a physics objeckt in ballplayer
And everitime I press "ok" the warning shows up again, and again, and again, and again...
Last edited by Blackchuck; 10/04/09 13:39.
I have know Gamestudio/A7 Commercial Edition 7.84
|
|
|
|