Logitech
A Person.
Hi, I'm not an expert on civ IV moding, so I need some help.
I'm working on the Final Frontier mod, more specificly, the Star Trek beta 3 mod, and I am adding a feature (wormhole) that when ocupied by a unit, will transport that unit to another wormhole. I have it all put together, the XML, the python, and I've tested it, but the method I am using now is sending all units to the same wormhole, and any unit on that wormhole plot doesn't move. What I want is the code to loop through all plots, find all wormholes (both of which it does right now), then make a list of other wormholes, and pick a random plot (with wormhole) and send the unit there. All this must be done on a random map.
So, I need to find out: (1: How to make a list of all plots with wormholes, and (2: how to make it chose one, without making it crash or freak or anything it's not suposed to do.
I allready have or know how to: (1: Loop through all plots (learned from the surrounding code), and (2: moving the unit to a targeted plot.
BTW: If there is an easy way to make a wormhole send units to another specific wormhole-containing tile, and vise-versa between the two, with all others not sending any units to either of them on a random map (whew!), I would like that much better.
PS: if anyone can sugjest a way to allow trade through wormholes, that too would be appreciated!
I'm working on the Final Frontier mod, more specificly, the Star Trek beta 3 mod, and I am adding a feature (wormhole) that when ocupied by a unit, will transport that unit to another wormhole. I have it all put together, the XML, the python, and I've tested it, but the method I am using now is sending all units to the same wormhole, and any unit on that wormhole plot doesn't move. What I want is the code to loop through all plots, find all wormholes (both of which it does right now), then make a list of other wormholes, and pick a random plot (with wormhole) and send the unit there. All this must be done on a random map.
So, I need to find out: (1: How to make a list of all plots with wormholes, and (2: how to make it chose one, without making it crash or freak or anything it's not suposed to do.
I allready have or know how to: (1: Loop through all plots (learned from the surrounding code), and (2: moving the unit to a targeted plot.
BTW: If there is an easy way to make a wormhole send units to another specific wormhole-containing tile, and vise-versa between the two, with all others not sending any units to either of them on a random map (whew!), I would like that much better.
PS: if anyone can sugjest a way to allow trade through wormholes, that too would be appreciated!