Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: nevincho on August 28, 2018, 12:42:41 AM
-
Does not record the correct time. At 60 seconds, changes the game list every 10-12 seconds ...
-
Any one?
-
WTF?! Really no one can help me?
-
I looked at it quickly on my iPhone. Can’t afford to pay my isp this month, so my help is temporarily limited. Damn.
Default number of seconds is 600. I think you meant to set a default of 60? Prepending variables with m_ gets a tad confusing. You shouldn’t have to set a nv record. Just have transitions or signals update a class variable, and use that to compare with ticks for idle time and if it’s in gameplay.? I did this a long time ago as a screensaver for one of my themes - but ended up just using the default screensaver.
If you need further help, I can definitely do it but have to be patient. I started a new job today really good one and can’t even complete my work because no money for Internet wtf.
-
Thank you for answer.
Plugin works, but whatever value I want to set 60, 600, 6000, 9999 changes the names always for about 10-12 sec.
It would be good to be at least about 1 minute for the video snap to show
-
Is it because m_last_rand = 0 on class instance and then your tick function is triggered at >10000?
-
class Random
{
m_config = null;
m_last_rand = 0;
m_rand_ms = 0;
constructor() {
m_config = fe.get_config();
m_rand_ms = 1000 * m_config["rand_s"].tointeger();
if (!fe.nv.rawin( "Random" ))
fe.nv.rawset( "Random", false);
fe.add_ticks_callback( this, "on_tick" );
fe.add_transition_callback( this, "on_transition" );
}
function on_tick( ttime )
{
if ( ttime - m_last_rand > 10000 )
{
local roll = 1.0 * rand() / RAND_MAX;
roll = ( roll * fe.displays.len() );
fe.set_display( roll );
m_last_rand = ttime;
fe.nv[ "Random" ] = true;
-
Turns out my internet wasn’t shut off. Having intermittent isp issues I will resolve later.
Anyways, your code has me a little confused and seems complicated. I created a very small and simple plugin for this feature. It works 100%. Hopefully it has the features you are looking for, and can include it if it does not. Need to get some sleep. Will create docs and push to GitHub tomorrow.
-
silently waiting , thanks...
-
Thanks for your time.
-
https://github.com/keilmillerjr/sequencer-plugin
Will add the option of selecting random display as well, but will likely be for another night. Since set_display reloads module/plugin/layout, I understand the need for writing a variable to nv table.
-
works, great.... :)
after "time" blinks to new game.
Question..not shere if you have seen this, but i have a great FE pak called "Forgoton worlds"
and it is "retrofe" theme and is has this feature ,but instead of blinking to new game
it will scroll through the weal or list to the random game looks so cool instead of blinking to new game
Q: is there any way you could make that happen.....? it is just eye candy but dam it works
thanks alot
if you need i could upload a vid of it for you t see..but i think you know what i mean.......
-
@jedione I think I know what you are talking about. It’s possible. Send me a video just to be sure.
-
ok here it is... showing two or three cycles of the game list by it's self
after not scrolling..
to me this embodies the word "attract mode" when put on a arcade cabinet.
i think this would be the game changer for AM.
preview =
https://youtu.be/vGXdz2JjWfs (https://youtu.be/vGXdz2JjWfs)
note: this is what got me in to AM 4 years ago..IE: i would walk out to get some milk say
2 to 3 in the morning. and see AM on my arcade cabnet in my living room.
and it was going crazy with..all the difrint games that were of coruse the,, screen saver..
i could not go back to bed... i had to play...... :-* a new game i never saw
-
Perfect work, thanks again.
-
This is awesome. Thanks!
-
ok here it is... showing two or three cycles of the game list by it's self
after not scrolling..
to me this embodies the word "attract mode" when put on a arcade cabinet.
i think this would be the game changer for AM.
preview =
https://youtu.be/vGXdz2JjWfs (https://youtu.be/vGXdz2JjWfs)
note: this is what got me in to AM 4 years ago..IE: i would walk out to get some milk say
2 to 3 in the morning. and see AM on my arcade cabnet in my living room.
and it was going crazy with..all the difrint games that were of coruse the,, screen saver..
i could not go back to bed... i had to play...... :-* a new game i never saw
- I added this feature.
- It works.
- It is not yet released.
- It still has some small bugs and needs refinement.
It works similar as the first release - waiting for a period of time after the last signal before activating. Plugin then chooses a target for a random game, and sends a next_game signal until the target is reached.
FadeArt will not update until the current playing video is complete, I think.?
https://youtu.be/d5QUhjdtYPs
-
Is it possible except by random, to change the list in ascending order: 1,2,3 and so on?
-
Is it possible except by random, to change the list in ascending order: 1,2,3 and so on?
I am not sure why you would want this. Anyways, fork it on GitHub now before I do an update, and change plugin.nut line 51 to the following:
if (ttime >= signalTime + delayTime) fe.filters.reverse_order = true;
-
thanks for making the rev-2 cant wait till you release it thanks..
did not know you were in to firewood, cool.
-
Is it possible except by random, to change the list in ascending order: 1,2,3 and so on?
I am not sure why you would want this. Anyways, fork it on GitHub now before I do an update, and change plugin.nut line 51 to the following:
if (ttime >= signalTime + delayTime) fe.filters.reverse_order = true;
Thanks again for your time. I tried and changed the code to line 51 but it does not work
-
Is it possible except by random, to change the list in ascending order: 1,2,3 and so on?
I am not sure why you would want this. Anyways, fork it on GitHub now before I do an update, and change plugin.nut line 51 to the following:
if (ttime >= signalTime + delayTime) fe.filters.reverse_order = true;
Thanks again for your time. I tried and changed the code to line 51 but it does not work
I rechecked the docs. I guess I looked at it too quickly.
reverse_order - [bool] Will be equal to true if the list order has been reversed.
You need to test reverse_order and switch its boolean value.
Try:
if (ttime >= signalTime + delayTime)
fe.filters.reverse_order ? fe.filters.reverse_order = false : fe.filters.reverse_order = true;
-
thanks for making the rev-2 cant wait till you release it thanks..
did not know you were in to firewood, cool.
My father owns a logging company. I just changed careers last week to CNC electro-mechanical technician.
I changed the logic on the signal variable. I think it works correctly now. Give the experimental a try again with latest commit? It compares the distance between index and target, and the list size minus the distance between index and targe, and then selects appropriate direction based on index and target size comparison.
-
Is it possible except by random, to change the list in ascending order: 1,2,3 and so on?
I am not sure why you would want this. Anyways, fork it on GitHub now before I do an update, and change plugin.nut line 51 to the following:
if (ttime >= signalTime + delayTime) fe.filters.reverse_order = true;
Thanks again for your time. I tried and changed the code to line 51 but it does not work
I rechecked the docs. I guess I looked at it too quickly.
reverse_order - [bool] Will be equal to true if the list order has been reversed.
You need to test reverse_order and switch its boolean value.
Try:
if (ttime >= signalTime + delayTime)
fe.filters.reverse_order ? fe.filters.reverse_order = false : fe.filters.reverse_order = true;
I tested it with ÐМ 2.3.0/2.4.0 and it did not work again. No matter how interesting it may be. Thank you again for your attention. It's not important that if one day you have time a look at it. It would be a nice plugin to have two options for alternating games.
-
Updated the experimental branch for sequencer plugin. Sorry it took so long. I just spent two hours with it. I added the ability to jump ahead indexes. It makes the action quicker. Anyone can try it and provide input or fork/pull request. Still hung up on why fe.signal on every consecutive tick does not produce the same result as navigation button press. My frame rate gets low too.
-
Is there any way to auto pause the script while you’re playing a game? Feels a bit weird to exit a game and have another game selected. (I haven’t tried the experimental version yet, so apologies if it was already added to that).
Amazing work, thank you for making this.
-
Is there any way to auto pause the script while you’re playing a game? Feels a bit weird to exit a game and have another game selected. (I haven’t tried the experimental version yet, so apologies if it was already added to that).
Amazing work, thank you for making this.
No, but I can add that feature. I forgot that the front end doesn’t really pause when focus is taken away. Perhaps this weekend I can work on it.
-
Is there any way to auto pause the script while you’re playing a game? Feels a bit weird to exit a game and have another game selected. (I haven’t tried the experimental version yet, so apologies if it was already added to that).
Amazing work, thank you for making this.
No, but I can add that feature. I forgot that the front end doesn’t really pause when focus is taken away. Perhaps this weekend I can work on it.
That would be fantastic. I really appreciate your work.
-
Is there any way to auto pause the script while you’re playing a game? Feels a bit weird to exit a game and have another game selected. (I haven’t tried the experimental version yet, so apologies if it was already added to that).
Amazing work, thank you for making this.
No, but I can add that feature. I forgot that the front end doesn’t really pause when focus is taken away. Perhaps this weekend I can work on it.
That would be fantastic. I really appreciate your work.
I did some work to the master branch. Totally revised. I am very pleased with the outcome.
- Picks random target index
- Picks a random direction
- Changes fe.list.index -1/+1 based on direction
- Sends signal to move to our target index
- Game will not change during gameplay, and will reset counter FromGame.
- No issues with fade art module
- No drop in frame rate when changing games
- “Spinning wheel“ type movement is not present like the experimental branch, but utilizing next and prevention signals at random means that other modules can still provide some sort of movement.
I think I’m at end with the experimental branch unless some one can provide some insight for an approach. Master branch is pretty good in my eyes, and would like feedback as to how well it’s interaction with other themes is.
-
I just tried the updated plugin from the master branch and it works perfectly. Thank you! :)
-
The updates sound awesome. I’m out of town for a couple days so won’t be able to try it out till I get back, but looking forward to it.
-
OK finally had a chance to test and the new commit doesn't work at all for me for some reason. Tried with several different layouts with no luck.
Reverted to the commit from Sep 7th and it works fine.
Any idea why?
thanks again.
-
OK finally had a chance to test and the new commit doesn't work at all for me for some reason. Tried with several different layouts with no luck.
Reverted to the commit from Sep & and it works fine.
Any idea why?
thanks again.
It dosen't work for me either.
-
@jeffy777 @nevincho It works on my iMac just fine. Besides my own layouts, I also tested with cools and arcade flow. ArcadeFlow doesn’t display artwork on my iMac for some reason, but theme navigated with sequencer fine.
Could you guys let me know what themes you are trying? Possibly disable all other plugins and reenable them one by one if it works? Thank you.
https://youtu.be/G87dRISh_mU
-
I’m using the Silky theme:
http://forum.attractmode.org/index.php?topic=1517.0
I also tried it with OldRoom. and a few random others.
I disabled all other plugins, still no luck.
-
I try with Attract-Man, Basic, Pandora Box 3,4,5, Extreme Box, Blue Ring, Robospin .... not work.
AM versions 2.3.0-2.4.0
-
@jeffy777 @nevincho I tried every default layout, and they all work. Orbit has an issue where the static effect does not disappear I think because on Transition.ToNewList ttime < spin_ms and spin_ms is 120. This plugin makes it happen on a single tick.
Are you guys using the latest helpers module? Do you have any errors in the terminal?
-
I did not have the helpers module isntalled at all and that seems to have been the issue. Works perfectly with the Silky theme now. Nice job man!
-
Script Error
-
@nevincho you need the helpers module. I’m so sorry. I totally forgot to update the readme! It wasn’t required on my first commit, and then was when it became more complex. Will update after work today.
-
Perfect :) Thank you again for your work.
-
Greetings and many thanks to Mr. keilmillerjr for this very useful sequencer plug-in. This functionality should indeed be built in with AM.
I wonder if it is possible for this plug-in to detect when the snap-video is finished and start the sequencer when the video is finished instead of a manual timer? (similar to HyperSpin "wait for video" option before Attract wheel-scrolling starts).
Keep up the good work and best regards.
/Edit: Report of some minor issues:
* sequencer plug-in interrupts the built-in AM screensaver functionality. (it would be great to pause the sequencer while screensaver is active). It is a non-issue for me since I just disable the AM screensaver and use this sequencer plug-in instead as a live attract-mode screensaver.
* sequencer plug-in timer starts counting even while a intro video is playing during the start of AM. (this can only be an issue for those that are using longer intro videos.)
-
Greetings and many thanks to Mr. keilmillerjr for this very useful sequencer plug-in. This functionality should indeed be built in with AM.
I wonder if it is possible for this plug-in to detect when the snap-video is finished and start the sequencer when the video is finished instead of a manual timer? (similar to HyperSpin "wait for video" option before Attract wheel-scrolling starts).
Keep up the good work and best regards.
/Edit: Report of some minor issues:
* sequencer plug-in interrupts the built-in AM screensaver functionality. (it would be great to pause the sequencer while screensaver is active). It is a non-issue for me since I just disable the AM screensaver and use this sequencer plug-in instead as a live attract-mode screensaver.
* sequencer plug-in timer starts counting even while a intro video is playing during the start of AM. (this can only be an issue for those that are using longer intro videos.)
Thank you for the awesome feedback and bug reporting.
I can easily tackle the bugs when I get some free time.
I’m not sure if your requested feature is possible as a plugin. I’ll investigate. The issue will be calling a variable from a layout. I think they are “sandboxedâ€. If so, it would have to utilize a module to set a global variable and hopefully plugin would read it after layout. I’ve been trying to keep this a plugin. I could replicate how hyperspin does it 100%, but it would have to be integrated into each theme and not an easy global thing.
-
Thank you for the awesome feedback and bug reporting.
I can easily tackle the bugs when I get some free time.
I’m not sure if your requested feature is possible as a plugin. I’ll investigate. The issue will be calling a variable from a layout. I think they are “sandboxedâ€. If so, it would have to utilize a module to set a global variable and hopefully plugin would read it after layout. I’ve been trying to keep this a plugin. I could replicate how hyperspin does it 100%, but it would have to be integrated into each theme and not an easy global thing.
Greetings and thanks for investigating this. I didn't know that the variables from layouts were sandboxed in AM, I was assuming that plug-ins could perhaps read the "video_duration" and "video_time" properties directly from the active layout when needed. Hopefully this might be possible with your 'helpers' module without the need to manually modify all layouts until AM perhaps officially supports this functionality. Keep up the good work and best regards.
-
Pushed small update. Plugin should wait for intro to finish before activating plugin. Please test and report back if it doesn’t work. I didn’t actually test it.
As is, screensaver will never become active unless screensaver time is less than sequencers delay time (which would be pointless). One option is to not use a screensaver. Harsh, I know. Second option, differentiate between signals from the plugin and actual user plugins. I could then keep track of time the user was away and activate the screensaver manually a signal that you preset in the config to activate the screensaver. Plugin would have to disable when the screensaver is active, and enable when returning. Thoughts?
-
Pushed small update. Plugin should wait for intro to finish before activating plugin. Please test and report back if it doesn’t work. I didn’t actually test it.
As is, screensaver will never become active unless screensaver time is less than sequencers delay time (which would be pointless). One option is to not use a screensaver. Harsh, I know. Second option, differentiate between signals from the plugin and actual user plugins. I could then keep track of time the user was away and activate the screensaver manually a signal that you preset in the config to activate the screensaver. Plugin would have to disable when the screensaver is active, and enable when returning. Thoughts?
Thanks for the update, the sequencer plugin now waits correctly for the intro-video as long as the delay time set in the sequencer settings is not shorter than the intro-video length itself (for example if you set sequencer delay time to 5sec and the intro-video length is 10sec then it will still interrupt the intro-video at 5sec and jump into AM). This is really a non-issue since most of us use ~30sec as sequencer delay time (the normal video length of EmuMovies) and usually don't use long intro-videos (but I know some people love those super long intro videos in their arcade cabinets). Mine is just around 10 sec.
I just wish that AM would have a function that would ignore keyboard/joystick key inputs during the intro-video as an optional option. I use AHK script for that as a workaround until I learn how to do it via the intro.nut file correctly.
PS. This great plug-in has completely removed the need for a screensaver for me, and it works much better as a "Attract-Mode" attention grabber in an Arcade cabinet than the built in AM screensavers.
Keep up the good work and best regards.
/Edit, forgot to quote the post I was replying to
-
Pushed small update. Plugin should wait for intro to finish before activating plugin. Please test and report back if it doesn’t work. I didn’t actually test it.
As is, screensaver will never become active unless screensaver time is less than sequencers delay time (which would be pointless). One option is to not use a screensaver. Harsh, I know. Second option, differentiate between signals from the plugin and actual user plugins. I could then keep track of time the user was away and activate the screensaver manually a signal that you preset in the config to activate the screensaver. Plugin would have to disable when the screensaver is active, and enable when returning. Thoughts?
Thanks for the update, the sequencer plugin now waits correctly for the intro-video as long as the delay time set in the sequencer settings is not shorter than the intro-video length itself (for example if you set sequencer delay time to 5sec and the intro-video length is 10sec then it will still interrupt the intro-video at 5sec and jump into AM). This is really a non-issue since most of us use ~30sec as sequencer delay time (the normal video length of EmuMovies) and usually don't use long intro-videos (but I know some people love those super long intro videos in their arcade cabinets). Mine is just around 10 sec.
I just wish that AM would have a function that would ignore keyboard/joystick key inputs during the intro-video as an optional option. I use AHK script for that as a workaround until I learn how to do it via the intro.nut file correctly.
PS. This great plug-in has completely removed the need for a screensaver for me, and it works much better as a "Attract-Mode" attention grabber in an Arcade cabinet than the built in AM screensavers.
Keep up the good work and best regards.
/Edit, forgot to quote the post I was replying to
Thank you for trying it out and your detailed review! Resolved the issue with the intro. Sorry about that. Fully tested now. Pushed update to GitHub.
I can disable signals when the intro is active, but this would best be handled by the intro script because the plugin would not know the length of the video object and it would be stuck on a never ending loop. You would have to add a signal handler and return true unless video is done playing.
-
hey guys do these plugins still work with updated AM versions i can't seem to get these working at all
-
Well, I tried the plugin with the latest AM. All you need to do is make sure you also have the 'helpers' module installed as stated in the readme.
I noticed one weird thing though. After a few cycles the displayed 'snap video' will randomly become either an index offset -1 or +1 from what it is suppose to be.
Boxart, Cartart, Logo, and all metadata, overview, etc remain correct. Only the video is having the problem.
Otherwise, this would be a perfect plugin for my needs.
EDIT:
Trying this plugin again with a new layout I am creating. I only have videosnap and wheel setup at moment and I let this sequencer plugin run for about 3 minutes on a 5 second interval. Everything worked perfectly. Cheers.
-
Tried this plugin with a couple different emulator lists and themes and I always get the same result.
- Switches to a new game after the configured number of seconds (I have chosen 40 so most of the content of the Hyperspin videos I'm using will fully play)
- The rom's name displays in yellow text near the bottom-left of the screen (configured by default somewhere I think) which does not match the art being displayed. I have marquee, themes and wheel configured to display. The marquee and 'themes' art match each other, but do not match the romname being displayed. The wheel art does match the rom name
- After a game has auto-switched, the marquee and 'themes' art initially match each other, but they display the art of the game next to it in the list. After 15 seconds, the marquee updates to match the displayed romname while the 'themes' art (hyperspin video in my case) does not
- If I press Enter after the rotation has started, all the art updates to the displayed romname but the game does not run. I have to press Enter again to start the game
The plugin is useful as a screensaver, but not much more in this state. Anyone else have this experience?
Using Attract-Mode 2.6.2