Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - jclampy69

Pages: [1]
1
Scripting / [SOLVED] How to convert this bool to an integer?
« on: January 08, 2021, 02:18:15 PM »
Hi, can someone give me pointers on how to do this properly. I haven't tried converting a bool to an integer before and am finding it difficult to find an example of doing this.

Code: [Select]
local whatdir; //direction of scrolling

function dir_on_transition( ttype, var, ttime)
    {
    if ( ttype == Transition.ToNewSelection)
        {
        if ( fe.get_input_state( "Up") == true) whatdir = "-1"
        else if ( fe.get_input_state( "Up") == true) whatdir = "1"
    }
    print (whatdir) // debugging
}
fe.add_transition_callback( "dir_on_transition")

Thanks to Oomek for finding me a solution.
Code: [Select]
local whatdir = 0; //direction of scrolling

function dir_on_transition( ttype, var, ttime )
{
if ( ttype == Transition.ToNewSelection )
{
whatdir = -var
print ( whatdir ) //debugging
}
return false
}
fe.add_transition_callback( "dir_on_transition" )

2
Themes / DynamicArcade layout beta-v9 released 26 Jan 2021
« on: December 25, 2020, 12:27:46 AM »
I initially created this layout as a request of Damonxxx http://forum.attractmode.org/index.php?topic=3778.0
I've placed it in it's own thread because I will probably expand on this further in the future.
Please see Damonxxx thread if you need artwork files.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DynamicArcade theme for AttractMode
// Version beta-v9
// Dynamic Arcade layout - 16:9 display ratio (written in 1080p, but tested in 1440p, should work in any 16:9 fine?)
// Layout completely written from scratch by JClampy69
// http://forum.attractmode.org/index.php?topic=3849.0
//
// 1] Cabinet screen effects can be toggled between a 'CRT Shader' or 'Scanlines'. See the note in the README.md troubleshooting section.
// 2] Game searching under layout options can be toggled between 'show search results' or 'jump to next found match'.
// 3] Performing a 'game search' by default is set to custom1 key/button. This can be changed under layout options.
// 4] If 'show search results' is selected then a quick clear key/button is set to custom2 by default. Changeable under layout options.
// 5] 'Cabinet slide-in speed' can be altered under layout options.
// 6] Game Title appearance in metadata area can be toggled between 'wrappable two line' or 'single line only'
// 7] Display of a System Logo can be toggled on/off under layout options.
// 8] The Vertical Game Logo List can be toggled between 'staying on screen' or 'fading to hide' in the layout options.
// 9] Layout options for setting the 'default marquee' as an stylised image or to have it 'empty black' in appearance.
//   Included styles at the moment are Mame/Arcade, Mame, or Final Burn Neo.
//
// *** IMPORTANT ***
// Artwork Prerequisites - Naming Convention used in your cfg file in the (AttractMode)\emulators\ folder:
// ```````````````````````````````````````````````````````````````````````````````````
// wheel = game logos (preferably of resolution smaller than 1000 width / 400 height so not to overload AttractModes image cache).
// cabinets = game cabinets (this layout uses cabinet images of resolution 1300x1080).
// marquee = game marquees (preferably of resolution smaller than 1500 width / 400 height so not to overload AttractModes image cache).
// snap = game videos (preferably 640x480 or 320x240 for correct 4:3 aspect ratio for shader effect settings. The screens of the cabinet graphics are also 4:3).
// tscreens = game title screens (preferably 640x480 or 320x240 for correct 4:3 aspect ratio for shader effect settings. The screens of the cabinet graphics are also 4:3).
//
// if enabled, system logos displayed in top right corner come from your (AttractMode)\menu-art\wheel\ folder. You would need to have some there.
// flyer = *NOT* used by this layout at this time, but can enhance the AttractMode screensaver feature if that is your preference.
//
// "game videos performance of different formats under Windows OS in order of fastest to slowest = fastest wmv, then avi, then mp4."
// I have not tested this myself, the quote is from here http://forum.attractmode.org/index.php?topic=3261.msg22951#msg22951
// If you use mp4 then preferably encoded in yuv420 and not in yuv444 chroma subsampling.
//
// dxva2 video decoding in AttractMode is broken and is causing a 200% to 300% performance loss
// In AttractMode attract.cfg file under the 'general' section, make sure the video_decoder line looks like one of the following:
//    video_decoder        software
// or empty
//    video_decoder
//
// Included Shaders:
// `````````````````
// I have not created these shaders. I only modified them to work with the components of my layout.
// The original Shader Package by Keil Miller Jr = https://github.com/keilmillerjr/shader-module
// Ripple shader converted by Liquid8d to AttractMode = http://forum.attractmode.org/index.php?topic=7.msg12#msg12
// Blur shader I found in ArcadeBliss Cab Edition Reloaded = https://github.com/ArcadeBliss/AttractMode-Themes
//
// Included Plugins:
// `````````````````
// I improved on the aesthetics and functionality of the game search module to work in my layout.
// The original game search module by liquid8d = https://github.com/liquid8d/attract-extra/tree/master/modules/objects/keyboard-search
//
// I modified the aesthetics of the game scrolling progress bar to work in my layout.
// Original implementation code by rand0m(creator of Retrodiction layout) and Keil Miller Jr = http://forum.attractmode.org/index.php?topic=2864.0
//
// Special thanks to the developers and contributors of AttractMode and the community.
// Special thanks to Oomek for his helpful advice.
// Special thanks to Damonxxx for ongoing communication and his own theme efforts.
// Special acknowledgement to the original arcade cabinet artist -gjsmsmith- of the CoinOps Project that inspired this layout.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Known Issues:
``````````````
- initially designed for 16:9, should be ok in 16:10, there will be significant stretching in 4:3 and 5:4. The biggest issue might be if the 'scanlines' or 'CRT Shader' effects are being stretched. I will test 4:3 myself at some point in the future. But 16:10 and 5:4 or anything not mentioned will need somebody to be a test guinea pig. Let me know if you are interested to test this.

