BnS AoS League Discussion

The original, free Ace of Spades game powered by the Voxlap engine. Known as “Classic,” 0.75, 0.76, and all 0.x versions. Created by Ben Aksoy.
195 posts Page 7 of 13 First unread post
RyanK
Deuced Up
Posts: 322
Joined: Sat Mar 02, 2013 11:02 pm


Ok, I guess classicgen is good. And thanks for putting down my name STRIKE081, cause I'll really try to be there, if the time is right.
danhezee
Former Admin / Co-founder
Former Admin / Co-founder
Posts: 1710
Joined: Wed Oct 03, 2012 12:09 am


Ok tested match.py. It is nice but if we can get a few more features in quickly I wouldnt mind the following:

If the timer isnt running, aka the match hasnt started, no one can kill or build or break.

Once the timer starts player are warped to there command post and they are now free to kill and destroy.

When the timer stops they return to no killing and what not.
Code: Select all
"""
Match script, useful for public matches. Features verbose announcements
on IRC and a custom timer.

Maintainer: mat^2
"""

from twisted.internet import reactor
from twisted.internet.task import LoopingCall

import json
import commands

@commands.admin
@commands.name('timer')
def start_timer(connection, end):
    return connection.protocol.start_timer(int(end) * 60)

@commands.admin
@commands.name('stoptimer')
def stop_timer(connection, end):
    return connection.protocol.stop_timer()

@commands.admin
@commands.name('startrecord')
def start_record(connection):
    connection.protocol.start_record()
    return 'Recording started.'

@commands.admin
@commands.name('stoprecord')
def stop_record(connection):
    connection.protocol.stop_record()
    return 'Recording stopped.'

@commands.admin
@commands.name('saverecord')
def save_record(connection, value):
    if not connection.protocol.save_record(value):
        return 'No record file available.'
    return 'Record saved.'

commands.add(start_timer)
commands.add(stop_timer)
commands.add(start_record)
commands.add(stop_record)
commands.add(save_record)

def apply_script(protocol, connection, config):
    class MatchConnection(connection):
        def on_flag_take(self):
            self.add_message("%s took %s's flag!" %
                (self.printable_name, self.team.other.name.lower()))
            return connection.on_flag_take(self)
        
        def on_flag_drop(self):
            self.add_message("%s dropped %s's flag!" %
                (self.printable_name, self.team.other.name.lower()))
            return connection.on_flag_drop(self)
                
        def on_flag_capture(self):
            self.add_message("%s captured %s's flag!" %
                (self.printable_name, self.team.other.name.lower()))
            return connection.on_flag_capture(self)
        
        def on_kill(self, killer, type, grenade):
            if killer is None:
                killer = self
            self.add_message("%s was killed by %s!" %
                (self.printable_name, killer.printable_name))
            self.protocol.add_kill(self, killer)
            return connection.on_kill(self, killer, type, grenade)
        
        def add_message(self, value):
            self.protocol.messages.append(value)
    
    class MatchProtocol(protocol):
        timer_left = None
        timer_call = None
        timer_end = None
        record = None
        def __init__(self, *arg, **kw):
            protocol.__init__(self, *arg, **kw)
            self.messages = []
            self.send_message_loop = LoopingCall(self.display_messages)
            self.send_message_loop.start(3)
            
        def start_timer(self, end):
            if self.timer_end is not None:
                return 'Timer is running already.'
            self.timer_end = reactor.seconds() + end
            self.send_chat('Timer started, ending in %s minutes' % (end / 60),
                irc = True)
            self.display_timer(True)
        
        def stop_timer(self):
            if self.timer_call is not None:
                self.timer_call.cancel()
                self.send_chat('Timer stopped.')
                self.timer_call = None
            else:
                return 'No timer in progress.'
        
        def display_timer(self, silent = False):
            time_left = self.timer_end - reactor.seconds()
            minutes_left = time_left / 60.0
            next_call = 60
            if not silent:
                if time_left <= 0:
                    self.send_chat('Timer ended!', irc = True)
                    self.timer_end = None
                    return
                elif minutes_left <= 1:
                    self.send_chat('%s seconds left' % int(time_left), 
                        irc = True)
                    next_call = max(1, int(time_left / 2.0))
                else:
                    self.send_chat('%s minutes left' % int(minutes_left), 
                        irc = True)
            self.timer_call = reactor.callLater(next_call, self.display_timer)
        
        def display_messages(self):
            if not self.messages:
                return
            message = self.messages.pop(0)
            self.irc_say(message)
        
        # recording
        
        def add_kill(self, player, killing_player):
            if self.record is None:
                return
            self.get_record(player.name)['deaths'] += 1
            self.get_record(killing_player.name)['kills'] += 1
        
        def get_record(self, name):
            try:
                return self.record[name]
            except KeyError:
                record = {'deaths' : 0, 'kills' : 0}
                self.record[name] = record
                return record
        
        def start_record(self):
            self.record = {}
        
        def stop_record(self):
            self.record = None
        
        def save_record(self, value):
            if self.record is None:
                return False
            json.dump(self.record, open(value, 'wb'))
            return True
        
    return MatchProtocol, MatchConnection
