Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Mein Code funktioniert nicht!!! #263591
04/30/09 17:41
04/30/09 17:41
Joined: Apr 2009
Posts: 274
atari98 Offline OP
Member
atari98  Offline OP
Member

Joined: Apr 2009
Posts: 274
Ich habe in diesem Code einen ent_animate code mit eingefügt und jetzt funktioniert weder noch die animation noch das Game.Es komt nur eine Fehlermeldung.

Was hab ich falsch gemacht.Der Name der Animation ist doch "Fly"

Der Code:


///////////////////////////////
#include <acknex.h>
#include <default.c>

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

function main()
{
level_load ("homework18.wmb");
wait (2);
vec_set(camera.x,vector(0,-480,1000)); // set a static position for the camera
vec_set(camera.pan,vector(90,-68,0)); // set the correct orientation for the camera
}

action my_car()
{
while (1)
{

if (key_d)
my.pan -= 3*time_step; // decrease the pan angle of the car
if (key_w ) // press and hold the "Space" key to move the car
c_move (my, vector(15*time_step, 0, 0), nullvector, GLIDE);
if (key_s ) // press and hold the "Space" key to move the car
c_move (my, vector(-15*time_step, 0, 0), nullvector, GLIDE);
if (key_cul)
my.roll += 3*time_step; // increase the pan angle of the car
if (key_cur)
my.roll -= 3*time_step; // decrease the pan angle of the car
if (key_cuu ) // press and hold the "Space" key to move the car
my.tilt += 3*time_step; // increase the pan angle of the car
if (key_cud ) // press and hold the "Space" key to move the car
my.tilt -= 3*time_step; // increase the pan angle of the car
// move the car using relative_speed

wait (1);

ent_animate(me,"fly",my.fly,ANM_CYCLE);



}
}


Schon mal danke im Vorraus.

Gruss
Atari98


Meine Fun Websiten
www.free4-fun.de.tl

www.gamer-liga-live.de.tl

Meine Game-Projekt Websiten
www.gamer-projects.de.tl
Re: Mein Code funktioniert nicht!!! [Re: atari98] #263593
04/30/09 17:58
04/30/09 17:58
Joined: Apr 2008
Posts: 245
GameScore Offline
Member
GameScore  Offline
Member

Joined: Apr 2008
Posts: 245
als erstes musst du ganz am anfang im script ne variable für die geschwindigkeit der animation definieren

var anim_speed; // variable für die animations geschwindigkeit

und dann sollte der code so lauten

{

ent_animate(my, "fly", anim_speed, ANM_CYCLE);
anim_speed +=1.5*time_step;
}

mit der zahl 1.5 musst du natürlich ausprobieren ob die geschwindigkeit zur animation passt

es wäre auch hilfreich was für fehlercodes beim spielstart kommen

Re: Mein Code funktioniert nicht!!! [Re: atari98] #263941
05/03/09 12:12
05/03/09 12:12
Joined: Apr 2009
Posts: 274
atari98 Offline OP
Member
atari98  Offline OP
Member

Joined: Apr 2009
Posts: 274
Hab ich eingefügt sieht jetzt so aus und funktioniert immer noch nicht:


///////////////////////////////
#include <acknex.h>
#include <default.c>

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

function main()
{
level_load ("homework18.wmb");
wait (2);
vec_set(camera.x,vector(0,-480,1000)); // set a static position for the camera
vec_set(camera.pan,vector(90,-68,0)); // set the correct orientation for the camera
}


{

ent_animate(my, "fly", anim_speed, ANM_CYCLE);
anim_speed += 16*time_step;
}


action my_car()
{
while (1)

{

if (key_d)
my.pan -= 3*time_step; // decrease the pan angle of the car
if (key_w ) // press and hold the "Space" key to move the car
c_move (my, vector(15*time_step, 0, 0), nullvector, GLIDE);
if (key_s ) // press and hold the "Space" key to move the car
c_move (my, vector(-15*time_step, 0, 0), nullvector, GLIDE);
if (key_cul)
my.roll += 3*time_step; // increase the pan angle of the car
if (key_cur)
my.roll -= 3*time_step; // decrease the pan angle of the car
if (key_cuu ) // press and hold the "Space" key to move the car
my.tilt += 3*time_step; // increase the pan angle of the car
if (key_cud ) // press and hold the "Space" key to move the car
my.tilt -= 3*time_step; // increase the pan angle of the car
// move the car using relative_speed

wait (1);



}
}



