[SDK] CvSelectionGroup

macsbug

Chieftain
Joined
Oct 31, 2005
Messages
75
I'm trying to work out how missions are handled by this class. Here's what I think happens when a player selects a mission followed by a target plot:

1. canDoInterfaceMode
-this function is called to determine if we can select the mission type
-"can the player select this mission?"

2. canDoInterfaceModeAt
-this function is called to determine if we've selected a valid plot
-"did the player select a valid plot?"

3. canStartMission
-this function checks to see if we can start the mission at the specified plot
-"can we start the mission with these parameters?"

4. startMission
-this function handles whatever we need to now that we've obtained a set of valid parameters for this mission
-"start the mission."

5. continueMission
-this function is called every turn while our current mission is still active
-"continue the mission."

Is the above accurate? I apologize if this is covered in one of the tutorials – if it is, I wasn’t able to find it.

Edit:
Nevermind, I was finally (I can’t stress that word enough :rolleyes: ) able to get a debug build of the DLL working - it was easy enough to verify what I needed to know from there.
 
If you (or anyone for that matter) wanted to be really really helpful (and loved) you could write a tutorial on how to get a debug version of the DLL working and use the debugger to step through code.
 
If you (or anyone for that matter) wanted to be really really helpful (and loved) you could write a tutorial on how to get a debug version of the DLL working and use the debugger to step through code.

I wish I could - believe me, I spent more hours than I care to count pulling my hair out trying to force a debug DLL out of the Visual C++ 2003 toolkit compiler. I even gave Visual Studio 2005's compiler another go, despite the warnings of serious incompatibilities I simply would not be able to overcome. Finally, I got fed up and "got" myself a copy of Visual Studio 2003. As you would expect, the debug DLL compiled in that without incident, however I'm reasonably sure that is not all that helpful to you.
 
This is an old post - but I was wondering if anyone knows the answers to the OP's questions. I am trying to add a condition (plot must have a resource or be a city) to the starting plot and ending plot of the Route To command, and I am curious if the functions mentioned above would be the place to add these conditions?
 
If I "teach" (limit) the AI, I should do the same to the human player, I would think?
 
Depends on if your goal is to improve the AI or to change how the game plays. You are asking how to limit the ROUTE_TO command, not how to limit where you build a road. So humans would just build individual roads and complain about being forced to micromanage. (unless you completely disabled all route building except route to)

Anyway, limiting the start to a bonus or city is easily done by checking the plot during canDoCommand. Limit for the end would possibly be trickier
 
Back
Top Bottom