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.


Messages - qqplayer

Pages: [1] 2 3 ... 20
1
Scripting / Re: ToDisplay transition?
« on: May 29, 2020, 12:26:12 PM »

2
I love it, thank so much for your work.

3
Themes / Re: Attract Mode MachiRoomNesScroll Layout Beta 1.0
« on: May 10, 2020, 02:23:43 AM »
Re-up  ;)

4
Scripting / Re: how do you animate artwork?
« on: April 27, 2020, 08:11:01 AM »
You can use this:
Code: [Select]
Transition.ToGame ,property = "y"

Code: [Select]
/////////////////////
//Layer1
/////////////////////
local layer1_fadein = fe.add_image("../../modules/fade_in/media/[Emulator]/_Default/Layer 1.png", flx*0, fly*0, flw, flh );
layer1_fadein.alpha=0;

 local move_layer1_fadein = {
    when = Transition.ToGame ,property = "y", start = fly*-10, end = fly*0.85, time = 100,
 }


animation.add( PropertyAnimation ( layer1_fadein, move_layer1_fadein ) );

5
Scripting / Re: Grid-Text (conveyor module) its posible?
« on: April 17, 2020, 08:50:30 AM »
@jedione Im trying to make something like this.



I supose you are using arcadeblis conveyor_helper
https://github.com/ArcadeBliss
http://forum.attractmode.org/index.php?topic=1945.0

But I want to make a grid layout, so i cant use arcadebliss module.
I have to use the conveyor module, so conveyor (mickelson) ≠ conveyor_helper (ArcadeBliss)

https://github.com/mickelson/attract/blob/master/config/modules/conveyor.nut

Code: [Select]
///////////////////////////////////////////////////
//
// Attract-Mode Frontend - "conveyor" module
//
// The 'orbit' and 'grid' layouts are good examples of the usage of this
// module
//
///////////////////////////////////////////////////
const CONVEYOR_VERSION=2;

///////////////////////////////////////////////////
//
// ConveyorSlot class
//
// A class that extends this class and reimplements its on_progress() function
// needs to be created if you want to use the Conveyor class to manage
// a transition effect.
//
// The on_progress() function should place/scale/etc. whatever object(s)
// are being displayed appropriately.  The placement should be based on the
// value of the "progress" variable, which ranges from 0.0 to 1.0.  This range
// represents the full range of motion over which the conveyor will move the
// slot objects.
//
///////////////////////////////////////////////////
class ConveyorSlot
{
constructor( obj=null ) { m_obj = obj; }

function get_base_progress() { return m_base_progress; }
function get_base_index_offset() { return m_base_io; }

//
// These functions can be overridden for anything
// more complicated (than a single Image object)
//
function swap( other )
{
try
{
m_obj.swap( other.m_obj );
}
catch ( e )
{
// fallback if swap doesn't exist
local tmp = other.m_obj;
other.m_obj = m_obj;
m_obj = tmp;
}
}

// Set the index offset and trigger a redraw:
function set_index_offset( io ) { m_obj.index_offset = io; }

// Reset the index offset, preferably without triggering a redraw:
function reset_index_offset()
{
try
{
m_obj.rawset_index_offset( m_base_io );
}
catch ( e )
{
// fallback if rawset doesn't exist
set_index_offset( m_base_io );
}
}

//
// This function must be overridden in a class that extends this class
// for anything interesting to happen
//
function on_progress( progress, var ) {}

// For convenience, we forward the setting of things that we
// don't know about to the underlying object
//
function _set( idx, val ) { m_obj[idx]=val; return val; }

//
// Implementation details that may change in future versions:
//
m_base_io=0;
m_base_progress=0.0;
m_obj = null;
}

