Gamestudio Links
Zorro Links
Newest Posts
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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Animation in While! [Re: Slin] #174853
12/27/07 14:55
12/27/07 14:55
Joined: Apr 2006
Posts: 58
Moerk Offline OP
Junior Member
Moerk  Offline OP
Junior Member

Joined: Apr 2006
Posts: 58
Habe ich bereits gemacht! Das funktioniert... allerdings verwende ich die Methode

"proc_status(function) == 0"

bevor er das überhaupt startet. Das Problem habe ich vor kurzem in einem anderen Thread behandelt.

Jetzt geht das eben nur bis zu diesem bestimmten Teil (ANimationen) Das ist mein neues Problem

Aber jetzt erstmal VIELEN DANK an alle bisher für die Hilfe ich schau mal im Blog nach und geb dann nochmal Bescheid..


"Die Kette die mich ewig hält möge man erst noch schmieden" Regina S.
Re: Animation in While! [Re: Moerk] #174854
12/27/07 15:16
12/27/07 15:16
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Quote:

Well ok but i start that script in another while loop

Code:
if(mouse_left && proc_status(attackit) == 0)
{
attackit();
}



the while loop isnt a good solution in this way!




Maybe you could call the function( attackit(); ) out of the while loop from the action you're using it in and set the if statement ( if(mouse_left && proc_status(attackit) == 0) ) inside the while loop of the initial function ( attackit ).

Here the example:
Code:
 
action mainplayer() // this is the action you're calling the function from
{
// your code
attackit(); // call the function out of the while loop
while (player != null)
{
// your code
wait(1);
}
}

function attackit
{
proc_kill(4); // makes sure that only one instance of this function running so proc_status isn't needed here ^^
ani_attack1_speed = 8;
ani_attack2_speed = 8;
while(player != null)
{
randomize();
my.attack_choose = int(random(2));
if(mouse_left && my.attack_choose == 0)
{
while (ani_attack1 < 100) // Solange ani....
{
ani_attack1 += (ani_attack_speed * time_step)%100; // Ani Speed
ent_animate(my, "attack", ani_attack1, 0); // Ani Bfehl
wait(1);
}
ani_attack1 = 0;
}
if(mouse_left && my.attack_choose == 1)
{
while (ani_attack2 < 100) // Solange ani....
{
ani_attack2 += (ani_attack2_speed * time_step)%100; // Ani Speed
ent_animate(my, "attack2", ani_attack2, 0); // Ani Bfehl
wait(1);
}
ani_attack2 = 0;
}
wait(1);
}
}



This is another approach but basically this should work and the animations should run properly

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Animation in While! [Re: frazzle] #174855
12/27/07 16:22
12/27/07 16:22
Joined: Apr 2006
Posts: 58
Moerk Offline OP
Junior Member
Moerk  Offline OP
Junior Member

Joined: Apr 2006
Posts: 58
Thanks frazzle i found another solution to bring it to work.

Now i got a new big problem -.- Sorry for that guys!

Code:
function attackit
{
ani_attack1 = 0;
anilauft = 0;
//randomize();
my.attack_choose = 0;
while(anilauft != 1)
{
if(my.attack_choose == 0)
{
ent_animate(my,NULL,0,0);
ani_attack1 += (8 * time_step)%100; // Ani Speed
ent_animate(my, "attack", ani_attack1,anm_cycle+anm_add); // Ani Bfehl
if(ani_attack1 >= 100)
{
ent_animate(my,NULL,0,0);
ani_attack1 = 0;
anilauft = 1;
}
}
wait(1);
}
}

////////////////Action///////////////
action Player_Function
{
...
while(1) // Lebensenergie_Player > 0
{

//Tastatureingabe
Tastatur.x = (key_w - key_s);
Tastatur.y = (key_a - key_d);

//Animation
if(abs(Tastatur.x) == 0 && abs(Tastatur.y) == 0 && abs(Tastatur.z) == 0)
{
ani_stand = (ani_stand + 1*time_step)%100;
ent_animate(my,"stand",ani_stand,anm_cycle);
}
if(abs(Tastatur.x) == 1)
{
ani_walk = (ani_walk + Tastatur.x*time_step*6)%100;
ent_animate(my,"walk",ani_walk,anm_cycle);
}
if(mouse_left && proc_status(attackit) == 0)
{
attackit();
}



I forgot to say that i´m using bones and i think also a vertex animation ^^

The "walk" and "stand" animation works fine. I want to add the "attack" animation with "anm_add". The Problem is it doesn´t work. If i click on my left mouse button nothing happens. Only the walk or stand animation works but the attack animation don´t work. If i jump or walk left or right i didn´t create an animation yet. In this moment the attack animation works fine.

Why isn´t it working in combination with the animation and why is it working without animation?

Please help i´m going to kill myself!! Oo


"Die Kette die mich ewig hält möge man erst noch schmieden" Regina S.
Re: Animation in While! [Re: Moerk] #174856
12/27/07 17:53
12/27/07 17:53
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Killing youself will not bring the answer
But I find it wierd that you use anm_cycle and anm_add in combination but I'm guessing that there must be better methodes for blending animations. Try searching for this on the forum, I think DavidLancaster has made a great way of blending animations
Btw, why combining bone and vertex animations ??

Thanks in progress

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Animation in While! [Re: frazzle] #174857
12/27/07 18:05
12/27/07 18:05
Joined: Apr 2006
Posts: 58
Moerk Offline OP
Junior Member
Moerk  Offline OP
Junior Member

Joined: Apr 2006
Posts: 58
Ok it seems that it won´t work. I give up and search for a model without bones

Thanks for all!

Greetz!


"Die Kette die mich ewig hält möge man erst noch schmieden" Regina S.
Re: Animation in While! [Re: Moerk] #174858
12/27/07 22:30
12/27/07 22:30
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Vertex animations through code is also abit easier as handling bone animations through code. So logic, the blending part would be more complex when using bones But whereas the animations itself can be created more smoothly via bones than doing it the vertex way. Thus the more complex animations are handled via bones. I hope you find your model, turbo squid has got some fine models which are available for free

http://www.turbosquid.com/

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Page 2 of 2 1 2

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