Page 1 of 1

Animpos Equals Changing Variable

PostPosted: Wed Apr 18, 2012 6:26 pm
by code4242
So I'm trying to make a little point bar that will represent a variable. I currently have it set as a draw actor event to stop the animation so it doesn't keep scrolling, then a line that tell it:
Code: Select all
animpos=points;

But for some reason, the animation doesn't change. I made a simple event to test it, I just press a key to increase or decrease the variable, but the animation still won't change. Any ideas of what the problem could be? Or any other ways to accomplish this?

Re: Animpos Equals Changing Variable

PostPosted: Wed Apr 18, 2012 6:52 pm
by skydereign
You shouldn't put that event in the actor's draw actor. You only need to change the animation direction to stopped once (when it is created). Now, if your animation has a single blank frame at the beginning (for instance a completely depleted bar), then gE will not create it correctly. I usually create a full bar animation (single frame) and then on the actor's create event, change the animation to the real bar. This is helpful as it bypasses that problem, as well as allows you to actually see the bar while working on your game. If that isn't it, then the only other thing is that points is set to a value higher than nframes.

Re: Animpos Equals Changing Variable

PostPosted: Wed Apr 18, 2012 7:02 pm
by code4242
Okay, I moved the animation stopping to a "Create Actor" event. It still wasn't working, but I managed to find the problem. It was a simple typo in the scripting. My bad. :oops:
Sorry for your trouble, but it did help with the animation stopping problem. :) So thanks!