2 registered members (dr_panther, 1 invisible),
643
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Mouse Click
#404408
07/08/12 17:39
07/08/12 17:39
|
Joined: May 2010
Posts: 41 İstanbul/Turkey
Sorrowful
OP
Newbie
|
OP
Newbie
Joined: May 2010
Posts: 41
İstanbul/Turkey
|
if(mouse_left==1)
{
ent_animate(me,"5atak",ates_per,ANM_CYCLE);
ates_per += 1*time_step;
}
I want to be when I click the mouse once...
A8.40 Professional Sancak Oyun Ekibi
|
|
|
Re: Mouse Click
[Re: rayp]
#404429
07/09/12 04:47
07/09/12 04:47
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
i think this could work:
var hitleft = 0;
...
if(mouse_left==1 && hitleft ==0)
{
hitleft = 1;
ates_per = 0;
while(ates_per<99)
{
ent_animate(me,"5atak",ates_per,ANM_CYCLE);
ates_per += 1*time_step;
wait(1);
}
ates_per = 100;
ent_animate(me,"5atak",ates_per,ANM_CYCLE);
hitleft = 0;
}
bit i think you should use me.skillXX instead of ates_per.. cause a global variable as frame counter is not effective in greater scenes with more animations
Last edited by Espér; 07/09/12 04:48.
|
|
|
Re: Mouse Click
[Re: Espér]
#404431
07/09/12 06:15
07/09/12 06:15
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
X
|
X
Joined: Jul 2008
Posts: 2,107
Germany
|
Yeah but when using this code, the main-while is paused until the animation is done. If he does further movement fex in the main while, this wont work. And why do u use ent_animate again after the while ? whats about this one. Full animation played from main-while without pausing it.
#define Satack skill100
#define ates_per skill99
function anm_me()
{
while(my)
{
if(my.Satack == 1) { my.ates_per += time_step; ent_animate(me, "Satak", my.ates_per, ANM_CYCLE); }
if(my.ates_per >= 100) { my.ates_per = 0; my.Satak = 0; }
wait(1);
}
}
action The_Player()
{
anm_me();
while(my)
{
if(mouse_left && my.Satack == 0) my.Satack = 1;
//further code in main while like movement whatever
wait(1);
}
}
Now if mouse_left is pressed the full animation will be displayed without pausing the main-while. mfg
Last edited by rayp; 07/09/12 06:15.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: Mouse Click
[Re: rayp]
#404432
07/09/12 06:29
07/09/12 06:29
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
would be an idea.. but only if you got 1 or 2 animated models at a time.. if there will be more, with different pointer names.. the main loop won't work.. the animation needs ro be in the entities action my code is not meant to be in the main loop. it's coded to be part of the entities action
|
|
|
|