///////////////////////////////////////////////////
//
// Conveyor class
//
// Create an instance of the Conveyor class to manage the navigation
// transitions for a series of ConveyorSlot-derived objects
//
// Use the set_slots() function to set the array of ConveyorSlot objects
// that the conveyor is to manage.
//
// These ConveyorSlot objects will be spread out evenly over a notional
// "progress" range from 0.0 to 1.0.  In all cases where the slot objects need
// to be placed, that will be done by calling the slot object's on_progress()
// function with the corresponding "progress" value for the object.
//
// The on_progress() function is called to place the ConveyorSlot objects both
// in their resting position as well as during each frame of a transition.
//
///////////////////////////////////////////////////
class Conveyor
{
//
// Set this to the length of time it should take to complete a
// transition (in milliseconds)
//
transition_ms = 220;

//
// Set this to a value other than 1 if you want the conveyor to jump entries
// at a set rate when advancing over multiple entries at once.  This value
// represents how many entries should be advanced with each 'stride'.  See
// the grid layout for an example usage.
//
stride = 1; // must be 1 or greater

//
// The transition_progress value that the transition swap occurs at
//
transition_swap_point = 0.5;

//
// This gets set during transitions to a value between 0.0 (beginning)
// and 1.0 (end) depending on where we are at in the transition
//
transition_progress = 0.0;

//
// This gets set to the slot index that contains the current selection
//
selection_index = 0;

//
// Set this to false to disable the conveyor
//
enabled = true;

constructor()
{
fe.add_transition_callback( this, "on_transition" );
}

//
// Set the array of ConveyorSlot objects to be used.
// sel_index is the array index of the object that should
// contain the current selection
//
function set_slots( objs, sel_index=-1 )
{
if ( sel_index < 0 )
selection_index = objs.len() / 2;
else
selection_index = sel_index;

m_objs = [];

for ( local i=0; i<objs.len(); i++ )
{
m_objs.push( objs[i] );
m_objs[i].m_base_progress = i.tofloat() / objs.len();

m_objs[i].m_base_io = i - selection_index;

m_objs[i].reset_index_offset();
m_objs[i].on_progress( m_objs[i].m_base_progress, 0 );
}
}

//
// Set the current selection on the conveyor
// sel_index is the array index of the object that should
// contain the current selection
//
function set_selection( sel_index=-1 )
{
if ( sel_index < 0 )
selection_index = m_objs.len() / 2;
else
selection_index = sel_index;

for ( local i=0; i<m_objs.len(); i++ )
{
m_objs[i].m_base_io = i - selection_index;
m_objs[i].set_index_offset( m_objs[i].m_base_io );
}
}

// Internal swap function used in on_transition()
function _swap( var, adjust )
{
local a = ( stride < abs( var ) ) ? stride : abs( var );

if ( var < 0 )
{
for ( local i=0; i < a; i++ )
m_objs[ m_objs.len() - a + i].set_index_offset(
m_objs[i].m_base_io - adjust );

for ( local i=m_objs.len()-1; i>=a; i-- )
m_objs[i].swap( m_objs[i-a] );
}
else
{
for ( local i=0; i < a; i++ )
m_objs[i].set_index_offset(
m_objs[m_objs.len() - a + i].m_base_io + adjust );

for ( local i=0; i < m_objs.len()-a; i+=1 )
m_objs[i].swap( m_objs[i+a] );
}
}

function on_transition( ttype, var, ttime )
{
if ((!enabled) || ( ttype != Transition.ToNewSelection ) || ( m_objs.len() < 1 ))
return false;

if ( ttime < transition_ms )
{
transition_progress = ttime.tofloat() / transition_ms;

local moves = ( stride == 1 ) ? abs( var ) : 1;

local jump_adjust = 0;

// Adjust for situation where we are skipping
// ahead
if ( moves > m_objs.len() )
{
jump_adjust = moves - m_objs.len();
moves = m_objs.len();
}

local move_duration = transition_ms / moves;

if ( moves > 1 )
{
local curr_move = ttime / move_duration;

if ( curr_move >= m_last_move + stride )
{
m_last_move = curr_move;
_swap( var, curr_move + jump_adjust );
}
}

//
// Optimization: Attract-Mode will reload artworks according to their
// index_offset once this transition is complete.  However it is smart
// enough to not reload where the container already holds an image/video
// for the game that is going to be displayed.  The following swap results
// in the artwork images being in the right place to make use of this feature
//
if ( !m_did_move_swap && ( transition_progress > transition_swap_point ))
{
_swap( var, abs(var) );
m_did_move_swap=true;
}

local move_progress = ( ttime % move_duration ).tofloat()
/ move_duration
/ m_objs.len()
* (( var > 0 ) ? -1 : 1);

//
// Correct the move progress if we've done the 'move swap'
//
if ( m_did_move_swap )
{
if ( var < 0 )
move_progress -= 1.0/m_objs.len();
else
move_progress += 1.0/m_objs.len();
}

foreach ( o in m_objs )
o.on_progress( o.m_base_progress + move_progress, var );

return true;
}

// it is possible that we haven't done the move swap at this point
// so make sure it is done now...
if ( !m_did_move_swap )
_swap( var, abs(var) );

foreach ( o in m_objs )
{
o.reset_index_offset();
o.on_progress( o.m_base_progress, 0 );
}

m_last_move=0;
m_did_move_swap = false;
return false;
}

function reset_progress()
{
foreach ( o in m_objs )
o.on_progress( o.m_base_progress, 0 );
}

//
function _set( idx, val )
{
foreach ( o in m_objs )
o[idx]=val;

return val;
}

m_last_move = 0;
m_did_move_swap = false;
m_objs = [];
};

