Data Realms Fan Forums
http://45.55.195.193/

Using Timers or adding step delays in a pie menu option?
http://45.55.195.193/viewtopic.php?f=73&t=31252
Page 1 of 1

Author:  Technomancer [ Sat Jun 16, 2012 2:43 am ]
Post subject:  Using Timers or adding step delays in a pie menu option?

I'm not sure of the best way to describe what I'm after, but essentially, I have a toggling pie menu button.
When the button is toggled, it's meant to animate up through 3 frames on an attachable then change the actors sharpness to 1, or animate down through 3 frames and change sharpness to 0.
The rest of the script in update(self) makes the frame-by-frame changes I want to the actors motion if sharpness is 1, and that's working fine. So is the toggling.

The problem seems to be, I don't seem to be able to make the pie-triggered part of the script keep running past a single frame.
Is there any way around this besides moving the (brief, and only on toggle) animation into update(self) as well?

Here's the relevant part of the script. The text message for a missing wing isn't working either, but that's probably because it returns an error and stops the code if the attachable isn't picked up by the ID sweep, rather than passing through as a false.


It doesn't work if I try doing:

for i = 1, 3 do
if actor.FrameTimer:IsPastSimMS(50 * i) then
actor.Wing.Frame = i;
end

either. Am I just making a really stupid mistake somewhere? I'm pretty sure triggering via the pie menu skips the Create(self) and Update(self) sections.

EDIT: The else section for turning off the stabilizer doesn't include the steps down here, but ideally it will, it's just that it wasn't working on the way up so it seemed silly to break it going down as well.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/