Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: Tehbugerz0r on December 02, 2011, 12:26:43 pm

Title: Goofy Random Mode
Post by: Tehbugerz0r on December 02, 2011, 12:26:43 pm
I'm don't know if anyone else has made something like this, but it can't be the same.

Script Name: Goofy Random Mode
Script Description: Makes Soldat stupid and completely random, in a fun kind of way. Random damage, score, weapons, explosions and more.
It has a few small problems but I can work on those if they're really annoying you.
There's even a few handy functions in here.
Recommended mode: Death Match.
Original Author: Tehbugerz0r
Core Version: 2.7.2

Code: [Select]
procedure SomethingRandom(rando:byte);
var rando1:byte;
begin
rando1:=Random(1,RandomID);
     if rando = 0 then begin
        CreateBullet(GetPlayerStat(rando1,'x'), GetPlayerStat(rando1,'y'), GetPlayerStat(rando,'velx'), GetPlayerStat(rando,'vely'),100, 12, rando1);
        DoDamageBy(rando1,rando1,4000);
        CreateBullet(GetPlayerStat(rando1,'x')+Random(-30,30), GetPlayerStat(rando1,'y')+Random(-50,0), Random(-300,300), Random(-300,100),100, 12, rando1);
        CreateBullet(GetPlayerStat(rando1,'x')+Random(-30,30), GetPlayerStat(rando1,'y')+Random(-50,0), Random(-300,300), Random(-300,100),100, 12, rando1);
        CreateBullet(GetPlayerStat(rando1,'x')+Random(-30,30), GetPlayerStat(rando1,'y')+Random(-50,0), Random(-300,300), Random(-300,100),100, 9, rando1);
        CreateBullet(GetPlayerStat(rando1,'x')+Random(-30,30), GetPlayerStat(rando1,'y')+Random(-50,0), Random(-300,300), Random(-300,100),100, 9, rando1);
     end;
     if rando = 1 then Givebonus(rando1,Random(1,5));
     if rando = 2 then DoDamageBy(rando1,rando1,Random(70,200));
     if rando = 3 then Command('/setteam'+IntToStr(Random(0,5))+' '+IntToStr(rando1));
     if rando = 4 then WriteConsole(0,'HAI!'+chr(13)+chr(10)+'Time to ruin your chat console!'+chr(13)+chr(10)+'Time to ruin your chat console!'+chr(13)+chr(10)+'Time to ruin your chat console!'+chr(13)+chr(10)+'Time to ruin your chat console!'+chr(13)+chr(10)+'KTHXBAI',RandomColor);
end;

Title: Re: Goofy Random Mode
Post by: tk on December 02, 2011, 03:53:18 pm
I can see a bug even in the code snippet:
rando1:=Random(1,NumPlayers+Numbots);
may return IDs which are inactive
Title: Re: Goofy Random Mode
Post by: Tehbugerz0r on December 02, 2011, 10:43:38 pm
I can see a bug even in the code snippet:
rando1:=Random(1,NumPlayers+Numbots);
may return IDs which are inactive
Yeah I knew about that, I just didn't get around to figuring it out so that part only works effectively with no one leaving. It's really the type of script you'll just wanna try out once maybe twice with friends anyway. I might fix this today.

Edit: I just made the second version, it has many improvements and fixed most problems.