Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,369 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Animationsproblem #100968
12/04/06 11:39
12/04/06 11:39
Joined: Aug 2005
Posts: 31
F
friebo Offline OP
Newbie
friebo  Offline OP
Newbie
F

Joined: Aug 2005
Posts: 31
Hallo NG,
vllt. kann mir jemand einen Tipp geben.
Habe ein Modell, in dem 4 Animationsszenen (tor1 - tor4) zum Öffnen/Schlissen von Toren enthalten sind. Jedes Tor lässt sich einzeln mit ent_animate öffnen/schliessen.
Dafür habe ich folgende Action:

var tor_animation[5]; // prozentualer Animationsverlauf für die jew. Szene

action test_action
{
While(1)
{
if (key_1) // Taste 1, Tor 1 öffnen
{
tor_animation[1]=100;
while (tor_animation[1] > 0)
{
tor_animationl[1]-=0.150*time;
ent_animate(my,"tor1",tor_animation[1],0);
wait(1);
}
}

if (key_2) // Taste 2, Tor 2 öffnen
{
tor_animation[2]=100;
while (tor_animation[2] > 0)
{
tor_animationl[2]-=0.150*time;
ent_animate(my,"tor2",tor_animation[2],0);
wait(1);
}

if (key_3) // Taste 3, tor 3 öffnen
{
tor_animation[3]=100;
while (tor_animation[3] > 0)
{
tor_animationl[3]-=0.150*time;
ent_animate(my,"tor3",tor_animation[3],0);
wait(1);
}

if (key_4) // Taste 4, Tor 4 offnen
{
tor_animation[4]=100;
while (tor_animation[4] > 0)
{
tor_animationl[4]-=0.150*time;
ent_animate(my,"tor4",tor_animation[4],0);
wait(1);
}

if (key_z) /// ****** Taste Y, Tor1 schliessen
{
tor_animation[1]=-1;
while (tor_animation[1] <100)
{
tor_animation[1]+=0.150*time;
ent_animate(my,"tor1",tor_animation[1],0);
wait(1);
}
}

if (key_x) // Taste x, Tor 2 schliessen
{
tor_animation[2]=-1;
while (tor_animation[2] <100)
{
tor_animation[2]+=0.150*time;
ent_animate(my,"tor2",tor_animation[2],0);
wait(1);
}
}

if (key_c) // Taste c, Tor 3 schliessen
{
tor_animation[3]=-1;
while (tor_animation[3] <100)
{
tor_animation[3]+=0.150*time;
ent_animate(my,"tor3",tor_animation[3],0);
wait(1);
}
}

if (key_v) // Taste v, Tor 4 schliessen
{
tor_animation[4]=-1;
while (tor_animation[4] <100)
{
tor_animation[4]+=0.150*time;
ent_animate(my,"tor4",tor_animation[4],0);
wait(1);
}
}
wait(1);
}
} // Ende Action

So weit so gut. Jetzt möchte ich erreichen, dass ein geöffnetes Tor auch geöffnet bleibt, sobald ein weiteres Tor mit ent_animate angesprochen wird.
Wenn man in dieser Action die Taste '1' drückt, öffnet sich das entsprechende Tor1.
Wird anschl. z.B. Taste '3' gedrückt, schliesst sich Tor1 blitzschnell und Tor 3 wird normal geöffnet. Wie gesagt, ein bereits geöffnetes Tor soll geöffnet bleiben, auch wenn weitere Tore angesprochen werden. Habe es mit ent_frame und ent_cycle auch schon probiert. das funktioniert auch nicht so.
Auch wenn in der jeweiligen Szene z.B.

ent_animate(my,"tor3",tor_animation[3],0);

durch
ent_animate(my,"tor3",tor_animation[3],1);
oder durch
ent_animate(my,"tor2",tor_animation[3],ANM_ADD);
ersetzt wird, ändert sich nichts.

In MED habe ich folgende Frames:
Name.............Num
frame 0.........0
tor1 0............1 // öffnen
tor1 1............2 // schliessen
tor2 0............3 // öffnen
tor2 1............4 // schliessen
tor3 0............5 // öffnen
tor3 1............6 // schliessen
tor4 0............7 // öffnen
tor4 1............8 // schliessen

Wäre für Hilfe wirklich dankbar.
gruss
friebo

Re: Animationsproblem [Re: friebo] #100969
12/06/06 16:10
12/06/06 16:10
Joined: Nov 2006
Posts: 18
Deutschland, Gelsenkirchen / ...
D
DukE_7009 Offline
Newbie
DukE_7009  Offline
Newbie
D

Joined: Nov 2006
Posts: 18
Deutschland, Gelsenkirchen / ...
Sind die Tore ein Modell? Benutze doch lieber vier einzelne Modelle. Wenn es einzelne sind, dann benutz doch anstelle von animate einfach my.z += x, etc.

Last edited by DukE_7009; 12/06/06 16:20.

Come, get some!

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