Forums » Community Projects

DroidButtons plugin

123»
Sep 22, 2011 draugath link
Last updated: 2012-11-21
**********************************
There is currently a problem with the touch-to-place interface that causes the game to crash.
I am looking into resolving this issue. In the meantime, you can still click the Advanced button on the definition tab to manually place your buttons.
**********************************


Disclaimer
This is a player-created plugin, and is not an official Guild Software product, and thus not officially supported by Guild Software. Please post in this thread if you encounter a bug, have a question, or have some other support request.

Introduction
The DroidButtons plugin allows users on the Android platform to create additional buttons on the HUD for an enhanced gameplay experience. These buttons can be assigned any commands.

Buttons
Each button can be assigned up to two commands, a short-press command and a long-press command. If a +Command is assigned as a short-press, then the long-press option will be disabled for that button. Commands to control movement of the ship can only be assigned as a short-press command.

Short-press commands are executed immediately (as in the case of +Commands), or upon release of the button if there is no long-press command assigned, or if the button was pressed for less-than the long-press delay if a long-press command is assigned.

The long-press command becomes active after holding the button for one second or longer and releasing it. Some +Commands (eg +Shoot2) can be assigned as a long-press command. If this is done, then the the cancel sequence will also need to be provided (eg +Shoot2 0).

GUI
There is a GUI for management of your buttons. When editing your buttons, there are two methods for placement. The basic placement method opens up the screen for you to tap the screen where you want it to be located. The basic placement method also supports snap-to-grid to help you align all of your buttons. There is also an advanced placement method which allows you to edit the locational and dimensional values of the buttons.

There are two ways to enter the commands you wish to associate with a button. You can press the dropdown arrow to the right of the field to choose from a static list of commands. You can also tap the text field itself to enter a command that is not in the list or to modify a command selected from the list.

Accelerometer *New*(2.0.0-a4)
DroidButtons will also allow you to change what commands are bound to each tilt axis on the accelerometer. Due to issues currently beyond my control, if you enable custom binds on the accelerometer in DroidButtons and then later open Options > Controls, you will need to reopen DroidButtons and reset your preferred tilt commands. If you later decide you don't want custom binds, then after disabling them, you will need to open Options > Controls and reset the defaults in there. These controls are also still kind of rough, but they perform the necessary tasks.

Known Issues
Problem: After using the touch-to-place interface for placing buttons, the long-press option on the default UI buttons becomes disabled, preventing you from changing those buttons.
Solution: The current fix to this involves simply reloading the interface (/reload).

Commands:
/db -- opens the configuration GUI
/con -- this is a shortcut command for /consoletoggle
/reload -- reloads the interface (this command is specific to this plugin)

NOTE on Development
The development version appears to be mostly stable with regards to support for buttons and fields. The UI still needs to be cleaned up somewhat, and there are some additional features slated for the next version that still need to be added.

NOTE on iOS version
I don't have an iOS device to test with. I made some changes that should allow it to be manually loaded with the exact same functionality as on Android. Once you have it unzipped inside the "plugins" directory depicted on the far right in this image then you will need to open the console with the /consoletoggle command and then issue the command: /lua dofile("plugins/droidbuttons/main.lua")

Download:
Development - droidbuttons 2.0.0 a4
iOS - droidbuttons 2.0.0 a4

Installation:
Not all Android devices install Vendetta into the exact same location.
1) Locate the VendettaOnline directory
2) Create a directory named "plugins" within the above directory
3) Unzip the contents of the droidbuttons zipfile into the "plugins" directory
4) Restart the VO

Here is a picture of my Android device showing the entire directory path and files. The path displayed on your device may be different.

Changelog
v.2.0.0-a4
+ added controls for remapping the accelerometer's tilt commands
+ added more detail to the list of buttons

v2.0.0-a2
+ added controls for tweaking a few more options related to touch fields.

v2.0.0-a1
+ alpha release supporting removal of the default touch interface
+ support for touch fields added.

v1.0.1
+ fixed minor bug when no commands are associated with a button.

v1.0.0
+ made a few minor modifications to the GUI to make it a little more polished

v1.0.0-RC4
+ updated Touch-to-Place to work with recent changes to touch mechanics

v1.0.0-RC3
+ removed some debugging lines that I missed when packaging the previous version

v1.0.0-RC2
+ fixed a bug when assigning a command to the long-press and not also the short-press

v 1.0.0-RC1
+ simple placement interface for buttons

v 0.2.0
+ GUI for configuring buttons.

v 0.1.1-1
+ fixed timer bug

v 0.1.1
+ enhanced button press support
   * handles +commands properly
   * long-press commands are assignable

v 0.1.0
+ Initial release
Sep 23, 2011 gled link
Nice, works fine, just need to find the commands for strife up and down... tested with infiniturbo atm...