///////////////////////////////////////////////////
// SimpleArtStripSlot class - used by SimpleArtStrip
///////////////////////////////////////////////////
class SimpleArtStripSlot extends ConveyorSlot
{
m_p=null;
constructor( parent, artname )
{
m_p=parent;
base.constructor( ::fe.add_artwork( artname ) );
}

function on_progress( progress, var )
{
m_obj.width = m_p.m_width;
m_obj.height = m_p.m_height;
m_obj.x = m_p.m_x + progress * m_p.m_x_span;
m_obj.y = m_p.m_y + progress * m_p.m_y_span;
}
};

///////////////////////////////////////////////////
//
// SimpleArtStrip class
//
// Create a simple artwork strip that smoothly animates a transition when
// the selection changes
//
// SimpleArtStrip( artwork_label,num_objs,x,y,width,height,pad=0 )
//
// Parameters:
//
//   artwork_label - the label of the artwork to show in the strip (i.e. "snap")
//   num_objs - the number of artwork objects to show in the strip
//   x - the x position of the top left corner of the strip
//   y - the y position of the top left corner of the strip
//   width - the width of the entire strip
//   height - the height of the entire strip
//   pad - the amount of padding to insert between each object in the strip
//        (default value of 0)
//
// If height>width, you will get a vertical strip.  Otherwise the strip will
//  be horizontal.
//
// Usage example.  The following code creates a strip of 5 snap artworks across
// the top of the screen:
//
//    local my_strip = SimpleArtStrip( "snap", 5, 0, 0,
//             fe.layout.width, fe.layout.height/3, 2 );
//
///////////////////////////////////////////////////
class SimpleArtStrip extends Conveyor
{
m_x=0; m_y=0; m_width=0; m_height=0; m_x_span=0; m_y_span=0;

constructor( artwork_label, num_objs, x, y, width, height, pad=0 )
{
base.constructor();
local my_list = [];
for ( local i=0; i<num_objs; i++ )
my_list.push( SimpleArtStripSlot(this,artwork_label) );
set_slots( my_list );

m_x=x+pad/2; m_y=y+pad/2;
if ( width < height )
{
m_x_span=0;
m_y_span=height;
m_width=width-pad;
m_height=height/m_objs.len()-pad;
}
else
{
m_x_span=width;
m_y_span=0;
m_width=width/m_objs.len()-pad;
m_height=height-pad;
}

reset_progress();
}
};


I cant figure out how to make ''SimpleArtStripSlot class'' to create  text based things.
I mean, works great with ''fe.add_artwork'' but brokes with ''fe.add_text''

Some examples:

Works:

Code: [Select]
m_art =fe.add_artwork ( "flyer", 0, 0,
width - 2*PAD, height - 2*PAD );

Does not work:

Code: [Select]
    m_text = fe.add_text( "[Title]", 0, 0,
width - 2*PAD, height - 2*PAD );


I supose that the problem is the conveyor.nut itself, includes this code

Code: [Select]
///////////////////////////////////////////////////
// SimpleArtStripSlot class - used by SimpleArtStrip
///////////////////////////////////////////////////
class SimpleArtStripSlot extends ConveyorSlot
{
m_p=null;
constructor( parent, artname )
{
m_p=parent;
base.constructor( ::fe.add_artwork( artname ) );
}

function on_progress( progress, var )
{
m_obj.width = m_p.m_width;
m_obj.height = m_p.m_height;
m_obj.x = m_p.m_x + progress * m_p.m_x_span;
m_obj.y = m_p.m_y + progress * m_p.m_y_span;
}
};

