ARMA 3 Trading System

So this is another small part of my plan to make a more modular-style mod for ARMA.

GUI

So the first part of the system I wrote was the GUI for interacting with NPCs. I wanted something the players would be able to use easily. This is what I came up with:

Location

The next step was to write some function to find positions on the map for various situations. This was to be used for randomly positioned traders. After some testing I got some functions that worked well.
Trader Positions

Objects

Now I needed some trader camps making, for this I used M3Editor and grabbed the relative positions of each camp so placing them means just adding a single position/direction into scripts.

This is one of the larger trader “outposts” that are placed in fixed positions around the map:
Trader City
Inside Trader City

The Result (@ 12:20)

M3Editor – ARMA 3 Map Editor

With lack of a simple editor in ARMA 3 to add map content and needing to start creating new stuff in ARMA 3, I decided to make a 3D Editor to make it easier to aid in map content editing.

The editor supports saving/opening files directly from Windows, it will export map content in multiple formats including ARMA 3’s Terrain Editor.

Download here.

UPDATE

Here is some code to grab the relative positions for all objects placed.

M3E_fnc_getCenter = {
 private ['_objects', '_asl', '_ax', '_ay', '_az', '_xs', '_xc', '_xz', '_ys', '_yc', '_yz', '_zs', '_zc', '_zz'];
 _objects = [_this, 0, [], [[]]] call BIS_fnc_param;
 _asl = [_this, 1, false, [true]] call BIS_fnc_param;
 _ax = [];
 _ay = [];
 _az = [];
 {
 private ['_position'];
 _position = if (_asl) then {getPosASL _x} else {getPosATL _x};
 _ax pushBack (_position select 0);
 _ay pushBack (_position select 1);
 _az pushBack (_position select 2);
 } foreach _objects;
 _xs = 0;
 _xc = {_xs = _xs + _x; true} count _ax;
 _xz = _xs / _xc;
 
 _ys = 0;
 _yc = {_ys = _ys + _x; true} count _ay;
 _yz = _ys / _yc;
 
 _zs = 0;
 _zc = {_zs = _zs + _x; true} count _az;
 _zz = _zs / _zc;
 
 [_xz, _yz, _zz]
};
 
M3E_fnc_getRelPositions = {
 private ['_objects'];
 _objects = [_this, 0, [], [[]]] call BIS_fnc_param;
 _center = [_objects] call M3E_fnc_getCenter;
 _center set [2, 0];
 _arr = [];
 _str = '';
 {
 private ['_relpos'];
 _relpos = [getPos _x, _center] call M3E_fnc_subArr;
 _line = [typeOf _x, _relpos, getDir _x];
 _str = _str + (str _line) + (toString [10]);
 _arr pushBack _line;
 } foreach _objects;
 copyToClipboard _str;
_str
};
 
[M3E_insertedObjects] call M3E_fnc_getRelPositions;

A3 Launcher

After DayZ Launcher was released, a few months later ARMA 3 was gain to popularity, as mods were starting to be released. At this point I decided to port DayZ Launcher app and backend over to ARMA 3. A3 Launcher was publicly released a few days later.

A3 Launcher 3

The launcher uses the torrent protocol for primary downloads, the idea here was to reduce bandwidth costs and provide an easy method to verify file integrity.

As of Feb 2015, the average usage over the last 30 days is around 850,000 launcher opens and is gaining in popularity.

A PHP backend support both launchers, scanning servers, detecting mods and dealing with pushing that data to the luncher.

Both DayZ Launcher and A3 Launcher have been feature on the FRANKIEonPCin1080p.

DayZ Launcher

In July 2014, the maker of a well know launcher for the ARMA 2 mod, DayZ, failed to update his launcher in the wake of GameSpy (server listing service) shutting down and the ARMA developers moved to Steam for server listings.

It was at this point I decided to write a new launcher which used to new Steam system, 7 days later DayZ Launcher was released.

DayZ Launcher 2

The launcher uses the torrent protocol for primary downloads, the idea here was to reduce bandwidth costs and provide an easy method to verify file integrity.

As of Feb 2015, the average usage over the last 30 days is around 850,000 launcher opens and is gaining in popularity.

A PHP backend support both launchers, scanning servers, detecting mods and dealing with pushing that data to the luncher.

Both DayZ Launcher and A3 Launcher have been feature on the FRANKIEonPCin1080p.

Minesweeper

Old, yes. Classic, definitely.

After reading an article about someone who wrote a simple AI to solve Minesweeper and saw it used image recognition to work out the board, I decided to make a HTML/JS Minesweeper game. I have spent a few hours on it so far and I intend to finish it within the next week or so.Â

Once this is done, I’m intending to write an AI to solve it but through the code so its more efficient.

Here it is, just give it a click:

Its not finished and there is no reset (refresh the page)…

Send an SMS in FuelPHP with Twilio

FuelPHP is a great framework, being developed by some of the CodeIgniter contributes. In this article I will be running through the process of adding a package and setting it up to send SMS’s via Twilio.

Prerequisites

  • An instance of FuelPHP.
  • A copy of Fuel-Twilio from GitHub. You can also type php oil package install twilio in shell.

Twilio

First you will need an account with Twilio. Goto https://www.twilio.com/try-twilio?home-page and register, as you will be sending SMS, you will probably want to add some credit too.

Once you have registered, goto https://www.twilio.com/user/account and make a note of your account sid and auth token, these will need to go into the package config file.

To send an SMS, Twilio requires you to need a valid ‘from’ number. This can either be a ‘Twilio number or a verified number.

  • Twilio number – A number that Twilio provide, these cost $1 a month.
  • Verified number – A number you own that has bee verified be Twilio.

Follow the instructions on Twilio to set one up.

So at this stage you should have an account sid, auth token and a verified from number.

FuelPHP

The first thing you need to do is copy fuel/packages/twilio/config/twilio.php to fuel/app/config/ and open it up in your editor.

Enter your account_sid, auth_token and from items.

Once this is done, sending an SMS is really easy:

<?php
class Controller_Welcome extends Controller {
	public function action_index() {
		$twilio_response = $sms->create(array(
			'To' => '+441234567890',
			'From' => Config::get('twilio.from'),
			'Body' => 'A sms message',
			)
		);
		$json = json_encode($twilio_response);
		$response = Response::forge($json);
		$response->set_header('Content-Type', 'application/json');
		return $response;	
	}
}
?>

Next I will be showing you how to generate TwiML to talk to your customers using FuelPHP!

Email Campaign Manager

I created this piece of software so I could have more control over the sending process rather than leaving it up to some else (Eg. mailchimp)

It is very easy to use. When creating a new mailshot, the software will replace all links and image src with ones that point to the system.

Some Features

  • Track views
  • Track clicks
  • Auto-replace images to be downloaded from the software server
  • Online HTML editor and preview
  • View were users are viewing emails
  • View platforms and clients

More information to come!

WP Simple Galleries

A simple plugin that adds an image gallery to each post and page. Most gallery plugins seem to be fancy and advanced but sometimes you just want a simple solution to add images to a post or page. I created this to solve that problem. The plugin uses the WordPress image manager, so you can add already uploaded images too a gallery.

You can now upload a number of images and add them all at once.

If you change the size of the thumbnails after uploading images to a gallery, I suggest using Regenerate Thumbnails to regenerate the correct size thumbnails.

Requires WordPress 3.0 and PHP 5.

Download