A program request


I'm looking for someone who would create a very simple program (as far as I know. I don't know a thing about coding though) from this code:

$files = array_merge(glob("MAP-NAME-HERE"));;

// C = unsigned char--- B G R A
$new_top = pack("CCCC", 127, 146, 144, 0); // top
$new_bot = pack("CCCC", 0, 0, 0, 0); // bottom

echo "Found " . count($files) . " file(s) - processing...


$i = 1;

foreach($files as $file){
echo $i . ". " . $file . " ... ";
$contents = file_get_contents($file, FILE_BINARY);
// replace that
$mod = substr_replace($contents, $new_top, 4+1+38+1+24, 4);
$mod = substr_replace($mod, $new_bot, 4+1+38+1+24+4, 4);
// overwrite
file_put_contents($file, $mod);
echo " ... OK!


What does it do? It changes the background color of maps in a game called Soldat, 2D sidescrolling action game. You should try it, honestly.

What I am looking for is some kind of an user interface, a simple one. It should contain at least these thingies:

Map name: [---]
Top: [RR][GG][BB]
Bottom: [RR][GG][BB]

If it's somehow possible, I'd love to see an integrated colour picker, too. For both top and bottom colours. Also, it should work in either the directory the program is, or *homedirMaps. Since I have no clue how this all works, it's up to you to decide.

I would be very thankful if someone had the time and motivation to make the program. + I'm sorry if this is not the correct place to post this (which is probably exactly what it is)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!