Coming in future:
````````````````
- game list scroll bar (yoyo) to cater to different sorting methods of user preference as set in attract.cfg file
- adapting to other resolution ratios? may require a separated download version, especialy if vertical orientation
- already I have a few ideas on what I would like to implement next, but I am eager to hear your suggestions and feedback

Changelog:
```````````
26.1.2021 beta-v9
- the unused outer edges of the 'scanlines' overlay file (if you are not using 'CRT Shader') are now no longer visible.
- improved the appearance of the 'scanlines' overlay.
- Damonxxx request: layout option to toggle the game metadata 'game title' appearance from 'wrappable two line' or 'single line only'.

25.1.2021 beta-v8
- finalised the artwork naming convention so to not conflict with AttractMode screensaver functionality.
- expanded on the layout options for selectable default marquee. This is all done inside layout options now.
- created a new layout option for choosing CRT-Shader or Scanlines for the cabinet screen.

18.1.2021 beta-v7
- the 'previous cabinet leaving' animation is removed due to my creation of a better suited multi-cabinet layout instead.
- completed modulation of the layout components.
- Damonxxx request: fade out animation on game title screens.
- more tweaks to shader usage.
- minor code tweaks throughout.

11.1.2021 beta-v6
- Bug Fix: changed incorrect artwork identifiers from "snap" to "tscreen"
- improved efficiency of shader usage

11.1.2021 beta-v5
- Bug Fix: First game in list was shown as 00 on the game counter. Now it will show as 01.
- game counter automatically adapting digit syntax to your romlist. For example; 00240 of 10100, 0431 of 5379, 087 of 423, 020 of 187, 03 of 15 etc.
- Trbomoble request: cabinet 'leaving' animation.
- Incorporation of new artwork type 'Title Screens'. Increases game list scrolling performance and works well with the 'leaving' cabinet animation.
- Further modulation of layout components.
- Arrange cabinet slide time 'layout setting' options in numerical order.
- minor code tweaks throughout.

5.1.2021 beta-v4
- Game Room neon sign re-attached with blur matching the background video.
- Damonxxx request: game counter shown as a four digit number. For example; 0033 of 0333.
- Scrolling progress bar (aka the yoyo) modified to fit with the recent modifications of metadata expansion and the new game counter.
- System logo modified to line up with the new game counter and scrolling progress bar.
- Alpha channel modification to metadata area and game counter so they should be readable on light or dark backgrounds now.

2.1.2021 beta-v3
- Damonxxx request: layout option to set a default marqueedef.png or just have an 'empty' plain black appearance.
- extra fields of game info data will now be displayed if you have it in your romlist.txt
- lessened the gap between logos in the vertical game list so it fits with the extended game info section.
- lessened the blur effect on the background video. I felt it was too strong and lost too much detail in the back half of the room.
- tick sound effect added to game list navigation.
- more minor code tweaks throughout.

30.12.2020 beta-v2
- major rewrite fixing memory leak and greatly improving performance.
- Damonxxx request: increased number of logos in the game list to an optimal 7.
- Damonxxx request: vertical game logo list now has 'show' or 'fade & hide' setting under layout options.
- Damonxxx request: setting under layout options to enable or disable system logo.
- new selected game logo effect.
- improved search engine.
- improved and increased the 'cabinet slide time' setting under layout options.

25.12.2020  beta-v1
- Initial release

Installation:
````````````
**DELETE** any old 'DynamicArcade' versions folder from inside your AttractMode/Layouts/ folder FIRST. With my major rewrites you don't want any left over from previous versions interfering.
Download zip and extract the `DynamicArcade` folder into the layouts folder of AttractMode
https://drive.google.com/file/d/1QJ602bRMAS7IYOXpUA-eVlOERraaq3UM/view?usp=sharing

Troubleshooting:
````````````````
When upgrading to a new version of 'DynamicArcade' it can be a good idea to reset any 'DynamicArcade' saved settings back to DEFAULTS by making these changes in your AttractMode attract.cfg file:
1) Open attract.cfg file
3) Find this 'sub heading':
layout_config   DynamicArcade
4) Delete this 'sub heading' and it's related settings. Your 'DynamicArcade' will now reset to default settings.
5) Run AttractMode and set the 'DynamicArcade' layout options to your liking.
6) Here is an example of what 'DynamicArcade' default settings look like:
layout_config   DynamicArcade
   param                cabslide 750
   param                defmarquee arcade
   param                dsl yes
   param                mdgta single_line
   param                quick_clear custom2
   param                screenfx scanlines
   param                search_control custom1
   param                search_method only_results
   param                ucd1 OPTIONS BELOW
   param                ucd2 OPTIONS BELOW
   param                vertshow fade_hide

If, when under layout options 'crt_shader' is selected and you are getting a black video screen in the cabinet instead of video-snaps playing. In other words, you can *hear* the video playing, but you can't *see* any video playing on the cabinet screen. Then change the layout option to 'scanlines' instead. Initially a work around for non Nvidia users, can also be for users that prefer that style of cabinet screen appearance.


I'm hoping that others will find it easy to follow my layout. I've learnt a lot over the last six months and know how hard it can be when you are starting off. I feel that the easier it is for others to learn then they too can create and release layouts. Thereby teaching me new tricks or ideas in return. If I learned something everyday then it would be a win-win. So, here's hoping for more releases in 2021! ;D

3
Scripting / Calling an external nut
« on: October 16, 2020, 04:47:07 PM »
Hopefully this is a quick one to solve.. What am I missing?

local metabox = fe.add_surface(574, 100);
local metadata = metabox.do_nut("scripts/metadata.nut");
metabox.x= 1320
metabox.y= 365

My end goal is I was thinking of adding a delay or animation to all my metadata fields in one go.. But if that's not possible then I will just code it individually.

4
Hi, after hanging around here for some time, I've decided to have a dabble at theme creation.

I've hit a brick wall with an animation of an artwork (logo2).. I can get it to function correctly at layout start or at the end of navigation.
But not functioning correctly at both times. It will only animate at one of these times, or I get a duplicate appearing in the same place. (one static and one animated)

In the below example, we have logo1 which is correctly a static image which is displayed for two seconds. Then we have a video snap which appears in the static logo1's place.
While the video snap is playing the static logo1 is hidden. And we get a new logo2a appear on the right-hand side of the screen that has a short animation.
This logo2a is what is giving me problems. It won't animate at both layout start and at end of navigation. It will only do one or the other.

Code: [Select]
////////////////////////////////////////////////////////////////////////////
//
// Attract-Mode animate logo test
//
//  using these artwork names for folder paths:
//  glogo1 = game logo
//  glogo2 = game logo (just set to same path as above)
//  gvideo = game video snap
//
////////////////////////////////////////////////////////////////////////////
fe.layout.width = 1920;
fe.layout.height = 1080;

// _________________________________________________________________________
//           LOAD MODULES & PLUGINS
// `````````````````````````````````````````````````````````````````````````
fe.load_module("preserve-art") //load preserve-art module
fe.load_module("animate");
fe.do_nut("scripts/reload.nut"); //Reload your layout with button press, great when editing theme.

