Difference between revisions of "Code hacks"

From Armagetron
(→‎External Scripts and Programs: Update wrtlprnft's website links to .net, update forums url)
(38 intermediate revisions by 15 users not shown)
Line 1: Line 1:
From time to time people do various hacks to the code or write various scripts and programs to support the game.  We'll try to collect them here so you can use them too.  If you have a hack you'd like to add, just add it here. For it to format correctly, put <nowiki>  
+
From time to time people do various hacks to the code or write various scripts and programs to support the game.  We'll try to collect them here so you can use them too.  If you have a hack you'd like to add, just add it here. For it to format correctly, put  
"<code> <pre>  
+
 
 +
<nowiki>  
 +
<pre>  
 
Copy paste your script here, in the space inbetween the code and pre commands.
 
Copy paste your script here, in the space inbetween the code and pre commands.
</pre> </code>" </nowiki>
+
</pre>  
 +
</code>  
 +
</nowiki>
 +
 
 +
Alternatively just copy and paste the script as it is, but add a space in front of every line.
 +
 
 +
Note: there is no <nowiki><code></nowiki> in front of the script.
 +
 
 +
== Modifications to Armagetron Advanced ==
 +
 
 +
These usually require actually applying a patch to Armagetron Advanced source and recompiling.  Not for the faint of heart!
 +
 
 +
=== Applying a Code Patch ===
 +
 
 +
So, how exactly do you apply a code patch? First, you must cd into your directory containing the source code. Next, assuming you have a unix-based server, you must use the patch utility to hack the code. The patch utility is simple to use-- here is its syntax:
 +
 
 +
<code><pre>patch -p0 < code_hack.patch</pre></code>
 +
 
 +
now compile as you normally would.
 +
 
 +
=== Styball, CTF and Shooting Patch ===
 +
 
 +
groundpig's famous ball games, shooting, CTF, HTF, and many other games types work. See [[Sty]] for instructions.
 +
 
 +
 
 +
== External Scripts and Programs ==
 +
 
 +
These are programs and scripts people have written that modify the game without requiring compiling the game.
 +
 
 +
=== Generators ===
 +
 
 +
These are scripts used to generate maps.
 +
 
 +
==== Labyrinth Script ====
 +
 
 +
This is the script that generates mazes.  It requires python and almost certainly requires a Linux installation.  It's never been tested in windows.  It's also available in [http://svn.sourceforge.net/viewvc/armagetronad/private/Lucifer/aamaprotator/scripts/mazer.py?view=markup Lucifer's private area of the SVN repository].  Patches should be made against that and sent to Lucifer.
 +
 
 +
[[:Image:mazer.zip|Download this script]]
 +
 
 +
==== Racer Script ====
 +
 
 +
This script generates racer maps with walls and deathzones and obstacles. You can configure the look of the obstacles and the average amount of obstacles to be put onto the map. It requires PHP and probably runs best on linux, though it doesn't use any system- specific calls, it just prints to stdout.
 +
 
 +
The script is quite hacky and lacking any proper documentation, but not very complex, so it shouldn't be hard to hack it some more. [[:Image:Racer-php.gz|Download the script]]
 +
 
 +
=== Map Rotation ===
 +
 
 +
A basic map rotator / rotation script by kyle can be found on the forums [http://forums3.armagetronad.net/viewtopic.php?p=236054#p236054 here] The post also links to a detailed explanation on how to run the script on the Crazy-Tronners wiki.
 +
 
 +
==== Lucifer's Map Rotator ====
 +
 
 +
This is the rotator that used to power Swamplords on Crack before it was taken down.  It includes the mazer.py script listed in Generators on this page.  Probably requires Linux, it's not known to work in Windows.
 +
 
 +
[[:Image:aamaprotator.zip|Download the file]]
 +
 
 +
==== Lover$Boy's Map Rotator ====
 +
 
 +
This is the program that LOVER$BOY has created after seeing many map rotation written in PHP and are meant to be used in a Linux program (mainly used in a Terminal).
 +
 
 +
This program is meant to be used in Windows OS. The program is located in the website that LOVER$BOY uses to host his maps for the servers that he will host later.
 +
 
 +
The website is: [http://lightningbrothers.webs.com Lightning $ Brothers]
 +
 
 +
If you get confused with the initials of the website (or old clan tag):
 +
 
 +
Lover$boy 's initials are also: L$B
 +
 
 +
=== Server monitors ===
 +
 
 +
==== [[ArmaBell]] ====
 +
 
 +
A server monitor written by iF with tons of features for windows. Unfortunately the source code isn't available and it has been discontinued, and it doesn't even work anymore without some quirks.
 +
 
 +
==== [http://wejp.k.vu/projects/armaspy/ ArmaSpy] ====
 +
 
 +
A GTK server monitor written by weip in C. It runs on Linux and most likely other *nix–like operating systems too.
 +
 
 +
==== ArmaSpy Advanced ====
 +
 
 +
A server monitor written in python using PyKDE with some more features than ArmaSpy. It lets you directly join a server by clicking on a player in it, hilights servers in your server favorites and features a buddy list.
 +
 
 +
=== Ranking Scripts ===
 +
 
 +
==== [http://jonklo.net/downloads/ Armastats] ====
 +
 
 +
A simple script to display the ranks of players based on matches won.
 +
 
 +
Direct Download: [http://www.filedropper.com/armastats Armastats]
 +
 
 +
(Sorry for the downtime, changed hosts and forgot about the script.)
  
== TiTnAsS pro version of "Take" ==
+
===== Links =====
  
<code> <pre>
+
* [http://wrtlprnft.net/armaspyadvanced2.png Screenshot of the menu]
numMatches = 15
+
* [http://wrtlprnft.net/armaspyadvanced3.png Screenshot of the buddy screen]
player1 = raw_input("Player 1's name: ")
+
* [http://svn.sourceforge.net/viewvc/armagetronad/private/wrtlprnft/armaspyadvanced/armaspyadvanced.py?view=markup View Source]
player2 = raw_input("Player 2's name: ")
+
* [http://svn.sourceforge.net/viewvc/*checkout*/armagetronad/private/wrtlprnft/armaspyadvanced/armaspyadvanced.py Download]
players = (player1,player2)
+
* [http://forums3.armagetronad.net/viewtopic.php?t=7791 Original topic]
currentPlayer = 0
 
print "The rules to this game are simple."
 
print "You can't take more then 3 matches."
 
print "The person to take the last match is the loser."
 
print "Good luck! :)"
 
while numMatches > 0:
 
    print " "
 
    print "It's",players[currentPlayer] + "'s","turn."
 
    print "There are",numMatches,"matches left."
 
    inputValid = False
 
    while inputValid is not True:
 
        numTaken = str(raw_input("How many matches do you want to take? ") )
 
        if numTaken.isdigit():
 
            numTaken = int(numTaken)
 
            if numTaken > 3 or numTaken <= 0:
 
                print "You must pick 1-3 matches. You picked " + str(numTaken)
 
            else:
 
                inputValid = True
 
        else:
 
            print "You must enter a number from 1 to 3."
 
    numMatches = numMatches - numTaken
 
    currentPlayer = 1 - currentPlayer
 
print players[currentPlayer],"is the winner!"
 
</pre> </code>
 

Revision as of 17:22, 18 April 2019

From time to time people do various hacks to the code or write various scripts and programs to support the game. We'll try to collect them here so you can use them too. If you have a hack you'd like to add, just add it here. For it to format correctly, put

<pre> Copy paste your script here, in the space inbetween the code and pre commands. </pre> </code>

Alternatively just copy and paste the script as it is, but add a space in front of every line.

Note: there is no <code> in front of the script.

Modifications to Armagetron Advanced

These usually require actually applying a patch to Armagetron Advanced source and recompiling. Not for the faint of heart!

Applying a Code Patch

So, how exactly do you apply a code patch? First, you must cd into your directory containing the source code. Next, assuming you have a unix-based server, you must use the patch utility to hack the code. The patch utility is simple to use-- here is its syntax:

patch -p0 < code_hack.patch

now compile as you normally would.

Styball, CTF and Shooting Patch

groundpig's famous ball games, shooting, CTF, HTF, and many other games types work. See Sty for instructions.


External Scripts and Programs

These are programs and scripts people have written that modify the game without requiring compiling the game.

Generators

These are scripts used to generate maps.

Labyrinth Script

This is the script that generates mazes. It requires python and almost certainly requires a Linux installation. It's never been tested in windows. It's also available in Lucifer's private area of the SVN repository. Patches should be made against that and sent to Lucifer.

Download this script

Racer Script

This script generates racer maps with walls and deathzones and obstacles. You can configure the look of the obstacles and the average amount of obstacles to be put onto the map. It requires PHP and probably runs best on linux, though it doesn't use any system- specific calls, it just prints to stdout.

The script is quite hacky and lacking any proper documentation, but not very complex, so it shouldn't be hard to hack it some more. Download the script

Map Rotation

A basic map rotator / rotation script by kyle can be found on the forums here The post also links to a detailed explanation on how to run the script on the Crazy-Tronners wiki.

Lucifer's Map Rotator

This is the rotator that used to power Swamplords on Crack before it was taken down. It includes the mazer.py script listed in Generators on this page. Probably requires Linux, it's not known to work in Windows.

Download the file

Lover$Boy's Map Rotator

This is the program that LOVER$BOY has created after seeing many map rotation written in PHP and are meant to be used in a Linux program (mainly used in a Terminal).

This program is meant to be used in Windows OS. The program is located in the website that LOVER$BOY uses to host his maps for the servers that he will host later.

The website is: Lightning $ Brothers

If you get confused with the initials of the website (or old clan tag):

Lover$boy 's initials are also: L$B

Server monitors

ArmaBell

A server monitor written by iF with tons of features for windows. Unfortunately the source code isn't available and it has been discontinued, and it doesn't even work anymore without some quirks.

ArmaSpy

A GTK server monitor written by weip in C. It runs on Linux and most likely other *nix–like operating systems too.

ArmaSpy Advanced

A server monitor written in python using PyKDE with some more features than ArmaSpy. It lets you directly join a server by clicking on a player in it, hilights servers in your server favorites and features a buddy list.

Ranking Scripts

Armastats

A simple script to display the ranks of players based on matches won.

Direct Download: Armastats

(Sorry for the downtime, changed hosts and forgot about the script.)

Links