Setting specialists without forcing them

The Great Apple

Big Cheese
Joined
Mar 24, 2002
Messages
3,361
Location
Oxford, England
I can't seem to find a function that will let me set specialists without them coming up as "forced". Anybody managed to find one? I supose I could do an interface workaround but I thought I'd check here first...
 
Hmmm.... that's a good question, give me a sec and I'll check some code, I think I have done this in some of my code.

EDIT: Nope, no luck here either... sorry.
 
The Great Apple said:
I can't seem to find a function that will let me set specialists without them coming up as "forced". Anybody managed to find one? I supose I could do an interface workaround but I thought I'd check here first...

What do you mean with "forced"??
 
12monkeys said:
What do you mean with "forced"??
The player can force specialists using the '+' key by the specialist (and unforce using the '-' key). A yellow box goes around the specialist to show that it is forced.

Basically I need a way of assigning specialists, but I don't want the yellow box around them, and I want functions such as CyCity.getForceSpecialistCount(...) not include them. An interface bodge is possable, but I'm trying to keep the interface edits down...
 
Ah. I have no expereince with specialists through python, but those functions here looking useful :

PHP:
VOID alterSpecialistCount(SpecialistType eIndex, INT iChange)
int (int /*SpecialistTypes*/ eIndex, int iChange)

VOID changeForceSpecialistCount(SpecialistType eIndex, INT iChange)
int (int /*SpecialistTypes*/ eIndex, int iChange

VOID changeFreeSpecialistCount(SpecialistType eIndex, INT iChange)
int (int /*SpecialistTypes*/ eIndex, iChange

I guess you already tried it, but maybe ...
 
Nope none of those work unfortunately. You would think the alter one would since it doesn't include the words free or forced but it works just like the changeForceSpecialistCount method.
 
What difference does it make wether or not it's forced? Never understood that.
 
Lord Gideon said:
What difference does it make wether or not it's forced? Never understood that.
The governor won't deselect a forced specialist. Non-forced specialists are ones assinged by the governor - these are the ones I'm trying to mimic.
 
I'm actually looking through the API for some specific functions when I found this :

PHP:
VOID doTask(TaskType eTask, INT iData1, INT iData2)
void (int eTaskTypes, int iData1, int iData2) - Enacts the TaskType passed


Where TaskTyp is :

PHP:
TaskTypes:

  0 = TASK_DELETE
  1 = TASK_GIFT
  2 = TASK_TOGGLE_AUTOMATED_CITIZENS
  3 = TASK_TOGGLE_AUTOMATED_PRODUCTION
  4 = TASK_TOGGLE_EMPHASIZE
  5 = TASK_CHANGE_SPECIALIST
  6 = TASK_CHANGE_WORKING_PLOT
  7 = TASK_CLEAR_WORKING_OVERRIDE
  8 = TASK_HURRY
  9 = TASK_CONSCRIPT
 10 = TASK_CLEAR_ORDERS
 11 = TASK_RALLY_PLOT
 12 = TASK_CLEAR_RALLY_PLOT
 13 = NUM_TASK_TYPES

Maybe you can manage to change force specialist with TASK_CHANGE_SPECIALIST and any combination of iData1 and iData2. Maybe iData1 is the specialists type and iData2 is forced or not forced.
 
12monkeys said:
I'm actually looking through the API for some specific functions when I found this :

PHP:
VOID doTask(TaskType eTask, INT iData1, INT iData2)
void (int eTaskTypes, int iData1, int iData2) - Enacts the TaskType passed


Where TaskTyp is :

PHP:
TaskTypes:

  0 = TASK_DELETE
  1 = TASK_GIFT
  2 = TASK_TOGGLE_AUTOMATED_CITIZENS
  3 = TASK_TOGGLE_AUTOMATED_PRODUCTION
  4 = TASK_TOGGLE_EMPHASIZE
  5 = TASK_CHANGE_SPECIALIST
  6 = TASK_CHANGE_WORKING_PLOT
  7 = TASK_CLEAR_WORKING_OVERRIDE
  8 = TASK_HURRY
  9 = TASK_CONSCRIPT
 10 = TASK_CLEAR_ORDERS
 11 = TASK_RALLY_PLOT
 12 = TASK_CLEAR_RALLY_PLOT
 13 = NUM_TASK_TYPES

Maybe you can manage to change force specialist with TASK_CHANGE_SPECIALIST and any combination of iData1 and iData2. Maybe iData1 is the specialists type and iData2 is forced or not forced.

12monkeys, tried that and here is what I found: iData1 is what type of specialist i.e. engineer, artist, etc. iData2 is the number that should be added or removed.

Good find though.
 
I wonder what kind of mod you're working on, if it requires setting workers without "forcing" them; doing so will just result in the governor reassigning them to other tasks again, and the whole point's moot if the governor is turned off. The only thing I can think of would be to create a "preferred" category for specialists that would prevent the governor from relocating them normally, but would allow for such automated alterations if the city was in danger of starving (or in any of a number of specific scenarios). If it's something you're willing to work-around with the interface, though, then that can't likely be it.

I know I'm probably just being a nuisance by having asked, but I find myself curious as to what you're aiming to accomplish.
 
A Silly Goose said:
I wonder what kind of mod you're working on, if it requires setting workers without "forcing" them; doing so will just result in the governor reassigning them to other tasks again, and the whole point's moot if the governor is turned off. The only thing I can think of would be to create a "preferred" category for specialists that would prevent the governor from relocating them normally, but would allow for such automated alterations if the city was in danger of starving (or in any of a number of specific scenarios). If it's something you're willing to work-around with the interface, though, then that can't likely be it.

I know I'm probably just being a nuisance by having asked, but I find myself curious as to what you're aiming to accomplish.
I'm attempting to rebuild the governor from scratch. So far I have plot selection nailed down fine, but I'm having a few difficulties with the specialists (free area specialists such as from SoL and that civic giving me a headache). I'm also expecting the balancing to be quite tricky - I'll probably run comparisons against how the regular governor works and then make sure that mine does at least as good on all fronts...

I've added 2 more emphasis levels (ignore and super-emphasize) on top of the 2 already there, and I've added options to set the governor to never build certain types of specialist. I'm also planning to add a few more things to increase city performance under governor such as the recognition of processes (wealth/research/culture) where hammers are worth less than they would normally be (half by default). There are also probably going to be a host of pre-configurable clever things such as recognition and prioritsation of wonders/certain technologies, growth management so that the city grows as a new luxury is aquired... and stuff like that - I might have to check out the stratagy forum for some micromanagement tips. General aim is to both increase user power over the governor, as well as increase the effectiveness of it on it's own.

Unfortuently python, being an interpreted language, is a tiny bit slow for the amount of number crunching I'm having to do - I'm trying to move as much as possible of the processing away from the actual pressing of the button so that it's not so noticable, but I'm not certain that I'll be able to get it smooth enough to be playable... we'll see.
 
Back
Top Bottom