Create account / Log in

Repeating Triggers

Suggestions for additional features for the module editor and Vassal engine.

Moderators: uckelman, Tim M

Repeating Triggers

Postby DrNostromo » November 25th, 2008, 2:14 pm

Most games have some sort of dice, generators displaying a random graphic or something similar.

For example, I have a button that I click to display a random graphic. If the random graphic is the same as the graphic already there, nothing appears to happen and the only clue you have that the button actually worked is via a report in the chat window.

I got to thinking it would be cool to have a trigger trait that you could set to repeat a number of times and have a time interval between each execution.

For example, if I set such a trait for the above example, I could set it to execute a random graphic 10 times with 0.2 seconds between each execution. So, over the course of 2 seconds, the players will see various graphics flash by and finally stop on a specific graphic. Naturally, reporting would be suppressed until the final result.

Not only would it provides some sort of animation but it would be obvious to the players that the button worked.
User avatar
DrNostromo
 
Posts: 1066
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Postby danjaman » June 8th, 2009, 7:55 pm

Yeh I tried to do something with repeated triggers, going back and forth between a Door, with opening layers and a console with flashing lights as it opened; but it zipped through the frames so fast it seemed to just be either open or closed...

In terms of a timer though I think you can improvise, set a DP called 'timer' and add increments via trigger (timer < 1000) until it reaches 1000 then trigger a frame change, then again and again until it finds conclusion, I'm gonna test this premise and get back to you...

HAS TO BE DONE WITH A SEPARATE PIECE WORKING IN TANDEM(I think). ie Global key common, property matches, in my case, console = 1 and it fires back a reply to Door = 1, back and forth with another simple DP start/stop once the door is fully open it sends change to STOP. Open = 1.

If you click the console again it starts the thing in the opposite direction.

That is afterall what a timer does... its better to have a manager to bounce the commands off of though else you need even more complex trait combo's on the animated one...

I will post my findings.
danjaman
 
Posts: 86
Joined: August 13th, 2008, 8:32 pm

Repeating Triggers

Postby Tim M » June 8th, 2009, 8:34 pm

it is unlikely 1000 will be significant enough. I tried this once be fore with a count to 100 and 200 and still discerned no difference - your processor is able to count too fast.
What is ideally needed is a "Wait" trait that allows you to insert a pause of a specified time by developer before what ever is being done resumes


From: danjaman <messages@forums.vassalengine.org>
To: messages@forums.vassalengine.org
Sent: Monday, June 8, 2009 2:55:09 PM
Subject: [Feature Requests]Re: Repeating Triggers

Yeh I tried to do something with repeated triggers, going back and forth between a Door, with opening layers and a console with flashing lights as it opened; but it zipped through the frames so fast it seemed to just be either open or closed...

In terms of a timer though I think you can improvise, set a DP as timer and add increments via trigger until it reaches 1000 then trigger a frame change, then again and again until it finds conclusion, I'm gonna test this premise and get back to you...

That is afterall what a timer does... its better to have a manager to bounce the commands off of though else you need even more complex trait combo's on the animated one...

I will post my findings.







_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org (Messages@forums.vassalengine.org)
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1817
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby danjaman » June 8th, 2009, 10:19 pm

Well, property variables can go into the Millions, so it could be just a matter of finding the right range; but as you say this will be effected by people processors and will not look consistent and therefor I realise, a pretty poor work around unless you crank it up; but then what looks even passable on my Pentium D will probably done in a flash on Core Duo or Quad...

If only we all had Pentium Ones, the ones with MMX obviously (we don't wanna go too crap now do we...??)... they used to do clock cycle timers in some software back then... thats why you get super fast motion unless you emulate old crappy games sometimes...

Probably get a way with 500,000,000 count on those puppies... I just figured using two pieces in tandem would double the process and of course there is the traffic inbetween them to kill a microsecond or two...

Or perhaps... I could GM my eyes to pick up more than 24 frames a second... I wonder...??
danjaman
 
Posts: 86
Joined: August 13th, 2008, 8:32 pm

Repeating Triggers

Postby uckelman » June 8th, 2009, 10:49 pm

Thus spake "danjaman":
Well, property variables can go into the Millions, so it could be just a matt
er of finding the right range; but as you say this will be effected by people
processors and will not look consistent and therefor I realise, a pretty poo
r work around unless you crank it up; but then what looks even passable on m
y Pentium D will probably done in a flash on Core Duo or Quad...

Trying to turn a loop into a timer is a really, really bad idea, as the
duration of the loop will depend entirely on the speed of the machine
it's running on. And if you don't care about getting consistent results
across machines, then you should ask yourself whether a timer is what you
really wanted in the first place.

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8961
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Postby danjaman » June 9th, 2009, 10:51 am

I realise, a pretty poor work around


just quote myself there... I was just gonna test it is all.

And yes a timer is exactly what I need. As long as the result is consistent to within a range, I don't mind.... its nasty, messy, probably unusable; but I am a curious personality and even if it fries my CPU for some inexplicable reason, I will do this anyway for the sheer sh*ts and g*ggles of it...

If I open a Black hole, soi be it.

Anyway I have a mate who can test on a high end machine... and by the time something so fast comes out I need to change it perhaps Vassal will support animation anyway...
danjaman
 
Posts: 86
Joined: August 13th, 2008, 8:32 pm

Postby Dezartfox » June 10th, 2009, 12:16 am

danjaman wrote:
I realise, a pretty poor work around


just quote myself there... I was just gonna test it is all.

And yes a timer is exactly what I need. As long as the result is consistent to within a range, I don't mind.... its nasty, messy, probably unusable; but I am a curious personality and even if it fries my CPU for some inexplicable reason, I will do this anyway for the sheer sh*ts and g*ggles of it...

If I open a Black hole, soi be it.

Anyway I have a mate who can test on a high end machine... and by the time something so fast comes out I need to change it perhaps Vassal will support animation anyway...


Is that mate me <_<
I've already caused several black holes.. no more the government said -_-
Dezartfox
 
Posts: 44
Joined: May 29th, 2008, 1:22 am

Postby danjaman » June 10th, 2009, 10:35 am

I can give a no black holes guarantee ;) I test on mine first...
danjaman
 
Posts: 86
Joined: August 13th, 2008, 8:32 pm

Repeating Triggers not, Animation yes!

Postby viewofheaven » October 18th, 2011, 7:00 am

uckelman wrote:Trying to turn a loop into a timer is a really, really bad idea, as the
duration of the loop will depend entirely on the speed of the machine
it's running on.


Hi Joel. I've added a feature request for this. I believe I have fleshed out the idea adequately to allow the developers to do this within an hour or so. (if not, tell me to flesh it out more). The request is at here.
viewofheaven
 
Posts: 80
Joined: October 14th, 2011, 6:24 am


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest