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
Problem loading Python module

 
Post new topic   Reply to topic Printable version
 View previous topic  Server not appearing in download list Post :: Post Setup and configuring questions  View next topic  
Author Message
Guest



Offline

PostPosted: Tue Jan 09, 2007 4:54 pm    Post subject: Problem loading Python module Reply to topic Reply with quote

I was trying to load Smong's <py> br module(bounty rabbit, http://toktok.sscentral.com/ss-asss.html ), but it gives me this error:
Code: Show/Hide
E <pymod> error loading python module 'br'
Traceback (most recent call last):
  File "/as3/omega-fire/bin/br.py", line 73, in ?
    cb3 = reg_callback(CB_KILL_POST_NOTIFY, kill)
NameError: name 'CB_KILL_POST_NOTIFY' is not defined

CB_KILL_POST_NOTIFY is in the game interface, which is loaded. and none of the other callbacks from that interface are giving any problems. But I noticed in game.h that there really isn't a function for CB_KILL_POST_NOTIFY. I was assuming that it just used the same funcition as CB_KILL, but after noticing the line in the comment above it that says, "in general, you shouldn't need to use this.", I figured maybe it was taken out. That doesn't make much sense, but since I don't know exactly how callbacks work, I can't really figure out if that's true or not. Anyway, am I the only one that has problems with CB_KILL_POST_NOTIFY? Any suggestions about what I should do? I'm going to try just using CB_KILL, but I figure Smong would have gone ahead and used it if he could and there's probably a reason he used the other. Well, I'll try that out and I'll update this post.
Back to top
Chambahs
Power attack
Power attack


Joined: Jun 19 2005
Posts: 820
Offline

PostPosted: Tue Jan 09, 2007 7:28 pm    Post subject: Reply to topic Reply with quote

I think that module, along with alot of others we had are outdated and some need to be recoded to work with the new asss versions, i think that bounty rabbit module was made with asss 1.3.6 or 1.4, if you know how to code python it should be an easy fix, i would fix it for ya but sadly, its been a while...lol
Back to top
View users profile Send private message Add User to Ignore List
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:37
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Sat Jan 13, 2007 6:54 pm    Post subject: Reply to topic Reply with quote

Well, after I played with this a while, I got it to work. I had to change CB_KILL_POST_NOTIFY to CB_KILL, and past that, I had to load the module during start-up instead of ?insmodding it, or else the arena data wouldn't load correctly. I'm still not entirely sure why, and maybe that's something that can be fixed, but it's really not an issue.

Still doesn't explain where CB_KILL_POST_NOTIFY went.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Mon Jan 15, 2007 4:27 am    Post subject: Reply to topic Reply with quote

One release of asss was bugged and you had to use CB_KILL_POST_NOTIFY instead of CB_KILL. So almost all versions of asss you should use CB_KILL.

As for having to load it, then recycle the arena or put it in modules.conf, that's not too much effort. It can be fixed but I'm not doing it right now (if you want to fix it look into try/except blocks).
_________________
ss news
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Chambahs
Power attack
Power attack


Joined: Jun 19 2005
Posts: 820
Offline

PostPosted: Mon Jan 15, 2007 4:31 am    Post subject: Reply to topic Reply with quote

Heres some good examples:

Code: Show/Hide

def c_top(cmd, params, p, targ):
    top_kills = [ 0 ]
    top_p = [ None ]

    def for_each(i):
        if i.arena == p.arena:
            try:
                if i.kills[0] > top_kills[0]:
                    top_kills[0] = i.kills[0]
                    top_p[0] = i
            except:
                pass
    for_each_player(for_each)

    if top_p[0]:
        chat.SendMessage(p, "%s Has The Highest Kills With %d Kills" \
            % (top_p[0].name, top_kills[0]))

def c_kills(cmd, params, p, targ):
    try:
        chat.SendMessage(p, "You have %d Kills" \
            % (p.kills))
    except:
        kills = [0]
Back to top
View users profile Send private message Add User to Ignore List
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:37
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Wed Jan 17, 2007 7:54 pm    Post subject: Reply to topic Reply with quote

Well, since the module only runs if BountyRabbit is set to 0 in arena.conf, I don't see any reason why I shouldn't load it in modules.conf. One thing I haven't been able to test, though, if you use SetInt() to change that value, will the game stop? I know ?newpick won't work anymore, because it checks arena.conf, but I didn't see anything under def_kill so I assume that if a game is already going it'll continue? It would be easy enough for me to write a ?stopbr command or something, but I want to be able to start and stop it with another module, and I'd rather not write an interface if I don't have to.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions 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: 22 page(s) served in previous 5 minutes.

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