// _________________________________________________________________________
//      FIRST WE'LL DISPLAY THE GAMES LOGO WHERE THE VIDEO WILL APPEAR
// `````````````````````````````````````````````````````````````````````````
local logo = PreserveArt( "glogo1", 758, 272, 400, 300 );
logo.set_fit_or_fill( "fit" );
logo.set_anchor( ::Anchor.Center );
logo.mipmap = true;

local settings =
{
delay_timer = 0,
play_delay = 2000,
}

local video = fe.add_artwork("gvideo", 719, 242, 480, 360 )
video.preserve_aspect_ratio = true;
video.mipmap = true;
video.trigger = Transition.EndNavigation;

function video_on_transition(ttype, var, transition_time)
{
if (ttype == Transition.StartLayout || ttype == Transition.ToNewList || ttype == Transition.FromOldSelection)
{
settings.delay_timer = fe.layout.time
video.visible = false
}
return false
}

function video_on_tick(tick_time)
{
if (video.video_playing && tick_time - settings.delay_timer >= settings.play_delay) video.visible = true
}
fe.add_ticks_callback(this, "video_on_tick")
fe.add_transition_callback(this, "video_on_transition")

// _________________________________________________________________________
//           THEN WE'LL HIDE THE LOGO WHILE THE VIDEO IS PLAYING
// `````````````````````````````````````````````````````````````````````````
function hide_on_tick(tick_time)
{
if ( video.visible == true ) logo.visible = false
else if ( video.visible == false ) logo.visible = true
}
fe.add_ticks_callback(this, "hide_on_tick")