So anyone can make the convero.nut to work with Magic Tokens like

Code: [Select]
[Name] - the short name of the selected game
[Title] - the full name of the selected game

7
Scripting / Grid-Text (conveyor module) its posible?
« on: April 16, 2020, 11:38:32 AM »
I´m trying to figure out if its there any chance to add this feature to the conveyor module.
I mean I want a grid with both, names and artwork.
So when the artwork its missed you can just see the game name.
Anyone?

8
Scripting / Re: Function to add a tag or Extra info
« on: March 28, 2020, 01:26:29 PM »
I was thinking on a dirty solution.
Maybe you can just edit your romlist with some sort of command line by creating a plugin.

https://stackoverflow.com/questions/21418748/insert-a-string-number-into-a-specific-cell-of-a-csv-file

You always now the column number, just need a function to get the row of the selected game on the  romlist.

Code: [Select]
fe.game_info( index_offset+1 )

9
General / Re: filtering rom on display
« on: March 24, 2020, 10:05:53 AM »
Open your attract.cfg
Filters goes just behind your display settings.
This its an example from a recent post.

Code: [Select]
display   DefenderPlus8way
   layout               basic_panels_DefenderPlus8way
   romlist              mame_defenderplus8way
   in_cycle             yes
   in_menu              yes
   global_filter       
      rule                 FileIsAvailable equals 1
   filter               Faves
      rule                 Tags contains faves
   filter               Good
      rule                 Tags contains good|faves
   filter               Defenders
      rule                 Tags contains defender
   filter               The_Rest_8way
      rule                 Tags not_contains faves
      rule                 Tags not_contains good
      rule                 Tags not_contains defender

10
Scripting / Re: Animations
« on: March 22, 2020, 01:15:34 PM »
Maybe this will work "wait = true,"
Im not sure because you are triggering the second animation with  "when = Transition.ToNewSelection,"



Code: [Select]
   local start_transition1 = {
      when = Transition.StartLayout,
      property = "y",
      start = fly*2,
      end = fly*y,
      time = (ini_anim_time+400)
      wait = true,
   }
   animation.add( PropertyAnimation( boxart, start_transition1 ) );


11
General / Re: filtering rom on display
« on: March 21, 2020, 04:52:52 PM »
Try just

Code: [Select]
filter               NeoGeo
sort_by              Name
rule                 CloneOf not_equals .+
rule                 AltRomname contains neogeo

12
General / Re: filtering rom on display
« on: March 19, 2020, 07:21:20 AM »
Paste your mame.txt romlist.

