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
looping through arenas in python

 
Post new topic   Reply to topic Printable version
 View previous topic  warper Post :: Post Weapons with directions...  View next topic  
Author Message
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Wed Nov 30, 2005 1:58 am    Post subject: looping through arenas in python Reply to topic Reply with quote

Code: Show/Hide
def announce(a):
    chat.SendArenaMessage(a, "hello arena!")

for_each_arena(announce)

The code above won't work, but if I change it to loop through all players, as below, it works properly:
Code: Show/Hide
def announce(p):
    chat.SendMessage(p, "hello!")

for_each_player(announce)

what gives?
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Wed Nov 30, 2005 4:14 am    Post subject: Reply to topic Reply with quote

Oooh, that's embarrassing: pymod.c, line 1476, should be "FOR_EACH_ARENA(a)", not "FOR_EACH_PLAYER(a)".
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Wed Nov 30, 2005 5:46 pm    Post subject: Reply to topic Reply with quote

to recompile pymod, I need the .inc files, which look like they're generated through a python script by the makefile:

Code: Show/Hide

pymod_mods = pymod
pymod_libs = $(PYTHON_LDFLAGS)

$(eval $(call dl_template,pymod,maybe_))

ifeq ($(have_python),yes)
DLS += $(maybe_pymod_DL)
endif


# rule to generate files
$(call tobuild, py_constants.inc py_callbacks.inc py_interfaces.inc py_types.inc): \
      $(SCRIPTS)/pymod-process.py $(PYMOD_HEADERS)
   $(PYTHON) $(SCRIPTS)/pymod-process.py $(dir $@) $(PYMOD_HEADERS)

# special options for pymod.o
$(call tobuild, pymod.o): CFLAGS += $(PYTHON_CFLAGS)

# dist: public


Since I'm using windows, rather than linux, I'd want to run the python script directly. What are the parameters it takes if I want to generate the .inc files? If I give it a directory it will make the files, but I do not think the contents are correct.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Thu Dec 01, 2005 2:10 am    Post subject: Reply to topic Reply with quote

Why not just use the makefile to build? All this stuff will be taken care of...
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Tue Dec 06, 2005 12:42 am    Post subject: Reply to topic Reply with quote

what windows program can I use that makes .mk files?
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Tue Dec 06, 2005 3:30 am    Post subject: Reply to topic Reply with quote

Uh, notepad? Whatever you use to edit your source. The ".mk" files are just snippets of Makefile that describe modules.

If you're asking what you use to run them, the answer is either mingw (plus msys) or dev-c++ (which includes mingw plus an ide), both of which include a program called "make".
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: 16 page(s) served in previous 5 minutes.

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