// _________________________________________________________________________
//   THEN ADD A SECOND GAME LOGO IN TOP RIGHT CORNER ONCE VIDEO IS PLAYING
// `````````````````````````````````````````````````````````````````````````
local logo2a = fe.add_artwork( "glogo2", 1400, 300, 400, 300 );
local logo2a_scale_cfg = {
when = Transition.EndNavigation,
property = "scale",
start = 0.0,
end = 1.0,
time = 1250,
delay = 2000
tween = Tween.Linear,}
animation.add( PropertyAnimation( logo2a, logo2a_scale_cfg ) );

function logo2a_on_transition(ttype, var, transition_time)
{
if ( ttype == Transition.StartLayout || ttype == Transition.EndNavigation )
{
settings.delay_timer = fe.layout.time
logo2a.visible = false
}
return false
}

function logo2a_on_tick(tick_time)
{
if ( logo.visible == true ) logo2a.visible = false
else if ( logo.visible == false ) logo2a.visible = true
}
fe.add_transition_callback( this, "logo2a_on_transition")
fe.add_ticks_callback( this, "logo2a_on_tick")

The above layout.nut will have the animation of the second logo not functioning on layout start. It shows, but appears static.
When you perform an end of navigation, then a correctly animated second logo will appear.
How can I achieve the animated second logo on both layout start and at the end of a navigation?

Pages: [1]