Da wird immer angezeigt:`anim speed´ undeclared identifier


Kann mir jemand helfen!!!


Meine Fun Websiten
www.free4-fun.de.tl

www.gamer-liga-live.de.tl

Meine Game-Projekt Websiten
www.gamer-projects.de.tl
Re: Mein Code funktioniert nicht!!! [Re: atari98] #263970
05/03/09 14:53
05/03/09 14:53
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Lies die Antwort von GameScore genau durch, dort ist die Lösung.

Kleine Hilfe: Zeile 1 + 2!

Re: Mein Code funktioniert nicht!!! [Re: atari98] #263987
05/03/09 17:37
05/03/09 17:37
Joined: Apr 2009
Posts: 274
atari98 Offline OP
Member
atari98  Offline OP
Member

Joined: Apr 2009
Posts: 274
Jetzt funktioniert das mit den Code.Die Engine ladet ganz normal das Level aber der Rotor bewegt sich trotzdem nicht.

Der Code:

///////////////////////////////
#include <acknex.h>
#include <default.c>

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

function main()
{
level_load ("homework18.wmb");
wait (2);
vec_set(camera.x,vector(0,-480,1000)); // set a static position for the camera
vec_set(camera.pan,vector(90,-68,0)); // set the correct orientation for the camera
}


var anim_speed; // variable für die animations geschwindigkeit

{

ent_animate(my, "fly", anim_speed, ANM_CYCLE);
anim_speed += 1.5*time_step;
}


action my_car()
{
while (1)

{

if (key_d)
my.pan -= 3*time_step; // decrease the pan angle of the car
if (key_w ) // press and hold the "Space" key to move the car
c_move (my, vector(15*time_step, 0, 0), nullvector, GLIDE);
if (key_s ) // press and hold the "Space" key to move the car
c_move (my, vector(-15*time_step, 0, 0), nullvector, GLIDE);
if (key_cul)
my.roll += 3*time_step; // increase the pan angle of the car
if (key_cur)
my.roll -= 3*time_step; // decrease the pan angle of the car
if (key_cuu ) // press and hold the "Space" key to move the car
my.tilt += 3*time_step; // increase the pan angle of the car
if (key_cud ) // press and hold the "Space" key to move the car
my.tilt -= 3*time_step; // increase the pan angle of the car
// move the car using relative_speed

wait (1);



}
}


Meine Fun Websiten
www.free4-fun.de.tl

www.gamer-liga-live.de.tl

Meine Game-Projekt Websiten
www.gamer-projects.de.tl
Re: Mein Code funktioniert nicht!!! [Re: atari98] #263996
05/03/09 18:09
05/03/09 18:09
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Dir fehlen scheinbar noch die Grundlagen zum Programmieren. Sehr zum empfehlen: der lite-C Workshop auf der Downloadseite (auch auf deutsch). Hat mir auch ne Menge geholfen. Workshop No. 21 behandelt auch das ent_animate.

Deine zwei Zeilen:

Code:
ent_animate(my, "fly", anim_speed, ANM_CYCLE);
anim_speed += 1.5*time_step;


gehören in die while Schleife der action!! (ohne die Klammern {} )

Last edited by Widi; 05/03/09 19:39.
Re: Mein Code funktioniert nicht!!! [Re: atari98] #264111
05/04/09 11:40
05/04/09 11:40
Joined: Apr 2009
Posts: 274
atari98 Offline OP
Member
atari98  Offline OP
Member

Joined: Apr 2009
Posts: 274
Ja, super jetzt funktionierts.Muss jetzt nur noch die Geschwindigkeit einstellen.

Hab mla folgendes ausprobiert,und zwar das wenn mann "r" drücklt das dann der Rotor angeschaltet wird.Aber der bewegt sich nur wenn ich auf der Taste draufklicke.Soblad ich wieder aufhöre sie zu drücken hört es wieder auf.Für mich Logisch,aber was muss ich einfügen damit sobald ich "r" drücke die, der Roror sch die ganze Zeit bewegt.Ohne das ich das ganze Level lang auf der Taste"R" drauf klicken muss.Sondern nur einn mal.


Der Code:

.....
ent_animate(my, "fly", anim_speed, ANM_CYCLE);
anim_speed += 1000*time_step;
.....


Geht das mit einem While-Lopp,also mit einer While-Schleife oder wie????

Gruss
Atari98


Meine Fun Websiten
www.free4-fun.de.tl

www.gamer-liga-live.de.tl

Meine Game-Projekt Websiten
www.gamer-projects.de.tl
Re: Mein Code funktioniert nicht!!! [Re: atari98] #264126
05/04/09 13:51
05/04/09 13:51
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Wie schon oben gesagt:


MACH DEN WORKSHOP !!!!!


Re: Mein Code funktioniert nicht!!! [Re: atari98] #264137
05/04/09 15:28
05/04/09 15:28
Joined: Apr 2009
Posts: 274
atari98 Offline OP
Member
atari98  Offline OP
Member

Joined: Apr 2009
Posts: 274
Kanns ja jetzt aber das wie im lezten beitrag von mir beschreiben funktioniert nicht!!!!!!!


Meine Fun Websiten
www.free4-fun.de.tl

www.gamer-liga-live.de.tl

Meine Game-Projekt Websiten
www.gamer-projects.de.tl
Re: Mein Code funktioniert nicht!!! [Re: atari98] #264139
05/04/09 15:37
05/04/09 15:37
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
Du musst eine Variable einführen (z.B. motor_an) , diese im Skript abfragen, wie du die Variable key_r abgefragt hast, dann eine Funktion schreiben, in der sowas steht:

function toggle_motor()
{
motor_an = (motor_an == 0);
}


Dann in der main Funktion der Taste r die Funktion zuweisen.

on_r = toggle_motor;

Und wenn du das jetzt nicht verstanden hast, lies die Workshops noch mal.

Page 1 of 3 1 2 3

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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