[PYTHONCOMP] Specialist Stacker

Thanks for letting me know. I will make a new release of the mod using his newest code after I release the mercenaries mod.
 
Ok, I just released a new version of the specialist stacker code v0.6.2, download away!
 
Great work on stacking the specialists!

Would this sort of thing also be possible to do with unit stack displays? I've found that when you have large numbers of units in a stack the horizontal display is a real pain. It would be great if you could configure unit stack displays to both a verticle and horizontal display. That way if you have 30 tanks you could have three visible rows of ten when you click on that particular stack instead of having to scroll back and forth through the stack.

Get back to me with what you think, I'd love to help with this in any way possible.
 
So let me summarize what you are asking for:

You want to be able to stack the units in the city screen and allow them to stack using multiple rows?
 
TheLopez said:
So let me summarize what you are asking for:

You want to be able to stack the units in the city screen and allow them to stack using multiple rows?

Multiple rows, yes! But not in the city screen, the Main Screen. I've provided a picture that shows what I'm trying to explain.

As you can see I've also flipped the scroll arrows in the picture because if one were to do this there would need to be a limit as to how high the stack would go.

How difficult would this be to accomplish?

Thanks,

dampkring



OR...

 
Updated to be compatible with the v1.61 patch.
 
Would it be possible to make a version of this that had three columns instead of just two? I have tried to make this change myself but I can't seem to get the yshift (vertical) values to work. For some reason the middle column stays up in the resources area and only the third column gets shifted down even with the first (far right) column.

I am working on a mod that will have 15 to 16 specialist types.
 
I'll see what I can do, but it will have to wait until I finish the sniper mod.
 
I had an idea for an improvment to your stacker mod.

Normaly their is no visual feedback as to what the maximum number of alowable specialists is. I propose a stack of the faded/translucent specialist heads equal to the cap. As the player increeses or decresses specialist counts the translucents turn opace to indicate an actual specialist. When the cap is zero (like on a new city) then no transulent heads are displayed and neither are the buttons (theirs realy no point if they cant do anything).

If your realy ambitious I would like to see thouse little + and - buttons removed and instead control specialist counts by clicking directly on the heads, clicking on a translucent head sets it and all heads to the right of it to active specialists. Click on an Opacue head and all the heads to the left become transulent. Likewise using the scroll wheel of the mouse in increment up or down when moused over the specialists would be very nice.
 
Impaler[WrG] said:
I had an idea for an improvment to your stacker mod.

Normaly their is no visual feedback as to what the maximum number of alowable specialists is. I propose a stack of the faded/translucent specialist heads equal to the cap. As the player increeses or decresses specialist counts the translucents turn opace to indicate an actual specialist. When the cap is zero (like on a new city) then no transulent heads are displayed and neither are the buttons (theirs realy no point if they cant do anything).
That is a very interesting idea.

Impaler[WrG] said:
If your realy ambitious I would like to see thouse little + and - buttons removed and instead control specialist counts by clicking directly on the heads, clicking on a translucent head sets it and all heads to the right of it to active specialists. Click on an Opacue head and all the heads to the left become transulent. Likewise using the scroll wheel of the mouse in increment up or down when moused over the specialists would be very nice.
This I'm sorry to say is not very possible since you could have more specialists than the ones being displayed. If you want to see an example of this just go into world builder and increase the population of one of your cities to 10 and add a bunch of citizens, you'll see that in the vanilla game only 6. Of course with the specialist stacker mod you can show all of them, but I do have to consider the case when they are not, you know what I mean?
 
Updated with link to Warlords compatible version!!!
 
TheLopez,

I really do appreciate all the hard work you have put into all these mods, they really add a lot to the game.

But I broke this one when I tried to add in the PlotListEnhancements mod by 12Monkeys, too. Now my specialists aren't stacked, they are in a single column on the right side of the city screen. A

What have I done wrong? Any help is appreciated.

Below is the python code from the CvEventInterface.py file.

import CvUtil

from CvPythonExtensions import *

#<GREAT STATESMAN START>
import CvCustomEventManager

normalEventManager = CvCustomEventManager.CvCustomEventManager()
#<GREAT STATESMAN END>

# **********************************
# GJD Alerts modifications start here
# **********************************

customEventManager = CvCustomEventManager.CvCustomEventManager()

def getEventManager():
return customEventManager

# **********************************
# GJD Alerts modifications end here
# **********************************

def getEventManager():
return normalEventManager

def onEvent(argsList):
'Called when a game event happens - return 1 if the event was consumed'
return getEventManager().handleEvent(argsList)

def applyEvent(argsList):
context, playerID, netUserData, popupReturn = argsList
return getEventManager().applyEvent(argsList)

def beginEvent(context, argsList=-1):
return getEventManager().beginEvent(context, argsList)
 
wotan321 said:
TheLopez,

I really do appreciate all the hard work you have put into all these mods, they really add a lot to the game.

But I broke this one when I tried to add in the PlotListEnhancements mod by 12Monkeys, too. Now my specialists aren't stacked, they are in a single column on the right side of the city screen. A

What have I done wrong? Any help is appreciated.

Below is the python code from the CvEventInterface.py file.

Well you can only have one event manager in your quote you are showing that you setup one and then override it with another.

