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 - Arcadefan1

Pages: [1] 2
1
Hi guys!
I think of adding a little feature to my layout. But I have no idea where to start. ;) I want to use my spinner to navigate through the games list. The spinner is just emulating the mouse movement on the „X“ axis. I have no idea how to make mouse movement accessible in a script. Has anyone done something like this?
Any help is appreciated!

2
Scripting / Re: Changing the ordering of a list on the fly
« on: January 27, 2019, 11:49:55 AM »
Bump. I would like to know too.

3
Scripting / Re: Particle animation question
« on: January 15, 2019, 10:27:59 AM »
I seem to have a more basic problem with this. I can't change any property of the particle animation after it is created. Let say I try to set "y" to 0. no matter what syntax I try, I am not getting anywhere.

Code: [Select]
local particle_cfg = {
    resources = [ "resources/mario.png", "resources/link.png" ],    //file resources - comma separated
    ppm = 30,               //how many particles per minute will be created
    x = 50,                  //the x location of the particle emitter
    y = 100,                  //the y location of the particle emitter
    width = 100,           //the width of the particle emitter
    height = 360,             //the height of the particle emitter
    speed = [ 100, 250 ],   //randomizes the speed of the resource when it is first created
    angle = [ 0, 15 ],     //the angle where particles will be emitted (min, max)
    startScale = [ 1, 1 ],  //randomizes the scale of the resource when it is first created
    gravity = 0,            //gravity attached to the particle
    fade = 0,           //fade the alpha over time
    lifespan = 10000,       //how long the resource will 'live'
    scale = [ 0.5, 0.5 ],     //scale the resource over its lifespan
}

animation.add( ParticleAnimation( particle_cfg ) );

// try to change the y property after the animation was created

ParticleAnimation.y = 0;


This is the code I have put I n my layout file. Whatever syntax I have tried to change the value of "y" after the animation was created didn't work.

The final question is:
How do I change any property of the particle animation after it was created with the initial settings?

Any help is appreciated:)

4
Scripting / Re: Particle animation question
« on: January 07, 2019, 10:01:05 PM »
That doesn't seem to work. The particle animation stays visible.

5
Scripting / Particle animation question
« on: January 06, 2019, 11:18:08 AM »
Hi guys!
I am playing around with particle animation. I have one question. How can I make a particle animation visible or invisible!

Code: [Select]
ParticleAnimation.visible = false;

This doesn't work.

Can someone give me a hint please?

6
I am not a pro, but don't you need to use a transition callback? Something like "to new selection"?

7
Scripting / Re: Possible to get a stroke/outline around text?
« on: February 22, 2018, 10:16:59 PM »
I had the same problem. I just displayed the list twice. One time in black and one time in the desired color on top of it, just a few pixel off. That gives it a shadow effect. If you want it outlined, maybe try a different font size..

8
Scripting / Re: Need help with ".file_name.length ()" please
« on: February 11, 2018, 10:03:22 PM »
Ah, ok. I wrote the lines from my memory here, so I guess I just forget the braces. Sorry. I think it has something to do with the way it references to the table "pictures". The code works, when used on a normal variable. But thx for pointing it out.

9
Scripting / Need help with ".file_name.length ()" please
« on: February 11, 2018, 04:19:06 AM »
Can someone please tell me why my code doesn't work? I want to do stuff when the length of a filename is larger then zero. Basically it should do stuff if the file is existing... the "if" statement always equals zero. Can someone tell me how to get the length of the filename?

Code: [Select]
Picture [ "pic" ] <- surface.add_artwork (config "image",0,0,surface.width,surface.height)

If Picture [ "pic" ].file_name.length() > 0
{
// do stuff
}


10
Scripting / Re: Enable/disable plugins on-the-fly from script?
« on: January 31, 2018, 07:01:15 AM »
Edit the config file and reload the layout. Only way I can think of. It’s a pain. May I ask why you need to disable/enable plugins on the fly? Maybe they better off loaded as a module?

I am trying to create a module that shows the game flyer artwork. When a certain action button is pressed and held down, then the artwork pops up and by using the joystick and two other action buttons you can zoom in and out and navigate across the artwork. I use a CRT, so you can't see details when a flyer is shown even in fullscreen. I can 'capture' all inputs, but a button with a plugin assigned to it will always run the plugin. No matter what I do...
but you are right, I could convert the plugin to a module. Didn't thought of that. Thanks!

