Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Python Module

 
Post new topic   Reply to topic Printable version
 View previous topic  Attaching turret with aim and firing c... Post :: Post List of players allowed per arena  View next topic  
Author Message
Digital Core
Guest


Offline

PostPosted: Tue Jan 20, 2009 3:23 pm    Post subject: Python Module Reply to topic Reply with quote

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.
Back to top
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Tue Jan 20, 2009 6:50 pm    Post subject: Reply to topic Reply with quote

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.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Chambahs
Power attack
Power attack


Joined: Jun 19 2005
Posts: 820
Offline

PostPosted: Fri Jan 23, 2009 2:25 am    Post subject: Reply to topic Reply with quote

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.
Back to top
View users profile Send private message Add User to Ignore List
Digital Core
Guest


Offline

PostPosted: Sat Jan 31, 2009 3:35 pm    Post subject: Reply to topic Reply with quote

?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.
Back to top
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Jan 31, 2009 3:45 pm    Post subject: Reply to topic Reply with quote

Make sure "objects" is in modules.conf. If not, just add it to the end.

Start small, then move on from there.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 670 page(s) served in previous 5 minutes.

phpBB Created this page in 0.472233 seconds : 30 queries executed (94.9%): GZIP compression disabled