Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Krosad on May 04, 2011, 07:30:08 PM
-
Hello!
How work Play() and Reset() ?
I have sprite with no loop animation, and i need play it on "LeftClick".
-
Can't you simply use entity.PlayAnim() ? Using the sprite scripting methods is an advanced technique and isn't necessary for everyday use.
-
How to stop animation at a certain frame?
-
You'd need to attach a script to the sprite and handle the 'FrameChanged' event in it.
-
Hi,
I`ve got some problem with sprites.
I create noloop anim sprite in scene_init.script.
global indicator = Scene.GetNode("indicator");
global indicator_sp = indicator.GetSpriteObject();
indicator_sp.Pause();
.. then in indicator.script
on "LeftClick" {indicator_sp.Play();}
After animation, indicator sprite change color from green to red.
Then actor goes to another scene and back, indicator is green again (!?).
How to fix this?
-
I still trying to solve this problem
i add global variable ind_act = 1 if sprite was animated.
in scene_init.script
global indicator = Scene.GetNode("indicator ");
global ind_act;
global indicator _sp = indicator .GetSpriteObject();
if(ind_act == 1)
{
indicator _sp.CurrentFrame = 6; // 6 - last frame
indicator _sp.Pause();
}
else indicator _sp.Pause();
i thought it must work, but WME give fatal error.
-
Hi,
first of all, when talking about errors WME throws, please also quote the error here. :-)
global indicator _sp = indicator .GetSpriteObject();
if(ind_act == 1)
{
indicator _sp.CurrentFrame = 6; // 6 - last frame
indicator _sp.Pause();
}
else klawa_sp.Pause();
From what I can see immediately: you have a blank in your variable name between "indicator" and "_sp", that shouldn't be there. This will surely throw a fatal compile error.
-
i did a blank, when i wrote this post, in scripts no blanks.
about errors WME throws. WME just don`t respond on Esc and i had to used ctrl+alt+del.
-----------------------------------------------------------------
---------- wme 1.9.001 crash report: 06-08-2012, 14:41 ----------
-----------------------------------------------------------------
wme.exe caused a EXCEPTION_ACCESS_VIOLATION in module wme.exe at 001B:00000000
EAX=00000000 EBX=04E418A0 ECX=04E3E808 EDX=04E58C40 ESI=00000000
EDI=0000000C EBP=04E4CDB0 ESP=0012FD60 EIP=00000000 FLG=00010202
CS=001B DS=0023 SS=0023 ES=0023 FS=003B GS=0000
Stack trace:
001B:00000000 (0x04E4CDB0 0x0C5F471E 0x0000000C 0x00000017) wme.exe
001B:00440162 (0x656D6172 0x090C0C00 0x00030011 0x0208013B) wme.exe
001B:46746E65 (0x00000000 0x00000000 0x00000000 0x00000000) <UNKNOWN>
-
I think I found what It was.
Sprite must be set on next-to-last frame.