In the course of my work I've came across a number of unresolved questions about how to do things. It occurred to me that there might be people here who happen to know the answers, saving me the time of rediscovering them.
1. How can I get information about the results of an event added? For example, when ordering an army to settle its current location, I add a GEV_SettleOrder to the GameEventManager. I would like to know whether or not this was successful and, if so, the index into my city array representing the new city.
2. Similarly, when I would like to initiate a combat, I call Army::Fight(), which returns void. I would like to be able to report whether or not my army was victorious.
(By the way, much of this code I inherited, and I would be glad to change it if there is a better way to accomplish what I am attempting.)
3. I have been using as an identifier an index into Player::m_all_armies, so that the external agent can specify things that should be done to a specific army. Unfortunately, it appears that (as you would expect) the elements of these arrays slide down to fill in spaces when an army is killed/disbanded/etc. Is there a more permanent ID that I can store and use after some number of turns with a guarantee that it refers to the same army?
4. There are a number of message that pop-up during the game to provide information but do not require a choice to be made. (For example, a notice that an opponent has started building a wonder, or a report on the results of entering a goody hut.) Is there a way I can suppress the creation of these pop-ups for non-interactive games, or cause them to automatically close?
Thanks so much for taking the time to read this and (hopefully) for your response!
Chad Hogg
1. How can I get information about the results of an event added? For example, when ordering an army to settle its current location, I add a GEV_SettleOrder to the GameEventManager. I would like to know whether or not this was successful and, if so, the index into my city array representing the new city.
2. Similarly, when I would like to initiate a combat, I call Army::Fight(), which returns void. I would like to be able to report whether or not my army was victorious.
(By the way, much of this code I inherited, and I would be glad to change it if there is a better way to accomplish what I am attempting.)
3. I have been using as an identifier an index into Player::m_all_armies, so that the external agent can specify things that should be done to a specific army. Unfortunately, it appears that (as you would expect) the elements of these arrays slide down to fill in spaces when an army is killed/disbanded/etc. Is there a more permanent ID that I can store and use after some number of turns with a guarantee that it refers to the same army?
4. There are a number of message that pop-up during the game to provide information but do not require a choice to be made. (For example, a notice that an opponent has started building a wonder, or a report on the results of entering a goody hut.) Is there a way I can suppress the creation of these pop-ups for non-interactive games, or cause them to automatically close?
Thanks so much for taking the time to read this and (hopefully) for your response!
Chad Hogg
Comment