I'm back and ready to be annoying again!
So, two of the three problems I've had still completely elude me. Good news is I finally figured out how to do the fiferpg dialogue thing properly, though I'm admittedly not entirely sure whether it's an unnecessary workaround or not, because I'm still basically just using the keys in the dictionary and not the values. Works fine though, so I'm happy.
The pychan problem is still utterly baffling to me, no matter how many different approaches I try. Maybe I'll just ask it on irc at some point in case nobody responds (unless they're all purposely ignoring me of course). To rephrase the problem a bit: when you populate lists of dialogue options or inventory items or whatever, then you usually need to know which one the player clicked on. For some reason I can't figure out, this is seemingly only possible without carrying over any additional arguments. I.e., to use the way I did the dialogue thing as an example:
for possible_response in dlg.possible_responses:
response = pychan.widgets.Label(max_size=(200,1000),wrap_text=True)
response.text = dlg.dialogue.sections["%s" % possible_response].text
self.responsesbox.addChild( response )
This works fine, as long as you use a "generic widget" in the called function. But the moment you don't use this generic widget, and try to carry over any information (e.g. use "response.capture(lambda: self.respond(response))" then suddenly the event mapping goes all wrong and pychan can't tell anymore which label in the list you've clicked on (I think it automatically assumes it's the last one). Again, does anyone happen to know how to avoid this?
For your second question, I pushed a commit that fixes a bug where that would have been impossible.
You will have to set the "new_map", "new_position", and "new_layer" fields of the Agent component.
You could just use the "map", "position", and "layer" fields of the Player Agent component for these.
I still can't get it to work I'm afraid. When I do this (with your commit downloaded of course):
thing.Agent.new_map = player.Agent.map
thing.Agent.new_layer = player.Agent.layer
thing.Agent.new_position = player.Agent.position
Then I get this error:
Traceback (most recent call last):
File "C:\Program Files (x86)\FIFE\demos\fiferpg demo\run.py", line 266, in <module> main()
File "C:\Program Files (x86)\FIFE\demos\fiferpg demo\run.py", line 251, in main app.run()
File "C:\Python27\lib\site-packages\fife\extensions\basicapplication.py", line 197, in run retval = self.mainLoop()
File "C:\Python27\lib\site-packages\fife\extensions\basicapplication.py", line 222, in mainLoop self._pump()
File "C:\Python27\lib\site-packages\bGrease\grease_fife\mode.py", line 54, in _pump self.pump(delta_time)
File "C:\Python27\lib\site-packages\fife_rpg\rpg_application.py", line 833, in pump self.current_map.update_entitities_agent()
File "C:\Python27\lib\site-packages\fife_rpg\map.py", line 209, in update_entitities_agent location = fifeagent.behaviour.location
AttributeError: 'NoneType' object has no attribute 'location'
I tried some (probably stupid) workarounds of forcibly giving the Gold agent a behavior (with the idea of that giving him the error-inducing behavior.location as well), but that just resulted in nothing happening. No clue what's going wrong.