DAZZLE'S UPGRADE PACK

If you haven't already done so, upgrade your game by downloading Dazzle's all-in-one upgrade pack. It comes with everything you need for today's servers. Does your blue bar freeze when joining servers? Do you lag in games? Do you get an annoying siren in Phobik's Servers? This is what you need. CLICK HERE TO DOWNLOAD.

ACAS: Missing Restart

Modding questions, answers, help.....

Moderators: Warfare, Admin, Moderator

Triv
Veteran Member
Veteran Member
Posts: 159
Joined: Mon Jan 22, 2007 6:32 pm
Contact:

ACAS: Missing Restart

Post by Triv »

Hi, there doesn't seem to be restart command in ACAS codes. I would like to add such on it myself. I was wondering if anyone would have all the necessary code parts available. Even better would be if someone could tell how to add the new restart command in the GUI menu.

Also how to unban someone in ACAS. Is it missing also?

Also does someone know why the hotkeys I have at the moment don't work with ACAS codes? Is there another hotkeys written other way that works with them and dash codes?

Thanks. The most important part is the Restart which I would really want to add.
THE V
Need Major Repair
Need Major Repair
Posts: 815
Joined: Fri Dec 29, 2006 4:03 pm
Location: Richland, WA
Contact:

Re: ACAS: Missing Restart

Post by THE V »

unban command is not in ACAS as far as I know you need to delete the name and IP from ACAS\Logs and Lists\banlist.cs.

The restart command is also missing. However I believe that if you ask really nicely Artcrazy might be able to add it for you. If you know more programming than me you could also copy the command from Dash's script (with permission of course).
User avatar
LGM
Site Admin
Site Admin
Posts: 2100
Joined: Fri Dec 29, 2006 12:59 pm
Location: Very Northwest WA
Contact:

Re: ACAS: Missing Restart

Post by LGM »

