Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Aku_Aku, 7th_zorro, Ayumi), 1,050 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
die engine is fies #251925
02/15/09 16:32
02/15/09 16:32
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline OP
User
hopfel  Offline OP
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
Hallo

ich habe ein kleines Problem mit einer Variable. Der Code ist so einfach, der müsste ja eigentlich gut funktionieren; Tut er aber nicht. Die Engine stürzt ab. Hier ein Teil der Funktion, die sich auf das Problem beziehen könnte:

.
.
.

function panzerketten()
{
var hohe=20;
var jumpen=0;
.
.
.
var aufbo=0;
.
.
.
panzket=me;
while(1)
{
.
.
.
aufbo=c_move(my,vector(0,0,-6*time_step),vector(0,0,0 ),GLIDE+IGNORE_MODELS);

.
.
.


if(key_b&&jumpen==0)
jumpen=1;
if(jumpen==1)
{
c_move(my,vector(0,0,hohe*time_step),vector(0,0,0 ),GLIDE+IGNORE_MODELS);
if(hohe>0)
hohe-=0.5*time_step;
if(hohe<18&&aufbo<0.2)
{
hohe=20; <-- Nehme ich diese Zeile weg funktioniert es
jumpen=0;
}}


wait(1);
}
}


.
.
.


Hilf mir, dir zu helfen!
Re: die engine is fies [Re: hopfel] #251929
02/15/09 16:47
02/15/09 16:47
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Your problem description is not clear, but I dont read german... BUT
Code:
aufbo=c_move(my,vector(0,0,-6*time_step),vector(0,0,0 ),GLIDE+IGNORE_MODELS);
should be                                      v(a bit)     v(a LOT)
aufbo=c_move(my, vector(0,0,-6*time_step), nullvector, GLIDE|IGNORE_MODELS);
AND each 'part' of an if should have brackets like so
Code:
if(key_b&&jumpen==0)
should be
if((key_b)&&(jumpen==0))

and later on 

if(hohe<18&&aufbo<0.2)
should be
if((hohe<18)&&(aufbo<0.2))
Otherwise odd things can happen.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: die engine is fies [Re: EvilSOB] #252161
02/16/09 21:03
02/16/09 21:03
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline OP
User
hopfel  Offline OP
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
That can't be the problem. because it work when I leave out "hohe=20".


Hilf mir, dir zu helfen!
Re: die engine is fies [Re: hopfel] #252216
02/17/09 07:10
02/17/09 07:10
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Good, you know english.
Whats the actual problem? What is it doing/not doing?
What "should" happen? And what happens then you put hohe=20; in?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: die engine is fies [Re: EvilSOB] #252462
02/18/09 12:03
02/18/09 12:03
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline OP
User
hopfel  Offline OP
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
I dont speak english well^^ When my phrase was right it was luck. smile
Whith "hohe=20;" the engine shut down. When I delete this, my game works. I think it's a bug in the engine...


Hilf mir, dir zu helfen!
Re: die engine is fies [Re: hopfel] #252464
02/18/09 12:13
02/18/09 12:13
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
OK english is OK wink
Nothing looks really bad, can you post the whole function?
The problem may be in another part of it.
And I know which bit the problem comes from now.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: die engine is fies [Re: EvilSOB] #252640
02/19/09 11:53
02/19/09 11:53
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline OP
User
hopfel  Offline OP
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
here's the whole code, that's easier(<-- right?).




#include <acknex.h>
#include <default.c>
#include "explosion.c"


ANGLE rohr_ang;
ENTITY* kabumm;
ENTITY* panz;
ENTITY* panzket;
ENTITY* rack;
BMAP* rau="smoke.tga";


function effect_ra(PARTICLE *p)
{

var temp[3];
spark_randomize(temp, 4);
vec_add (p.vel_x, temp);
p.bmap = rau;
p.flags |= (BRIGHT | MOVE | TRANSLUCENT);
p.lifespan = spark_lifespan;
p.size = 4 * ScaleFactor;
p.event = spark_alphafade;
}
function pang()
{
media_tune(media_play("pistolenschuss.wav",NULL,100),0,60,0);
}
function pang2()
{
media_tune(media_play("pistolenschuss.wav",NULL,200),0,30,0);
}

function rakete()
{
var bumm;
rack=me;
while(my)
{
bumm=c_move(my,vector(10*time_step,0,0),vector(0,0,0 ),IGNORE_MODELS);
my.tilt-=0.5*time_step;
effect(effect_ra, 2, my.x, normal);
if(bumm<1)
{

effect(effect_flame, 100, my.x, normal);
effect(effect_smoke, 50, my.x, normal);
effect(effect_dust, 50, my.x, normal);
pang2();
short i = 0;
for(i; i<7; i++)
{
kabumm=ent_create("bullet.mdl", my.x, explo_spark);
}


ent_remove(my);
}
wait(1);
}}