Atamir
Sep 23, 2011 draugath link
I've been thinking a little more about how +plus commands work, as the strafe commands are, and I will probably need to write some additional handling for them.
Sep 23, 2011 gled link
Yes, plus commands did not work , i tried them in the chat window and it did not work either, did no try in console, anyway it's still a great improvment of the ui, thanks !
Sep 23, 2011 Maalik link
Didn't the devs removed the ability to script movement?
Sep 23, 2011 draugath link
Kinda. So long as it's attached to a bind you can use it. I believe if a certain argument is supplied when the touch region is created it becomes a bind. But I'll find out soon enough.
Sep 23, 2011 don661 link
Horay! Downloading now I'll see if it works
Sep 24, 2011 draugath link
DroidButtons 0.1.1 is now available.

It now properly supports +commands. Yes, this even includes movement +commands. This is possible because they aren't actually scripted but bound to the specified button's touch region, and it requires manual interaction to work.

it also allows you to specify a second command to be run if you hold the button down for over 1 second. You can set a +command to the long-press option, but the long-press is scripted, so movement commands won't work here.
Sep 27, 2011 gled link
And here is a config for tablets users, strafe up/down, chainfire, rotate, targetless and infiniturbo :

db.saved_buttons = {
{title="Reload", command1=ReloadInterface,command2='', command2cancel='', x=250, y=150, w=100, h=64},
{title="Target1", command1="selecttarget1",command2='', command2cancel='', x=1050, y=220, w=100, h=50},
{title="Target2", command1="selecttarget2",command2='', command2cancel='', x=1050, y=270, w=100, h=50},
{title="Target3", command1="selecttarget3",command2='', command2cancel='', x=1050, y=320, w=100, h=50},
{title="TargetNone", command1="targetnone",command2='', command2cancel='', x=1050, y=370, w=100, h=50},

{title="ListSort", command1="lssort",command2='', command2cancel='', x=1150, y=220, w=100, h=50},
{title="ListSwitch", command1="lsswitch",command2='', command2cancel='', x=1150, y=270, w=100, h=50},
{title="Infiniturbo", command1="infiniTurbo",command2='', command2cancel='', x=1150, y=320, w=100, h=50},
{title="RotateCW", command1="+RotateCW",command2='', command2cancel='', x=1150, y=370, w=100, h=50},
{title="RotateCCW", command1="+RotateCCW",command2='', command2cancel='', x=1150, y=420, w=100, h=50},

{title="Up", command1="+StrafeUp",command2='+StrafeUp', command2cancel='+StrafeUp 0', x=110, y=400, w=60, h=50},
{title="Down", command1="+StrafeDown",command2='+StrafeDown', command2cancel='+StrafeDown 0', x=110, y=450, w=60, h=50},
{title="C1", command1="+cfire1", command2='+cfire1', command2cancel='+cfire1 0',x=2, y=610, w=50, h=50},
}
Sep 27, 2011 draugath link
Due to limitations in how the button data will be saved, I had to remove support for calling functions. This means the reload button in your list won't work as it is

If you add the following to the file, after the last }, (and I may do this officially as well) it can work.

RegisterUserCommand("reload", function() ReloadInterface() end)

Then use reload as your command.
Sep 27, 2011 drazed link
Your above targetless binds may conflict with the latest release, which includes list/target swiping.
Sep 27, 2011 draugath link
drazed, unless you removed the commands, there shouldn't be any conflict. It would just be redundant.
Sep 27, 2011 drazed link
by conflict I mean the control touch regions overlap the targetless touch region.

targetless sets up a touch region on 3/4X->X by 1/5Y->3/5Y where X is x resolution and Y is y resolution.

Not sure how VO handles overlapping touch regions.
Sep 27, 2011 draugath link
It appears to work the same way as control stacking. The last one made is on top. I haven't verified this yet.
Sep 28, 2011 draugath link
I've posted an Unstable Release which features an early stage of the configuration GUI. I've put it up for download because I've run into discrepancies between testing on my Linux PC and testing on my Android phone.

If anyone would like to help me test the GUI, I have a specific test I'd like to have reported on, plus general feedback.

Add a button. What behavior does it exhibit? Is the button created in the proper location? Does it respond to your touch?

Thanks.
Sep 29, 2011 don661 link
Sep 29, 2011 don661 link
Above is a picture of my configuration of Droidbuttons, while nuking a cowboy.
Oct 02, 2011 draugath link
I just updated the unstable version to fix an issue with loading saved buttons. 0.2.0-a2 is the latest version. The other display related issues are still present.
Nov 17, 2011 draugath link
I have released version 1.0 release candidate 1.

I have completed all of my initial goals for this plugin and am looking to iron out any remaining bugs in it.
Dec 03, 2011 Arckitel link
{y=128,h=64,title="db",font=18,x=720,command1="db",w=64},{y=192,x=720,title="Reload",h=64,font=18,w=64,command1="reload"},{y=128,x=784,title="Nav",font=18,h=64,command1="nav",w=64},{y=192,x=784,title="Char",font=18,h=64,w=64,command1="charinfo"}

This is the.file you were looking for.I.think for Bear Mauler.