Recent Posts

Pages: [1] 2 3 ... 10
1
Themes / Re: *Solved* Can't get Nevato to work in 2.6.1
« Last post by rbdesouza@2010 on Yesterday at 05:12:53 PM »
CHANGE IN THEME'S layout.nut

//fe.layout.width = 1920;
//fe.layout.height = 1080;

STOP

fe.layout.width = 1920;
fe.layout.height = 1080;

REMOVING // AND SAVING
HAVING FUN
2
Emulators / Re: PCSX2 AVX2 QT launch error...
« Last post by manzarek on Yesterday at 02:24:03 AM »
 ;) ;) ;) ;)
3
Scripting / I'm trying to do in Attract-Mode (Help Needed!) Please
« Last post by gamesmame on April 16, 2025, 05:24:19 PM »
## 🧵 What I'm trying to do in Attract-Mode (Help Needed!)

Hello everyone, I need some help with a layout I'm creating in Attract-Mode.

I'm trying to load custom artwork positions (x, y, width, height) from a per-game `.txt` file and apply them dynamically when the layout is loaded.

---
### ✅ What I have so far

Each game has a corresponding text file like this, stored in:
```
M:/Media/Nintendo Entertainment System/LayoutsData/
```

Example file: `Abadox - The Deadly Inner War (USA).txt`
```
snap_x=100
snap_y=120
snap_w=900
snap_h=680
art3_x=0
art3_y=0
art3_w=1920
art3_h=1080
```

---
### 🧠 My layout.nut logic

I'm using this Squirrel code in `layout.nut`:

```nut
fe.layout.width = 1920;
fe.layout.height = 1080;

function read_config(path)
{
    local config = {};
    try {
        local f = file(path, "r");
        if (typeof f.read_line != "function") {
            print("Invalid file: " + path + "\n");
            return config;
        }

        while (!f.eos())
        {
            local line = f.read_line().strip();
            if (line == "" || line.find("=") == null) continue;
            local parts = line.split("=");
            if (parts.len() >= 2)
            {
                local key = parts[0].strip();
                local value = parts[1].tointeger();
                config[key] <- value;
            }
        }
        f.close();
    } catch(e) {
        print("Error reading config: " + path + "\n");
    }
    return config;
}

local game_name = fe.game_info(Info.Name);
local config_path = "M:/Media/Nintendo Entertainment System/LayoutsData/" + game_name + ".txt";
local cfg = read_config(config_path);

// Default values if not found
local snap_x = cfg.rawin("snap_x") ? cfg["snap_x"] : 100;
local snap_y = cfg.rawin("snap_y") ? cfg["snap_y"] : 100;
local snap_w = cfg.rawin("snap_w") ? cfg["snap_w"] : 640;
local snap_h = cfg.rawin("snap_h") ? cfg["snap_h"] : 480;

local art3_x = cfg.rawin("art3_x") ? cfg["art3_x"] : 0;
local art3_y = cfg.rawin("art3_y") ? cfg["art3_y"] : 0;
local art3_w = cfg.rawin("art3_w") ? cfg["art3_w"] : fe.layout.width;
local art3_h = cfg.rawin("art3_h") ? cfg["art3_h"] : fe.layout.height;

local bg = fe.add_artwork("background", 0, 0, fe.layout.width, fe.layout.height);
bg.preserve_aspect_ratio = false;

local snap = fe.add_artwork("snap", snap_x, snap_y, snap_w, snap_h);
snap.preserve_aspect_ratio = true;

local art3 = fe.add_artwork("artwork3", art3_x, art3_y, art3_w, art3_h);
art3.preserve_aspect_ratio = true;
```

---
### ❌ Issue I'm facing

The layout loads the background and artworks, **but it seems to ignore the values from the config files.** No error appears, but the coordinates from the `.txt` file aren’t being applied.

If I hardcode the values, it works. If I try to apply them dynamically via `.x`, `.y`, `.width`, `.height` after `add_artwork`, then nothing shows.

---
### 🔍 What I tried that **didn’t work**:

```nut
local snap = fe.add_artwork("snap", 0, 0, 640, 480);
if ("snap_x" in cfg) snap.x = cfg["snap_x"];
if ("snap_y" in cfg) snap.y = cfg["snap_y"];
if ("snap_w" in cfg) snap.width = cfg["snap_w"];
if ("snap_h" in cfg) snap.height = cfg["snap_h"];
```

