1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

help with new specialists

Discussion in 'Bugs and Crashes' started by Dancing Hoskuld, Sep 15, 2011.

  1. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,903
    Gender:
    Male
    Location:
    Canberra, Australia
    This thread is me asking for some help with C2C specific python.

    When you add a new specialist to C2C you can't assign any citizens to it in the city screen because it is displayed in the wrong place. See current.jpg.

    I have done some work and I am now getting the buttons and if no doctors assigned I also get the graphic. See New.1 for a city that can't assign Doctors and new2. for a city that can.

    However when I assign a Doctor using the + button no Doctors are appearing. In a previous iteration they were appearing under the clock!

    AIAndy can you help? I have included a copy of my python (remove the new from the name to use it).
     
  2. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,392
    Ok, I had a look how that part of the code works.

    How do you want extra specialists displayed in general?
    I would suggest two columns, one displayed like now with +/- signs on the right and growing specialist numbers to the left and one on the opposite end with +/- signs on the left and growing to the right. If the citizen number in one row exceeds the amount displayable right next to each other, start stacking using the relative number to split the space.
    That way you can have twice the number of specialists while they should still be displayed fine.

    I'll get around to writing that code this evening (european time).
     
  3. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,903
    Gender:
    Male
    Location:
    Canberra, Australia
    :mischief:Well if I had my 'duthers I would change everything about that file making it more object oriented and getting the bits to do the modding work for me.:mischief: I assume you noticed the redundant code.:rolleyes:

    However I just want it to work. I use the smallest screen resolution settings because my computer can't handle higher in C2C. The right column as is perhaps moved a bit to the right. A second column using the left hand part of the box.

    At the moment I only have two specialists I need adding so they should fit most of the time. The +/- buttons in the left column seem to take priority over any citizens that may display under them so it is not a big problem.

    As I said if I had my way The specialist box would get given the its absolute size and position in pixels. then it would work out how best to display the number of different specialist etc. I know it can be done - I did something similar in the old days when I worked for a living. Unforunately it was not Python and I am still getting my head around that language. ;)
     
  4. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,392
    The code already does some calculations and positions the widgets accordingly but it assumes that all specialists will be one under the other with specialist citizens then growing to the left.
    Several widgets for them are placed at game load and then made visible when they should be seen.
     
  5. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,903
    Gender:
    Male
    Location:
    Canberra, Australia
    Everything was going fine, except that the active heads were being displayed up the top of the screen near the clock.

    Then I tried to change updateCitizenButtons_Stacker and updateCitizenButtons_Chevron to display in the correct place. Where upon the active heads for the new specialist disappeared!

    It is after midnight and I could not sleep because I read your reply just before going to bed.
     
  6. EldrinFal

    EldrinFal Chieftain

    Joined:
    Mar 22, 2011
    Messages:
    926
    Is there no way to create tabs in the city screen? Just seems like with all the new stuff added, new tabs would organize things better. Specialist tab, goods tab, resources, buildings, wonders...
     
  7. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,392
    My apologies.
    I have been looking into your version of the code now more closely.
    The specialist counting could be wrong. Once it counts with this code:
    max(pHeadSelectedCity.getSpecialistCount(i), pHeadSelectedCity.getForceSpecialistCount(i))
    Then the same I assume is tried with another variable:
    iCount = pHeadSelectedCity.getSpecialistCount(i)

    But the value put in there is different for a citizen automated city.
    The first is used to check if the disabled specialist picture should be hidden, the second is then used to check how many specialists should be drawn.
    So to get no disappearing specialist picture, the variables need to be the same. Best only use one and use the other (like already done in the visible check) to count the actual specialists to be displayed for increase/decrease (those that are not great people specialists).
     
  8. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,903
    Gender:
    Male
    Location:
    Canberra, Australia
    Ah ha. so what I am doing wrong is I am getting the start point for the showing of the heads mixed up with where each head goes. Thanks.
     
  9. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    That should be possible but it would be a pretty big job for someone that knows the python side of things. Personally I'd love to see the buildings functionality expanded for example, and tabs would certainly free up space in general. Here is a list of things off the top of my head I'd love to see in the city screen:

    • Ability to sort buildings by gold, happiness, health, etc.
    • Ability to filter buildings to oly show those that contribute to gold, health, happiness, etc.
    • Include the build time of the building up front in the top level list ui somehow
    • Cleaner interface for destroying buildings
     
  10. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,291
    Gender:
    Male
    Location:
    MN
    So how is this coming along then?
     
  11. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,903
    Gender:
    Male
    Location:
    Canberra, Australia
    The weekend was dedicated to Real Life.
     
  12. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,291
    Gender:
    Male
    Location:
    MN
    I think everyone had a RL time this weekend, but as they say, "That's Life.";)
     

Share This Page