Also, you shouldn't need to the event manager from the Great Statesman if you just want the specialist stacker...
 
No, I want to put together a bunch of mods. Forgive me, I know nothing of python, what line calls the event manager?

Thanks again for the help.
 
That's weird.

When using your modcomp and trying to add a specialist to the city by clicking on a city-worked plot this specialist ist set higher on the screen than the inactive specialist.
 
Caesium said:
That's weird.

When using your modcomp and trying to add a specialist to the city by clicking on a city-worked plot this specialist ist set higher on the screen than the inactive specialist.
Hmmm... that's wierd since this mod has been working fine for months... It's even included in the HOF mod.
 
Okay, if you would please, patiently step this Non-programmer through the logic of this file. I have read a bit of the tutorials available here and at Apolyton about Python, so I have a bit of understanding.

Below is my original code from the CvEventInterface.py file.


#<GREAT STATESMAN START>
import CvCustomEventManager

This "great statesman" snippet is from the GPTricklePlus componant.... the above "import" is bringing in the code in the CvCustomerEventManager.py file.

normalEventManager = CvCustomEventManager.CvCustomEventManager()

Next, the variable normalEventManager is created and given the data from the CvCustomEventManager, and that normalEventManager can be referenced later in this file....?

#<GREAT STATESMAN END>

# **********************************
# GJD Alerts modifications start here
# **********************************

customEventManager = CvCustomEventManager.CvCustomEventManager()

So here I load the data of CvCustomerEventManager again, this time for use by the variable customEventmanager.

def getEventManager():
return customEventManager

What does the above 2 lines do? In any case, here I am referencing back to customEventManager.....

# **********************************
# GJD Alerts modifications end here
# **********************************

def getEventManager():
return normalEventManager

... and here I do the same thing again, but with a different file. So at this point, is the data from customEventManager even available for use, since the later def statements refer back to getEventmanager, and that has been overwritten. Is that the problem?

If you could shine some light on this issue for this fledgling python programmer, I surely would appreciate it. (and so would many other confused people). I guess there is no way to work with events without learning python...so that is what I will do.
 
wotan321 said:
Okay, if you would please, patiently step this Non-programmer through the logic of this file. I have read a bit of the tutorials available here and at Apolyton about Python, so I have a bit of understanding.

Below is my original code from the CvEventInterface.py file.


#<GREAT STATESMAN START>
import CvCustomEventManager

This "great statesman" snippet is from the GPTricklePlus componant.... the above "import" is bringing in the code in the CvCustomerEventManager.py file.

normalEventManager = CvCustomEventManager.CvCustomEventManager()

Next, the variable normalEventManager is created and given the data from the CvCustomEventManager, and that normalEventManager can be referenced later in this file....?

#<GREAT STATESMAN END>

# **********************************
# GJD Alerts modifications start here
# **********************************

customEventManager = CvCustomEventManager.CvCustomEventManager()

So here I load the data of CvCustomerEventManager again, this time for use by the variable customEventmanager.

def getEventManager():
return customEventManager

What does the above 2 lines do? In any case, here I am referencing back to customEventManager.....

# **********************************
# GJD Alerts modifications end here
# **********************************

def getEventManager():
return normalEventManager

... and here I do the same thing again, but with a different file. So at this point, is the data from customEventManager even available for use, since the later def statements refer back to getEventmanager, and that has been overwritten. Is that the problem?

If you could shine some light on this issue for this fledgling python programmer, I surely would appreciate it. (and so would many other confused people). I guess there is no way to work with events without learning python...so that is what I will do.

First of all, yes, that is the problem... you are defining two getEventManager methods in the same class. The other problem that you are having is that the GP Trickle Plus mod uses a different custom event manager than the one that you are trying to set up. You might want to read up on Dr. Elmer Jiggles custom event manager found here: http://forums.civfanatics.com/showthread.php?t=157141

Second, why are you asking this question here? This thread is for the specialist stacker mod comp. The Specialist Stacker Mod Comp doesn't touch the event manager code at all.

Last, which mods are you trying to combine?
 
TheLopez,

Two excellent questions.

1. I am asking this question here because my poor understanding of python hosed your excellent specialist stacker component. If you look back on an earlier post, you will see it is in reference to that that began this quest.

2. Lets see... which mods do I want to incorporate? The GPTrickle, the Reforest, the attitude icons, your new "Dawn of Man" window, the PlotListEnhancement, the enhanced foreign and military advisor, and the tech leak one of yours. Many of yours actually, and they didn't give me any trouble until the PlotListEnhancements mod. And of course, I will want to add more as they evolve.

But ULTIMATELY what needs to occur is for me to get a working grasp of the dynamics of these python files. Then I can fix my own broken work, and help other noob events creators figure out how to edit events files, and add them to their own mods. And then.... we can all trade events back and forth and make our mods ever changing and ever-unique! A glorious era of Civ4 modability will sweep across the globe. There will be much singing, and dancing about! <g>

..okay, first I gotta figure out python. Your responses have been extremely valuable, and I am very grateful. Thank-you.
 
TheLopez, I attached my CvMainInterface.py

Maybe you could tell me, where I am wrong.
 

Attachments

  • CvMainInterface.txt
    161.8 KB · Views: 89
Top Bottom