Code: [Select]
#Name;Title;Emulator;CloneOf;Year;Manufacturer;Category;Players;Rotation;Control;Status;DisplayCount;DisplayType;AltRomname;AltTitle;Extra;Buttons
88games;'88 Games;MAME;;1988;Konami;Sports / Track & Field;4P alt / 2P sim;0;only_buttons,only_buttons,only_buttons,only_buttons;good;1;raster;;;;
flagrall;'96 Flag Rally;MAME;;1996;Promat?;Maze / Driving;1P;0;joystick (8-way);good;1;raster;;;;
pr_lday;'L' Of A Day (Project) (Cash set) (PROCONN);MAME;;199?;Project;Electromechanical / Reels;???;;;preliminary;0;;;;mechanical;
005;005;MAME;;1981;Sega;Maze / Shooter Small;2P alt;270;joystick (4-way),joystick (4-way);imperfect;1;raster;;;;
1on1gov;1 on 1 Government (Japan);MAME;;2000;Tecmo;Sports / Basketball;2P sim;0;joystick (8-way),joystick (8-way),joystick (8-way),joystick (8-way);imperfect;1;raster;coh1002m;;;
m4tenten;10 X 10 (Barcrest) (MPU4) (T20 0.2);MAME;;199?;Barcrest;Electromechanical / Reels;???;;only_buttons;preliminary;0;;;;mechanical;
10yard;10-Yard Fight (World, set 1);MAME;;1983;Irem;Sports / Amer. Football;2P alt;0;joystick (8-way),joystick (8-way);good;1;raster;;;;
100lions;100 Lions (10219211, NSW/ACT);MAME;;2006;Aristocrat;System / BIOS;BIOS;0;;preliminary;1;raster;aristmk6;;;
mc_dcat8;100 in 1 (D-CAT8 8bit Console, set 1) (v5.01.11-frd, BL 20041217);MAME;;2004;<unknown>;;2;0;joystick (8-way),joystick (8-way);preliminary;1;raster;;;;
mc_aa2;100 in 1 Arcade Action II (AT-103);MAME;;200?;<unknown>;;2;0;joystick (8-way),joystick (8-way);preliminary;1;raster;;;;
gtmr;1000 Miglia: Great 1000 Miles Rally (94/07/18);MAME;;1994;Kaneko;Driving / Race;2P alt;0;joystick (8-way),dial,paddle,joystick (8-way);good;1;raster;;;;
mc_110cb;110 in 1 CoolBaby (CoolBoy RS-1S);MAME;;200?;CoolBoy;;2;0;joystick (8-way),joystick (8-way);preliminary;1;raster;;;;
mc_138cb;138 in 1 CoolBaby (CoolBoy RS-5, PCB060-10009011V1.3);MAME;;200?;CoolBoy;;2;0;joystick (8-way),joystick (8-way);preliminary;1;raster;;;;
progolf;18 Holes Pro Golf (set 1);MAME;;1981;Data East Corporation;Sports / Golf;2P alt;270;joystick (8-way),joystick (8-way);imperfect;1;raster;;;;
18wheelr;18 Wheeler (deluxe) (Rev A);MAME;;2000;Sega;Driving;1P;0;paddle,pedal;preliminary;1;raster;naomi;;;
18w;18 Wheeler (set 1);MAME;;1979;Midway;Electromechanical / Misc.;1P;;paddle,pedal;preliminary;0;;;;mechanical;
1941;1941: Counter Attack (World 900227);MAME;;1990;Capcom;Shooter / Flying Vertical;2P sim;270;joystick (8-way),joystick (8-way);good;1;raster;;;;
pc_1942;1942 (PlayChoice-10);MAME;;1987;Capcom;Shooter / Flying Vertical;2P alt;0;joystick (8-way),joystick (8-way);imperfect;2;raster;playch10;;;
1942;1942 (Revision B);MAME;;1984;Capcom;Shooter / Flying Vertical;2P alt;270;joystick (8-way),joystick (8-way);good;1;raster;;;;
1943kai;1943 Kai: Midway Kaisen (Japan);MAME;;1987;Capcom;Shooter / Flying Vertical;2P sim;270;joystick (8-way),joystick (8-way);good;1;raster;;;;
1943;1943: The Battle of Midway (Euro);MAME;;1987;Capcom;Shooter / Flying Vertical;2P sim;270;joystick (8-way),joystick (8-way);good;1;raster;;;;
1943mii;1943: The Battle of Midway Mark II (US);MAME;;1987;Capcom;;2;270;joystick (8-way),joystick (8-way);good;1;raster;;;;
1944;1944: The Loop Master (USA 000620);MAME;;2000;Eighting / Raizing (Capcom license);Shooter / Flying Vertical;2P sim;0;joystick (8-way),joystick (8-way);good;1;raster;;;;
1945kiii;1945k III (newer, OPCX2 PCB);MAME;;2000;Oriental Soft;Shooter / Flying Vertical;2P sim;270;joystick (8-way),joystick (8-way);good;1;raster;;;;
19xx;19XX: The War Against Destiny (USA 951207);MAME;;1996;Capcom;Shooter / Flying Vertical;2P sim;270;joystick (8-way),joystick (8-way);good;1;raster;;;;
openice;2 On 2 Open Ice Challenge (rev 1.21);MAME;;1995;Midway;Sports / Hockey;4P sim;0;joystick (8-way),joystick (8-way),joystick (8-way),joystick (8-way);good;1;raster;;;;
f2pbball;2 Player Baseball (Fonas);MAME;;1979;Fonas;;2;;only_buttons,only_buttons;good;0;;;;;

To make filters working you need to create a proper romlist.
I made other tutorials.

https://arcadespain.info/Foro/index.php?topic=5480.0
https://arcadespain.info/Foro/index.php?topic=5921.0
https://arcadespain.info/Foro/index.php?topic=5687.0