Same thing for `art3`. Nothing is rendered.

---
### 💬 What I'm looking for

I just want to read position values from `.txt` files per game and dynamically apply them to `add_artwork` objects. If someone has done something similar or sees what's wrong, I’d really appreciate any help or working example.

Thanks a lot!
4
Scripting / Re: Help in getting Scrolling Text to go RIGHT and/or VERTICAL
« Last post by jakabasej8 on April 15, 2025, 02:19:11 AM »
I just starting using this feature and love it!

But my text is only scrolling Right to Left, and Horizontal Bounce works also.

But i'm unable to get Horizontal_Right and any of the Vertical options to function.
Even when using the sample object scrolling layout included, The Horiztonal_Right and Vertical examples all scroll Right to Left.

I've searched this forun as best i can, but unable to find out what i'm doing wrong.
Any advice?

Thank you all!
Feels like a demo reel with commitment issues
5
Scripting / Re: [TOOL] Flashpoint Importer for Launchers
« Last post by jakabasej8 on April 15, 2025, 02:18:22 AM »
Just came across this, looking forward to trying it out. I don't want many flash games because it's overwhelming for someone just visiting to play on the cab...may like 100 games in different genres...need an all killer or no filler type list...
Totally get that—100 well-picked games beats a bloated list
6
Scripting / Re: Ultimarc Servo-Stik plugin for Linux
« Last post by jakabasej8 on April 15, 2025, 02:16:08 AM »
In case anyone is interested, there is also an app called LEDSpicer that handles mode switching for ServoStiks, https://kuhinje-nemec.com/ U360s, GGG Rotary and GGG 49-ways based on rom choice or via manual control (it handles LED stuff too). It's not my app, https://atelierrebul.si/shop/category/parfumi-moski-parfumi-75 but I work with the author of it from time to time on documentation and testing. I did some work on the documentation for RGBCommander as well and have used both extensively.

https://sourceforge.net/p/ledspicer/wiki/Home/
https://sourceforge.net/p/ledspicer/wiki/Deployment/

