Server Help

ASSS Custom Projects - Python Module

Anonymous - Tue Jan 20, 2009 3:23 pm
Post subject: Python Module
I want to create a simple python module that just displays an image when either freq 0 or freq 1 wins the flag game and play a sound.

Could someone assist me in where to start with the code. I looked on thw wiki, but can't find what I need.
Dr Brain - Tue Jan 20, 2009 6:50 pm
Post subject:
Start with a python module that prints a message when either freq 0 or freq 1 wins the flag game.

Then move on to attaching sounds (aka bongs) to an empty arena message.

From there, take a look at the objects module (see object.h) to see how to display images. See how ?objon works (the objects module is a bit hard to read, take it slowly and ask for help when you need it) and see if you can apply it to your module.
Chambahs - Fri Jan 23, 2009 2:25 am
Post subject:
A code snippet done by smong that was taken out of UT_Bombrun.py from the pack of modules in the UT project found here: http://forums.minegoboom.com/viewtopic.php?t=6382

Code: Show/Hide

    # check for soccer game over
    if arena.utbr_tokens[team] >= arena.utbr_capturepoints or \
        arena.utbr_suddendeath:
            # notify arena
            chat.SendArenaSoundMessage(arena, SOUND_DING, "Soccer game over."
                + " Freq %d are the winners." % p.freq)

            # toggle lvz
            if cfg_winlvzid:
                objs.Toggle(arena, cfg_winlvzid + (p.freq % 2), 1)


If I remember correctly, this module does what you are looking for. I think we had different lvz for the different freqs winning a game. Anyway, just pointing out somewhere you could start looking.
Anonymous - Sat Jan 31, 2009 3:35 pm
Post subject:
?objon doesn'y work in my zone, any idea why?

Also, in this module, would it be possible to have a 10 second delay, then a new message and object displayed, followed by a prize.

Assuming I have not coded anything, lol. I don't really understand how it all works, but would like to.
Dr Brain - Sat Jan 31, 2009 3:45 pm
Post subject:
Make sure "objects" is in modules.conf. If not, just add it to the end.

Start small, then move on from there.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group