Also, do you guys know of any symmetrical maps. Izzy recommended forks and pinnacle2.

forks
Image

pinnacle2
Image
CraftDinur
Deuced Up
Posts: 152
Joined: Thu Nov 08, 2012 8:20 pm


every time i hear the words "symmetrical maps" i always hear of Influx's guide to map design and how that's a major no-no.

island and isle of war are big favourites for me even though they're not exactly symmetrical. pinpoint is especially a PABH favourite even though a lot of people hate it. any sort of tGM island map is fun to play on imo and they work with pretty much any number of players.
TB_
Post Demon
Post Demon
Posts: 998
Joined: Tue Nov 20, 2012 6:59 pm


Please no pinpoint. This is an official tournament. And we should have proper maps.
Forks looks really good, not so sure about pinnacle2 though, I feel like the middle section is a bit too narrow.
rakiru
Coder
Coder
Posts: 1349
Joined: Sun Nov 11, 2012 12:26 pm


CraftDinur wrote:
every time i hear the words "symmetrical maps" i always hear of Influx's guide to map design and how that's a major no-no.
It's important that everything is done to make it as fair as possible for this, so symmetrical maps should be used.
TB_ wrote:
Please no pinpoint. This is an official tournament. And we should have proper maps.
Forks looks really good, not so sure about pinnacle2 though, I feel like the middle section is a bit too narrow.
I agree with this.
RyanK
Deuced Up
Posts: 322
Joined: Sat Mar 02, 2013 11:02 pm


And I agree with rakiru. Both maps could work, but for my opinion, I would rather choose Forks.
danhezee
Former Admin / Co-founder
Former Admin / Co-founder
Posts: 1710
Joined: Wed Oct 03, 2012 12:09 am


RyanK wrote:
And I agree with rakiru. Both maps could work, but for my opinion, I would rather choose Forks.
That is why I like influx's idea of a "home" and "away" game. We will have a handful of maps to choose from and your team will get to choose the map if you are playing your "home" game.
RyanK
Deuced Up
Posts: 322
Joined: Sat Mar 02, 2013 11:02 pm


danhezee wrote:
RyanK wrote:
And I agree with rakiru. Both maps could work, but for my opinion, I would rather choose Forks.
That is why I like influx's idea of a "home" and "away" game. We will have a handful of maps to choose from and your team will get to choose the map if you are playing your "home" game.
Ok, that's cool.
TheGrandmaster
Former Pre-BnS Team
Former Pre-BnS Team
Posts: 124
Joined: Tue Oct 23, 2012 2:54 pm


Unsymmetrical != not fair.
Isle of War isn't symmetrical, but asides from greens blending in better, it's fair. Just need to set one team to a reddish colour and it's all fine.
Each side has advantageous cover on certain and opposite sides of the map so it balances out. It's that, along with its size, that has made it a very played map for matches.
RyanK
Deuced Up
Posts: 322
Joined: Sat Mar 02, 2013 11:02 pm


TheGrandmaster wrote:
Just need to set one team to a reddish colour and it's all fine.
No, I think we should blue vs. green, since those are the original colors AoS has used. ...i don't know, but I just think we should have blue vs. green. It is my opinion at least.
Handles
League Participant
League Participant
Posts: 1087
Joined: Tue Jan 08, 2013 9:46 pm


As being green would be an advantage on some maps, the home team should be able to choose their team colours.
RyanK
Deuced Up
Posts: 322
Joined: Sat Mar 02, 2013 11:02 pm


Yea, that is a good idea. Then both sides could both be a color one time, if that's what they decide. On maps where green has the advantages, the "home" could choose green(which they probably would), and leave the "away" to be blue.
danhezee
Former Admin / Co-founder
Former Admin / Co-founder
Posts: 1710
Joined: Wed Oct 03, 2012 12:09 am


alright tested the new match.py

The only thing we have to do is restrict picking up the intel until the timer starts.
TheGrandmaster
Former Pre-BnS Team
Former Pre-BnS Team
Posts: 124
Joined: Tue Oct 23, 2012 2:54 pm


danhezee wrote:
alright tested the new match.py

The only thing we have to do is restrict picking up the intel until the timer starts.
Easiest way to do that is just kill anyone who picks up the intel. There's a hook for when a player picks up the intel so you could just kill them straight away if the match hasn't begun.
There is also some kind of 'game pausing' script that I've heard of, which freezes players in their positions which might be good to implement into the match script.
tin
Global Moderator
Global Moderator
Posts: 654
Joined: Tue Oct 23, 2012 5:12 pm


You can just do /resetgame when you want to start the match.
195 posts Page 7 of 13 First unread post
Return to “Ace of Spades 0.x Discussion”

Who is online

Users browsing this forum: No registered users and 38 guests