There are some interesting features like the ability to design interactive LED lighting based on inputs. Like.... coin light flashes until a coin is inserted, and then player 1 flashes until pressed. It has support for MAME's output system too, which works great with stuff like blinking LEDs in DigDug and Galaga, or the knocker feature from Qbert. Just know, to use that feature you'd need to be using MAME versions over 188 or so. 188 manages to run old roms like DigDug and Galaga at fullspeed on my Rpi3b+ (as long as I'm not running a monitor in high resolution).

Anyway, sorry for the old topic bump, but I was searching for something and figured it'd be useful to have this info here.
I can't get either of these to work...
I can activate the servos manually with SETSERVOSTIK from command line... but i can't get anything to happen while in attract mode (groovyarcade/arch)
I've generated the romlist and called it arcade.txt as well as mame.txt and put them in the romlists folder (is this the correct filename? does the script look at this filename?)

Ended up getting LEDSpicer working after an issue was fixed through github
Would be good to know what the issue is with RGBc though...
Yes, romlist filename matters.
7
Scripting / Update to popup Plug-In to show image for given game (Instructions)
« Last post by therick3 on April 14, 2025, 01:23:48 PM »
Update for PopUp.net:

As you move through game list this allows a person to press a key and have a specific image (using the game name) to appear.  Great to show game instructions and control layout before selecting a game:

class UserConfig </ help="This plugin will show a popup image when the specified key is pressed." /> {
   </ label="Path to instructions, from .attract folder",
   help="Enter full path assuming you start from .attract folder.", order=1 />
   filePath="/scraper/mame/launch/";
//   </ label="Image", help="The full path to the image that will be displayed", order=1 />
//   image="";
   </ label="Select file extension of instruction file",
   help="File extension to use when opening instructions (png or jpg)", options="png,jpg",   order=2 />
   fileExtension="png";
   </ label="Key", help="The key that will display the image", is_input="yes", order=3 />
   key="";
   </ label="Hold Key", help="If enabled, you must hold the key down", options="Yes,No", order=4 />
   hold="No";
};

class PopUpImage
{
   fileExtension = null;
   filePath = null;
        _image = null;
      _key = null;
      _hold = false;
      _showing = false;
      _key_delay = 250;
      _last_check = 0;
      
        constructor()
        {
         local config = fe.get_config();
         filePath = config["filePath"];
         fileExtension = config["fileExtension"];
         print(filePath+"[Name]."+fileExtension+"\n")
         _image = fe.add_image(filePath+"[Name]."+fileExtension, 0, 0, fe.layout.width, fe.layout.height);
//         _image = fe.add_image(config["image"], 0, 0, fe.layout.width, fe.layout.height );
         _image.visible=false;
         _image.preserve_aspect_ratio = true;
         _key = config["key"];
         _hold = config["hold"];
         fe.add_ticks_callback( this, "on_tick" );
        }

      function on_tick( ttime )
      {
         local is_down = fe.get_input_state( _key );
         if ( _hold == "Yes" )
         {
            _image.visible = is_down;
            _showing = is_down;
         } else
         {
            if ( is_down )
            {
               if ( ttime - _last_check > _key_delay )
               {
                  _last_check = ttime;
                  _image.visible = !_showing;
                  _showing = !_showing;
               }
            }
         }
      }
}

fe.plugin[ "PopUpImage" ] <- PopUpImage();
8
Scripting / Re: Scrolling text?
« Last post by therick3 on April 14, 2025, 01:20:16 PM »
I did a smooth vertical scroll on one of my layouts borrowing code from this post:

http://forum.attractmode.org/index.php?topic=300.0

My give you something to leap off from.

I grabbed something from a layout called Smooth.  here is my code:

// **Add in game description text box taken from Smooth Theme
// setup Overview text
// make the new surface

local surface = fe.add_surface(screenWidth*0.44, screenHeight*0.35  );
surface.x = screenWidth*0.52;
surface.y = screenHeight*0.58;

// put overview text on the new surface
local text = surface.add_text( "Year: [Year]\nPlayed Count: [PlayedCount]\nManufacturer: [Manufacturer]\n\n[Overview]", 0, 0, screenWidth*0.44, screenHeight );
text.word_wrap = true;
text.align = Align.TopLeft;
text.set_rgb (255, 255, 255);
text.charsize = 12;

//text.set_bg_rgb( 100, 100, 100 );
// uncoment the ubove line to visibley see the transparent text layer !
// so can u position and size in layout easier!

// calling "local text" in the animation     
local an = { when=Transition.ToNewSelection,
//local an = { when=Transition.StartLayout,
property="y",
start=text.y+200 ,
end=text.y-340,
time=20000
loop = true,
}
animation.add( PropertyAnimation( text, an ) );
9
General / Re: I can't play on DuckStation and PCSX2 through Attract Mode
« Last post by poyomg on April 12, 2025, 02:27:15 PM »
I faced this issue today, and you don't need to replace all the "/" characters by "\"

Remember, just add a "\" at the end of the rompath.

Here's my example:

Quote
K:\Emulators\PSX DuckStation\PSX ISOs\

This fixed my problem today, hope it helps
10
Scripting / New cfg Generators For Mame + Retroarch
« Last post by JJTheKing on April 12, 2025, 12:10:02 PM »
Emulator cfg Maker

-Mame (You Will Still Need To Add The Bios Files In The Roms Folder For Mame)
-Retroarch (You Will Still Need To Add The Bios Files In The System Folder For Retroarch Plus Download The Cores)

*Select Game System
-In The Dropdown

*Rom File Ext.
-Make Sure You Add . Before Your Ext. Like So .zip
-If You Want To Add More It Would Be Like This .zip;.7z

*Artwork Folders
- Check What Folders You Want To Add In The cfg

*Save Config File
- Once You Click Save It Saves It As The Game System You Choose Like Arcade.cfg

Place These Exe Files In Your Emulators Folder In The Root Of AM+
The Exe Is A False Positive

This Was Made With AutoHotKey And DeepSeek

Grab it Here https://www.mediafire.com/file_premium/qbilqp12ricy2kf/AM%252B_cfg_Generators.7z/file
Pages: [1] 2 3 ... 10