function panzerketten()
{
var hohe=20;
var jumpen=0;
var gschw=0;
var aufbo=0;
var feuer=0;
var feuerhilfe=0;
VECTOR* abroh;
var fahren=0;
var schuss=0;
vec_set(abroh,nullvector);
panzket=me;
while(1)
{
vec_for_bone(abroh,panz,"bone3");

if(fahren<1)
fahren=100;
fahren-=gschw*time_step;
ent_animate(my, "fahren", fahren, ANM_CYCLE);

vec_set(camera.x,vector(-200,0,60));
vec_rotate(camera.x,vector(panz.pan,panz.tilt-30,panz.roll));
vec_add(camera.x,panz.x);
vec_set(camera.pan,nullvector);
ang_add(camera.pan,vector(panz.pan,panz.tilt-30,panz.roll));
vec_set(panz.pan,my.pan);
vec_set(panz.x,my.x);
my.pan+=2*(key_cul-key_cur)*time_step;
c_move(my,vector(gschw*time_step,0,0),vector(0,0,0 ),GLIDE+IGNORE_MODELS);
aufbo=c_move(my,vector(0,0,-6*time_step),vector(0,0,0 ),GLIDE+IGNORE_MODELS);
c_move(panz,vector(gschw*time_step,0,0),vector(0,0,0 ),GLIDE+IGNORE_MODELS);
c_move(panz,vector(0,0,-6*time_step),vector(0,0,0 ),GLIDE+IGNORE_MODELS);

if(key_cuu&&gschw<4)
gschw+=0.4*time_step;
if(key_cud&&gschw>-4)
gschw-=0.4*time_step;


if(key_q&&rohr_ang.tilt<20&&feuer==0||feuer==1)
rohr_ang.tilt+=3*time_step;
if(key_a&&rohr_ang.tilt>-10&&feuer==0||feuer==1)
rohr_ang.tilt-=3*time_step;

ent_bonereset(panz,"bone2");
ent_bonerotate(panz,"bone2",rohr_ang);


if(key_space&&feuer==0)
feuer=1;


if(feuer==1)
{
if(feuerhilfe==0)
{
rack=ent_create("rack.mdl", abroh, rakete);
rack.tilt=rohr_ang.tilt;
rack.pan=my.pan;


effect(effect_flame, 100, abroh.x, normal);
effect(effect_smoke, 50, abroh.x, normal);
effect(effect_dust, 50, abroh.x, normal);
pang();
short i = 0;
for(i; i<7; i++)
{
kabumm=ent_create("bullet.mdl", abroh.x, explo_spark);
}
feuerhilfe=1;
}

if(schuss>0)
ent_animate(panz, NULL,NULL, ANM_CYCLE);

schuss+=6*time_step;
if(schuss>0)
ent_animate(panz, "schuss", schuss, ANM_ADD+ANM_CYCLE);
if(schuss>100)
{
schuss=0;
feuer=0;feuerhilfe=0;
}}

if(key_b&&jumpen==0)
jumpen=1;
if(jumpen==1)
{
c_move(my,vector(0,0,hohe*time_step),vector(0,0,0 ),GLIDE+IGNORE_MODELS);
c_move(panz,vector(0,0,hohe*time_step),vector(0,0,0 ),GLIDE+IGNORE_MODELS);
if(hohe>0)
hohe-=0.5*time_step;
if(hohe<18&&aufbo<0.2)
{
jumpen=0;
}
}

wait(1);
}}



function main()
{
video_mode=8;
video_screen=1;
level_load ("menue.wmb");
wait(-2);
panz=ent_create("panzer.mdl", vector(0, 0,0), NULL);
panzket=ent_create("panzerketten2.mdl", vector(0, 0,0), panzerketten);
//media_loop("musik.mp3",NULL,100);
while (1)
{
wait(1);
}
}


Hilf mir, dir zu helfen!
Re: die engine is fies [Re: hopfel] #252654
02/19/09 13:24
02/19/09 13:24
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
Schreib doch mal dazu mit welcher Fehlermeldung die Engine abstürzt, und ob es beim Springen/bewegen oder so ist.

Re: die engine is fies [Re: hopfel] #252657
02/19/09 13:40
02/19/09 13:40
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
AFTER I changed "VECTOR* abroh;" to be "VECTOR abroh;",
then it works OK for me, with everything related to "explosion.c" disabled.
(with hohe=20; both in and out)

If that doesnt help you, please post explosion.c also.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: die engine is fies [Re: EvilSOB] #252663
02/19/09 14:15
02/19/09 14:15
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline OP
User
hopfel  Offline OP
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
Yes, it works now. smile Thank you very much^^


Hilf mir, dir zu helfen!
Page 1 of 2 1 2

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