[bf1942] We REALLY need the BF2 Python API (Andreas - question for you here!!!)

Panic panic at battlefield.no
Sun Jun 26 09:30:11 EDT 2005


Andreas

Would we be in violation of the copyright notice in "admin/default.py"
if we posted
a modified variant of the file on the fun-o-matic wiki...?

I assume we would, but then again, I assume us modding the file is
pretty much the
entire idea behind the py-interface. So should such a permission be
explicitly given
in the header of the file...?

-Frode


Einar S. Idsø wrote:

>Sure, that was our intention all along. We're just cleaning up the code
>a bit, adding comments and such.
>
>If by "callback registration" you mean calls on the form
>host.registerHandler('EventName', pythonEventHandler[, parameter]), then
>yes, we have that working. We have no idea what "parameter" is, but so
>far it seems like it's necessary to put a 1 there. Additionally, the
>function specified by pythonEventHandler needs to have the correct
>number of arguments, a number which depends on the actual event.
>
>We'll be posting more later on (hopefully today) when we've got
>everything put together.
>
>Einar
>
>
>Forrest Thiessen wrote:
>  
>
>>Your script sounds really great--any change you would be willing to
>>share it?
>>
>>Does this mean you solved the problem with getting callback registration
>>to work?  I'm still messing with it--I think I've tried around 64 of the
>>190  ;-) possible variations I've thought of, and so far none have
>>worked.  This is slow going, trying to figure everything out in reverse.
>>
>>On the other hand, I've had very good luck with
>>host.registerGameStatusHandler(pythonEventHandler). . . it works exactly
>>like you would expect it to.  You can only get so far with game status
>>changes, though!
>>
>>--Forrest (aka "Woody")
>>
>>
>>Einar S. Idsø wrote:
>>
>>
>>    
>>
>>>Shamelessly following up on my own post here:
>>>
>>>We've just finished a script to perform autokick of players based on
>>>ping (measure every 30 seconds, if ping goes above limit three times,
>>>you're out). This was a lot of hard work w/o any documentation on the
>>>API. Thank goodness for the Wiki-page!
>>>
>>>But to my question: We all know about the game.sayall command by now. It
>>>will spam some text in green at the top left. We use this to inform
>>>players when they exceed the ping-limit and when they are about to be
>>>kicked. We think it would be much better to have text in a red
>>>warning-color for this, and possibly placed in the middle of the screen
>>>instead of the top corner. It would also be nice to send the message
>>>directly to the player instead of spamming it to the entire server.
>>>
>>>So does anyone know of any other rcon- og Py-functions for sending
>>>messages to the server/individual players? We were able to find a
>>>function called bf.gameLogic.sendServerMessage() in
>>>python/bf2/stats/stats.py, but it seems like it's not working right (the
>>>function in stats.py where it is used seems to be unfinished as well).
>>>
>>>Einar
>>>
>>>
>>>      
>>>
>>
>>    
>>
>
>
>  
>


-- 

----------------------------------------------------------------------
 Name: Frode Hommedal
 Location: Norway
 Day job: VLSI designer and programmer
 Site: Battlefield.no [ http://www.battlefield.no ]
----------------------------------------------------------------------
 International Game Server Operators Association [ http://igsoa.com ]
----------------------------------------------------------------------





More information about the Bf1942 mailing list