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
Starting and Stopping flag games/events without recycles

 
Post new topic   Reply to topic Printable version
 View previous topic  I need spree.dll for windows. Post :: Post Securing the TCPBiller protocol  View next topic  
Author Message
Animate Dreams
Gotta buy them all!
(Consumer whore)


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

PostPosted: Sun Feb 04, 2007 1:47 pm    Post subject: Starting and Stopping flag games/events without recycles Reply to topic Reply with quote

Right now, I'm trying to find a way to be able to run different things like flag games and events(specifically, Smong's br module), from a module. Of course, the modules aren't set up to do this, so I'll have to change some things, but before I start messing around, I'd like to make sure I'm doing it right.

Basically, the final result should be that when the jackpot reaches a certain amount, a flag game will start. Once the flag game ends, bounty rabbit will start, until jp reaches a certain level again, at which point br will be stopped and the flag game started, until the zone crashes.

Now, if I remember correctly, you can't interface with a python module, only C can interface with C, and Python can interface with C. Something like that, anyway. So I figure I'll just mutate Smong's br.py module until it works for me. I know that's usually not the best solution, but that's the only one I can figure out at the moment. As for starting a bounty rabbit game, it should be as simple as moving the callbacks to be loaded on a callback from a flag game win, and unloaded when the jp hits a certain level(which I have a timer for, checks every 30 seconds).

But I have a problem with the flag win callback. I know there's probably a way to use one of the existing callbacks, but I couldn't come up with anything this morning. And wtf is fg_wz.h? I couldn't find a file that included it.

Anyway, I'm sure I can figure that out without too much problem, the main reason I'm posting about this is because it feels like there should be a better way to do this. I'm almost positive I'm doing it the wrong way. Since I eventually plan to add more events than just br, it'd be very nice if I didn't have to make one massive conglomerate Python module, I'm sure it'd get very complex. :( Any ideas?
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
Chambahs
Power attack
Power attack


Joined: Jun 19 2005
Posts: 820
Offline

PostPosted: Sun Feb 04, 2007 2:19 pm    Post subject: Reply to topic Reply with quote

I remember when i wanted to do something like this, smong told me it would be easiest to throw everything into one module. Which is bad for debugging and will be kinda big....but it lets you control the others without worrying about complex things.
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Feb 04, 2007 4:44 pm    Post subject: Reply to topic Reply with quote

fg_wz would be the include file for the warzone flaggame plugin. It's probably just there in case you want to use it, not because it's needed.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Mon Feb 05, 2007 1:56 am    Post subject: Reply to topic Reply with quote

fg_wz.h is just there to define the CB_WARZONEWIN callback, which there are no existing users of. But fg_wz calls it (see line 253 in fg_wz.py), so if you want to implement it, you can.

As for your original problem, you're right, there should be a better way to do it. But I'm not sure there is right now. Ideally, all game modules would expose some similar interface to let you start and stop them. You could try to move things in that direction and post your changes. It might make sense to use one interface id for this thing, let multiple modules register their own implementations, and use GetInterfaceByName to find them. That function isn't exposed to python right now, but it should be easy enough to add.

About interfaces and python, here's how it works:

If it's in a .h file, and compiled into pymod, then you can implement it in either C or python and call it from either C or python. If it's not in a .h file, then you can implement it in python and call it from python (calling or implementing something in C makes no sense without a .h file).

So if you want to add a real interface to fg_wz.h, and recompile pymod, you could do that. But if you just make up an interface id, register some instance in fg_wz.py, then you should be able to use it from another python module just by using the same interface id.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
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: 301 page(s) served in previous 5 minutes.

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