Skip to content

ole1986/a3-exile-scratchie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scratchies (gambling for Exile Mod 1.0.4)

Version Author Exile Arma License

Scratchies is a gambling mod for Arma 3 Exile to let players win prizes, like Vehicles, Poptabs or Weapon crates. The player buys a Scratchie, participate a round and can get the prize at any time through the XM8 apps

Videos: PART #1 PART #2 - thanks to Rythron

Requirements

Installation

By default this package is shipped with a build folder containing all neccessary file to be copied. Please follow the below steps to install the required server and mission files

  • Copy the folder build\@ScratchieServer into your Arma 3 server directory
  • Copy the mission file located in build\@MissionFile into your Arma 3 serer mpmission directory

To allow the scratchie mod using some database commands it is important replace the @ExileServer\extDB\sql_custom_v2\exile.ini with its mysql\exile.ini and overwrite it

Database Setup

The Scratchie mod requires some database tables being installed onto your database server (similar to the ExileMod). In the below example, we use the mysql client from command line install the mysql\scratchie.sql file

C:\User\xxx\Downloads\a3-exile-scratchie> mysql -uexile -p exile
mysql> source mysql\scratchie.sql

Battleye

When you use Battleye, please amend the below BE files to allow remote calls

scripts.txt

  • add the below to the end of line 7 remoteexec

!="remoteExecCall [\"ExileServer_lottery_network_request\"," !="remoteExecCall ['ExileServer_lottery_network_request',"

remoteexec.txt

  • add the below to the end of line 7 ""

!"ExileServer_lottery_network_request"

Run Arma 3

Server

Once all steps are properly done (without errors) it is time to restart the server. Most important here is to include the @ScratchieServer mod into the startup parameter. See below example

arma3server.exe -autoInit "-profiles=xxx" "-config=xxx\server.cfg" -serverMod=@ScratchieServer;@ExileServer -mod=@Exile

Client

Make sure @Exile mod is enabled when running Arma 3

Advanced User / Developer

As this project uses the ArmaDev extension for Visual Studio Code (vscode). The instruction will strongly focus on the use of this extension.

Requirements

PLEASE NOTE: This guide is addressed to advanced users and developers

Configure Scratchie

You can configure several settings for the Scratchies mod in the configuration file source\scratchie_server\config.cpp. To name a few

  • Setup the Interval on how often player can win
  • Customize the Price how much a scratchie cost
  • Define what prizes a player can win through the PrizeType[] setting (vehicle, poptab or weapon)
  • and much more...

All changes made in this files requires to repack the scratchie_server.pbo and upload to the server. You can use the ArmaDev extension from vscode with the command Arma 3: Build to repack it.

Patch mission file

The below patched mission files are available in build\MissionFile and can be used as is to make Scratchie buttons available in XM8.

  • Exile.Altis
  • Exile.Malden
  • Exile.Namalsk
  • Exile.Tanoa

If you have a custom mission (which most of you have I guess), please continue reading

Edit description.ext

Add the below line at the bottom of CfgRemoteExec -> Functions (see animation)

class ExileServer_lottery_network_request { allowedTargets = 2; }

Mission description.ext

Edit config.cpp

Customize the buttons for XM8 by adding the below lines into the predefined XM8_AppXX_Button class. In this example button 06 - 08 are being used

/* play button */
textureNoShortcut = "scratchie\icons\scratchie.paa";
text = "Play Scratchie";
onButtonClick = "['use',ExileClientSessionId, player, ''] remoteExecCall ['ExileServer_lottery_network_request', 2];";
resource = "";
/* buy button */
textureNoShortcut = "scratchie\icons\scratchie-buy.paa";
text = "Buy Scratchie";
onButtonClick = "['buy',ExileClientSessionId, player, ''] remoteExecCall ['ExileServer_lottery_network_request', 2];";
resource = "";
/* get prize */
textureNoShortcut = "scratchie\icons\scratchie-prize.paa";
text = "Get Prize";
onButtonClick = "['get',ExileClientSessionId, player, ''] remoteExecCall ['ExileServer_lottery_network_request', 2];";
resource = "";

Mission config.cpp

Copy Button Images

Copy the source\MissionFile\Scratchie folder into the root of your mission file to make the button images available