11
Scripting / Re: Enable/disable plugins on-the-fly from script?
« on: January 30, 2018, 08:46:48 AM »
My workaround was rethinking my control panel design. 😉 I swapped around some buttons, so I don't interfere with the plugin buttons... but it would be nice to know how to disable a plugin...

12
Scripting / Re: Enable/disable plugins on-the-fly from script?
« on: January 21, 2018, 03:34:26 AM »
Ok, I found a workaround for my specific problem.

But still I am curious, is it possible to enable or disable a plugin via a line of code?

13
Scripting / Enable/disable plugins on-the-fly from script?
« on: January 20, 2018, 08:41:51 AM »
Hi!
Is there a way to enable or disable a plugin from within a script?

Thanks guys

14
Scripting / Re: Ultimarc ServoStik Plugin
« on: December 31, 2017, 03:15:58 AM »
Hi skeeboe,
Here is mine. It works for my setup. I think you need to check what your "(fe.game_info( Info.Control )" actually contains in your setup. That's what I needed to change to get it working here...

I also added the option to switch it to 4-way when it's actually a 2-way stick game.
And I only set it when entering a game. When leaving a game I don't switch at all, because in my Layout it doesn't matter if it's 4-way or 8-way.


Code: [Select]
///////////////////////////////////////////////////
//
// Attract-Mode Frontend - JoyTray plugin
//
// For use with the Ultimarc ServoStik
//
///////////////////////////////////////////////////

//
// The UserConfig class identifies plugin settings that can be configured
// from Attract-Mode's configuration menu
//
class UserConfig </ help="Integration plug-in for use with the JoyTray software provided by Ultimarc: http://www.ultimarc.com" /> {

</ label="Command", help="Path to the JoyTray executable", order=1 />
command="C:/Program Files (x86)/JoyTray/JoyTray.exe";
}

local config=fe.get_config(); // get user config settings corresponding to the UserConfig class above

//
// Copy the configured values from uconfig so we can use them
// whenever the transition callback function gets called
//

fe.add_transition_callback( "joytray_plugin_transition" );

function joytray_plugin_transition( ttype, var, ttime ) {

if ( ScreenSaverActive )
return false;

switch ( ttype )
    {
case Transition.ToGame:
if (fe.game_info( Info.Control ) == "joystick (4-way),joystick (4-way)")
fe.plugin_command_bg( config["command"], "-servo joy4way" );
else if (fe.game_info( Info.Control ) == "joystick (2-way),joystick (2-way)")
fe.plugin_command_bg( config["command"], "-servo joy4way" );
else
fe.plugin_command_bg( config["command"], "-servo joy8way" );
break;

// case Transition.FromGame:
// fe.plugin_command_bg( config["command"], "-servo joy8way" );
// break;
}

return false; // must return false
}

15
Scripting / Re: KeyboardSearch module
« on: December 11, 2017, 05:15:52 AM »
Hi guys!
I've figured it out. When I add a line of code, the search result will update the shown artwork on the fly, every time you change the search term. Before the change it seems that it is only done when the "fe.list.search_rule" is set with content for the first time. After that the artwork won't refresh. So what I did was clear the search_rule before adding another letter to the search term...

Look at the code snippet...
Code: [Select]
//update the current search rule
    function update_rule()
    {
        try
        {
            local rule = "Title contains " + _massage(text)
            print( "Rule: " + rule )
            switch ( config.mode )
            {
                case "next_match":
                    print("jumping to: " + text)
                    if ( text.len() == 0 ) return
                    local s = fe.filters[fe.list.filter_index].size
                    for ( local i = 1; i &lt; s; i++ )
                    {
                        local name = fe.game_info( Info.Title, i ).tolower()
                        if ( regexp( text ).capture(name) ) {
                            fe.list.index = (fe.list.index+i)%s
                            break
                        }
                    }
                    break
                case "show_results":
                default:
                    print("results for: " + text)
                    //fe.list.search_rule = "Title contains mario"

 // the following line does the trick
    fe.list.search_rule = ""
// -------------------------------------------------

                    fe.list.search_rule = ( text.len() &gt; 0 ) ? rule : ""
                    break
            }
        } catch ( err ) { print( "Unable to apply filter: " + err ); }
    }


I run attract mode on my vertical CRT cab. Have a look at how I have integrated the search module...
http://sendvid.com/thyu2zdh
Probably not the best video hoster, but I have no idea how to show you guys a video here

Edit:

Ok! Just skip the video if you don't have an add blocker... it just showed me an ass. ;) ok, the ass was not bad, but who knows what comes along with it..????

Pages: [1] 2