Blockland Forums > Modification Help

1024 byte scripting contest

Pages: << < (19/24) > >>

DrenDran:

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);

--- End quote ---
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.

mctwist:


--- Quote from: Truce on January 20, 2011, 05:50:20 PM ---(If any of you actually do this outside of this contest / idea circle I will hunt you down.)

--- End quote ---
You have already done that to me, so you cannot do it twice. :cookieMonster:

Truce:

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.

DrenDran:

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......

Nexus:

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.

Pages: << < (19/24) > >>

Go to full version