you can use the mission command to start a mission... "/mis filename.mis" (use dash's myself)

I believe it will start a new mission right away, but the .mis has to be in game/data/missions

Look in MiscCodes.cs in ACAS's codes folder
User avatar
TMG Leader
Veteran Light
Veteran Light
Posts: 962
Joined: Mon Jun 25, 2007 10:31 am
Location: In my refrigerator....

Re: ACAS: Missing Restart

Post by TMG Leader »

Restart code? The 30 sec countdown one right? Seems that all the download links are broken to dash codes so yeah...but I'll tell you how to add the code into ACAS. If you don't have the restart code, maybe someone could kindly post it here.
So open Note Pad or Text Edit for a blank file.

Code: Select all

$ACAS::CodesFolder::Function[0] = "restart"; //this is the function name that ACAS's GUI hook reads so when you select it or type it, it knows what it's doing. So it MUST match. 
$ACAS::CodesFolder::Shortcut[0] = "/restart"; //the code for typing it in the chat box
$ACAS::CodesFolder::Description[0] = "RestartFromDashCodes"; //the name for the code that will appear in the prefs GUI and in the in-game GUI.
$ACAS::CodesFolder::GuiArgs[0] = "Server"; // it's a server side function (correct me if I'm wrong; I'm a bit fuzzy).
//Paste the restart code under this line
//-----



Save it under any name with the extension of .cs in the Codes folder in ACAS. No need to type the "exec," ACAS has a neat function that auto execs any file in the Codes folder with the file extension of .cs. There you go! Just make sure you enable it in the preferences of ACAS and it should work.

By the way, this is all on Art Crazy's ACAS website if you want more info (http://www.rppinheiro.com/ACAS/index.php?page=6). As far as the key binds go, just make sure none of them are the same as the others, otherwise, you might want to ask someone a bit stronger in scripting. Oh and if any of you want dash to ACAS conversions just let me know, I'll be happy to do it for you.
First to fall, last man standing.
ArtCrazy
Veteran Member
Veteran Member
Posts: 290
Joined: Fri Dec 29, 2006 10:14 am

Re: ACAS: Missing Restart

Post by ArtCrazy »

/unban was not added to the script, it was included in the ACAS_CTF version - it was a major request from Dazzle, including an in-game list-ban/unban GUI that lists all banned players and lets you unban them, which ended up working amazingly well, surprising even me :P - and I had planned to port it over, but never did have the time/the patience. I don't exactly remember the code so I'll check if a small update that includes this feature is feasible at this time... I just know I ended up changing a lot of the code for ACAS_CTF and a port of everything back to a real ACAS would take a lot of work now - it'd be worth it tough, ACAS_CTF has so many new features compared to the original ACASv3...

EDIT: Meanwhile you can use the following code since I doubt Dazzle will mind if I release this - it is a slightly modified listban/unban code from ACAS_CTF, so it might not work... But it should, just create a new file inside the Codes folder named anything with the ".cs" extension, for example "ListBan And Unban.cs", and copy paste this into that folder.
Unban does not support the Unban GUI tough, I have however modified it so that it does show up in the GUI codes list.

Code: Select all

//----------------------------\\
//----------LIST BAN----------\\
//----------------------------\\
$ACAS::CodesFolder::Function[0] = "listban";
$ACAS::CodesFolder::Shortcut[0] = "/listban";
$ACAS::CodesFolder::Description[0] = "List banned players";
$ACAS::CodesFolder::GuiArgs[0] = "";

function listban(%sender)
{
    %banlist = new FileObject();
    if(%banlist.openForRead(expandFileName("./../Logs and Lists/BanList.cs")))
    {
        %t = 1000;
        while(%banlist.isEOF() != 1)
        {
            %listing = %banlist.readLine();
            schedule(%t,false,"CommandToClient", %sender,'CenterPrint', %listing,4,3);
            %t = %t + 3000;
        }
    }
    %banlist.close();
}

//----------------------------\\
//------------UNBAN-----------\\
//----------------------------\\
$ACAS::CodesFolder::Function[1] = "unban";
$ACAS::CodesFolder::Shortcut[1] = "/unban";
$ACAS::CodesFolder::Description[1] = "Unban Player";
$ACAS::CodesFolder::GuiArgs[1] = "EnterTermSpace:Enter the Name of the player that should be unbanned.";;

function unban(%sender,%target_nm)
{
  //For some reason it doesnt work unless I openForAppend it first...
  %banlist = new FileObject();
  %banlist.openForAppend(expandFileName("./../Logs and Lists/BanList.cs"));
  %banlist.close();

  %i = 0;
  %banlist = new FileObject();
  if(%banlist.openForRead(expandFileName("./../Logs and Lists/BanList.cs")))
  {
    while(%banlist.isEOF() != 1)
    {
      %listing = %banlist.readLine();
      if(getSubStr(%listing, 0, strstr(%listing,":")) !$= %target_nm) {
        %newlisting[%i] = %listing;
        %i++;
      }
    }
  }
  else {
    centerprint(%sender, "Error while unbanning", 3,3);
    return;
  }
  %banlist.close();
  
  %i2 = 0;
  %banlist = new FileObject();
  if(%banlist.openForWrite(expandFileName("./../Logs and Lists/BanList.cs")))
  {
    while(%i2 <= %i)
    {
      if(trim(%newlisting[%i2]) !$= "") {
        %banlist.writeline(%newlisting[%i2]);
      }
      %i2++;
    }
  }
  else {
    centerprint(%sender, "Error while unbanning", 3,3);
    return;
  }
  %banlist.close();
  
  centerprint(%sender, "Unbanned successfuly", 3,3);
}
As for the /restart command, I could've sworn I had that in since ACASv1, but it doesn't seem so... I guess I used /mis instead. It wouldn't be hard to add tough, but since I'm quite foggy on TSL right now, I'd need to grab a copy of dash's script (which for some reason isn't in my scripts folder).

TMG Leader was mostly correct, like it says on http://www.rppinheiro.com/ACAS/index.php?page=6 making a new code is easy.

You just need to create a new file inside the Codes folder, and add these lines:

Code: Select all

$ACAS::CodesFolder::Function[0] = "FUNCTIONNAME";
$ACAS::CodesFolder::Shortcut[0] = "/res";
$ACAS::CodesFolder::Description[0] = "Restarts the Mission";
$ACAS::CodesFolder::GuiArgs[0] = "";
TMG Leader was wrong in the GuiArgs part, this is used to know what windows to show when you use the GUI to use this command, like asking you to enter a number or a message. In this case we want nothing, so we leave it blank.
FUNCTIONNAME depends on what the function for the code is called... I don't have any function for a restart here tough, and don't remember how one did it... I'll check if I find anything about this.

EDIT: Nope, all dash's AS links are dead, and I have no trace anywhere of a simple "restart" command in any of the scripts I have lying around, sorry.
User avatar
LGM
Site Admin
Site Admin
Posts: 2100
Joined: Fri Dec 29, 2006 12:59 pm
Location: Very Northwest WA
Contact:

Re: ACAS: Missing Restart

Post by LGM »

if you look in the little archive in my sig, there's a link to some files. dash codes are in there, but no directions for it
ArtCrazy
Veteran Member
Veteran Member
Posts: 290
Joined: Fri Dec 29, 2006 10:14 am

Re: ACAS: Missing Restart

Post by ArtCrazy »

LGM wrote:if you look in the little archive in my sig, there's a link to some files. dash codes are in there, but no directions for it
Awesome, thanks.

So I grabbed dash's restart code, just place this inside an empty .cs file in the Codes folder:

Code: Select all

// -------------------------------------
// Restart the game - Code taken from dash's AS 0.7 and modified by Art Crazy for ACAS

$ACAS::CodesFolder::Function[0] = "restartGame";
$ACAS::CodesFolder::Shortcut[0] = "/restart";
$ACAS::CodesFolder::Description[0] = "Restarts the Mission";
$ACAS::CodesFolder::GuiArgs[0] = "";

function restartGame(%sender)
{
    centerprintall("Manual Restart Initiated",4 );
    if (isEventPending($Game::Schedule))
       cancel($Game::Schedule);
    onGameDurationAlmostEnd();
}
User avatar
Dazzle
Evil Site Admin
Evil Site Admin
Posts: 1320
Joined: Fri Dec 29, 2006 6:59 am
Location: London, England
Contact:

Re: ACAS: Missing Restart

Post by Dazzle »

ACAS_CTF list ban GUI :thumbup: :thumbup: :thumbup: :thumbup:
ArtCrazy
Veteran Member
Veteran Member
Posts: 290
Joined: Fri Dec 29, 2006 10:14 am

Re: ACAS: Missing Restart

Post by ArtCrazy »

Dazzle wrote:ACAS_CTF list ban GUI :thumbup: :thumbup: :thumbup: :thumbup:
:)
Was checking out what stuff I still had lying around. Got the chat logs of all our CTF script tests we did on my server, by we I mean me, you, Phobik and Lonewolf... Oh the memories :P

Also got some crazy scripts lying around like activating the red team so that all 3 teams have their scores listed, or even one script that I tried doing (no idea if it works) that made all tanks have their respective player's name in red instead of the team's color...
Also have a small piece of code that makes the server send out information that it's running on Linux even when it's not, crazy stuff, I really did play around with TT a LOT, considering I haven't literally played the game for years. Considering I didn't have the source, even I am surprised I was able to do so much. I mean, I just looked at the IPJoiner code that hooks into the server list gui, and hell, that's complicated, even for me. Or the CustomizableChat script, I don't even understand most of it now :P
THE V
Need Major Repair
Need Major Repair
Posts: 815
Joined: Fri Dec 29, 2006 4:03 pm
Location: Richland, WA
Contact:

Re: ACAS: Missing Restart

Post by THE V »

I don't even understand most of it now
I don't know how many times I've heard this from a programmer friend of mine at work. Sheesh he only wrote the code 5 years ago and I use it everyday.

Great coding comes back to haunt you Art :-)
Image
Post Reply