14
Scripting / Re: filter to text script help
« on: December 07, 2019, 09:39:58 AM »
''filter_offset''

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


Code: [Select]
// Category
local categoryW = floor( bth * 2.5 )
local categoryH = floor( bth * 0.25 )
local categoryX = floor(( flw - crw ) * 0.5 - categoryW * 0.5 + flx)
local categoryY = floor( bth * 0.5 ) - floor( categoryH * 0.5 )
local category = fe.add_text("[FilterName]", categoryX, categoryY, categoryW, categoryH )
category.align = Align.Centre
category.filter_offset = 0
category.style = Style.Regular
category.charsize = floor(category.height * 1000/701)
category.font = "BebasNeueBold.otf"

local categoryLeft = fe.add_text("[FilterName]", 0, categoryY, categoryW, categoryH )
categoryLeft.align = Align.Centre
categoryLeft.filter_offset = -1
categoryLeft.set_rgb(selRGB[0],selRGB[1],selRGB[2])
categoryLeft.style = Style.Regular
categoryLeft.charsize = floor(category.height * 1000/700)
categoryLeft.font = "BebasNeueBook.otf"

local categoryRight = fe.add_text("[FilterName]", 0, categoryY, categoryW, categoryH )
categoryRight.align = Align.Centre
categoryRight.filter_offset = 1
categoryRight.set_rgb(selRGB[0],selRGB[1],selRGB[2])
categoryRight.style = Style.Regular
categoryRight.charsize = floor(category.height * 1000/701)
categoryRight.font = "BebasNeueBook.otf"

local categoryLeft2 = fe.add_text("[FilterName]", 0, categoryY, categoryW, categoryH )
categoryLeft2.align = Align.Centre
categoryLeft2.filter_offset = -2
categoryLeft2.set_rgb(selRGB[0],selRGB[1],selRGB[2])
categoryLeft2.style = Style.Regular
categoryLeft2.charsize = floor(category.height * 1000/701)
categoryLeft2.alpha = 0
categoryLeft2.font = "BebasNeueBook.otf"

local categoryRight2 = fe.add_text("[FilterName]", 0, categoryY, categoryW, categoryH )
categoryRight2.align = Align.Centre
categoryRight2.filter_offset = 2
categoryRight2.set_rgb(selRGB[0],selRGB[1],selRGB[2])
categoryRight2.style = Style.Regular
categoryRight2.charsize = floor(category.height * 1000/701)
categoryRight2.alpha = 0
categoryRight2.font = "BebasNeueBook.otf"

15
Emulators / Re: Problem leaving SSF emu, AM crashes
« on: October 09, 2019, 02:21:29 PM »
you have to add the exact name of your display (see attract-folder\emulator), did you?
my display for Sega Saturn is named "Sega Saturn".
i'm using "EmuHawk" for sega saturn games.

it works with this config:
Code: [Select]
executable           "C:\attract\EMU\Sega Saturn\EmuHawk.exe"
args                 --fullscreen "[romfilename]"
rompath              C:\attract\EMU\Sega Saturn\ROMS
romext               .cue

Yes, I've done it but it doesn't work.

I do not know programming but I have thought this ...

I think the problem is the executable, Attract Mode launch EmuHawk.exe and when it closes EmuHack, Attract Mode use ResFix.
But I use Bat file to launch SSFLoader.exe and this program make virtual CHD disk and launch SSF.exe and SSFLoader it close.
Perhaps Attract Mode is waiting SSFLoader and when it close, return to menu. And when I add "Pause" to bat file, Attract Mode is waiting but if I close SSF.exe, Attract Mode still wait that I close SSFLoader.exe and now i´m using SSF.exe... :P

Sorry, I don't speak English and I don't know if I explained myself well...

Hola, yo tambien uso el ssfloader.
Con las ultmas versiones no necesitas modificar el ssf.exe


Code: [Select]
# Generated by Attract-Mode v2.5.1
#
executable           cmd
args                 /c Y: & cd "Y:\Attrack Mode\systems\SSF\SSF 0.12 PreviewVer R5" & start /wait SSFLoader.exe "[romfilename]"
romext               .chd
nb_mode_wait         5

Pages: [1] 2 3 ... 20