Author Topic: 1024 byte scripting contest  (Read 18870 times)

Okay, I have my entry:
Quote
$e="À x(){Éa=0;%a<$n;%a++){%v=$a[%a];initÌBoxSearch(%v.position,\"5 5 5\",$TypeMasks::FxÈObjectType);while(%s=ÌSearchNext())if(!%s.i)%s.killÈ();}schedule(250,0,x);}x();À Ùc(%c){if(%cÒ){Éa=0;%a<$n;%a++)$a[%a].delete();$n=0;}}À Ùs(%c){if(%cÒ){Éa=0;%a<$w;%a++){%b=$p[%a];$a[$n]=new WheeledÁ(){datablock=BallÁ;};MissionCleanup.add($a[$n]);$a[$n].settransform(%b.position);$n++;}}}package t{À WheeledÁData::onCollision(%v,%o,%c){if(%c.getclassname()$=\"Player\")%c.kill();}À fxDTSÈ::onPlant(%b){%c=%b.getgroup().client;Parent::onPlant(%b);if(%b==$LastLoadedÈ)return;if(%c.g){$p[$w]=%b;$w++;%b.i=1;}if(%c.m)%b.i=1;}};activatepackage(t);À Ùe(%c){if(%cÒ)%c.g=!%c.g;}À Ùi(%c){if(%cÒ)%c.m=!%c.m;}";$v="À È Ì Ò Ù Á É function brick container .isAdmin servercmd vehicle for(%";for(%a=0;%a<7;%a++)$e=strreplace($e,getword($v,%a),getword($v,%a+7));eval($e);
845 bytes (might find more things to add to the compression to make it a few bytes smaller) and it is an extremely basic version of a gamemode I made for my server.
There are the following commands for admins:
/s    ---   Spawn 'eaters' at all spawns.
/c   ---    Clear all 'eaters'.
/i    ---    Toggle between adding invulnerable bricks and not.
/e   ---    Toggle between adding spawns and not adding spawns.
These 'eaters' are of course balls that kill any bricks that are not eater spawns or invulnerable, and they instantly kill players.
Of course there was a lot more to the original gamemode script but that was over 5kb.

Also the first spawn you add and the first ball you add will not be responsive to commands, you'll have to add two of each and delete the first one manually.
I know why that is, I'm just not sure if I should bother fixing it for the <1kb version.
Highlighted in green is what handles the decompression.
« Last Edit: January 21, 2011, 07:42:32 AM by DrenDran »

(If any of you actually do this outside of this contest / idea circle I will hunt you down.)
You have already done that to me, so you cannot do it twice. :cookieMonster:

Following through with what I said the other day, today (24ish hours from this post) will be the last day to submit.

The scripts are going to be judged in two categories: How good of an add-on the script would make (decided by 2 "average" Blocklanders), and how well the script itself demonstrates an original or impressive structure of logic (decided by 2 programmers outside of the contest).

Unless you specifically tell me you do not want your code posted, I plan to post all of them in the main post with their authors after the judging is over. I've decompressed all the ones that were compressed and added whitespace to make them far easier to read for anyone checking them out for learning purposes.

Since I have 181 bytes to spare, with the compression and all, I'm wondering if I should bother to add in one of the features I had to take out of the original mod to make it fit......

Is this compression actually a part of torque, or do you need a second script to decode it before the server is able to use it?  If a second script is needed, then the bytes from that would need to be added on.

Is this compression actually a part of torque, or do you need a second script to decode it before the server is able to use it?  If a second script is needed, then the bytes from that would need to be added on.

Mine decompresses itself; it's executed normally.

contest gonna be over soon

I replaced an if - else statement with a ?#:# statement. Mine is now 860 bytes.

The scripts are going to be judged in two categories: How good of an add-on the script would make (decided by 2 "average" Blocklanders), and how well the script itself demonstrates an original or impressive structure of logic (decided by 2 programmers outside of the contest).
hi me, i'd fit in both, and i'm even stuff and programming :D

Mine's not useful for normal players. :cookieMonster:


Heh, Bauklotz and Rynick didn't finish.
Welp, can't wait to see how people thought of mine.

Wait a minute. I sent in an another script, and he didn't accepted it. It was 1024 bytes.

Wait a minute. I sent in an another script, and he didn't accepted it. It was 1024 bytes.

Sorry - I thought you had sent me what Mr. Doom did. I only had enough time earlier to look at it briefly so I misread your description of it. The final guy I wanted to judge the logic of the code hasn't seen any yet so I can show him the latest one since you did PM it before the deadline, no worries.

Sorry - I thought you had sent me what Mr. Doom did. I only had enough time earlier to look at it briefly so I misread your description of it. The final guy I wanted to judge the logic of the code hasn't seen any yet so I can show him the latest one since you did PM it before the deadline, no worries.
Sorry for the bad description. I meant that I made the compressor that I then used to compress itself and then Mr. Doom made a compressor(in TorqueScript) that compressed my compressed file. Mr. Doom only provided with the secondary compressor which only the decompresser contains in my script.

Also, the script file size still isn't updated on the first post... :cookieMonster: