Animpos Equals Changing Variable

Non-platform specific questions.

Animpos Equals Changing Variable

Postby code4242 » Wed Apr 18, 2012 6:26 pm

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?
Current project: Teratism
User avatar
code4242
 
Posts: 40
Joined: Tue Dec 11, 2007 9:01 pm
Location: Sitting at my laptop :D
Score: 0 Give a positive score

Re: Animpos Equals Changing Variable

Postby skydereign » Wed Apr 18, 2012 6:52 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Animpos Equals Changing Variable

Postby code4242 » Wed Apr 18, 2012 7:02 pm

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!
Current project: Teratism
User avatar
code4242
 
Posts: 40
Joined: Tue Dec 11, 2007 9:01 pm
Location: Sitting at my laptop :D
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron