Simple Python Things

Hey The_J, just wanted to say thanks for the ranged combat strength display mod....try saying that 3 times fast....It is going to make it so much easier to play my mod.

I was wondering if you had the skill/will to expand it to add the display in various other places such as the civilopedia unit entries or the pop up windows in the build options etc. Basically just any or all of where the unit info is displayed, I am not so bothered about the pop up windows, but the civilopedia would be nice so people can get an overview of a units strength and compare it with other units.

Either way, thanks again!
 
mmhh...I think everything in the buiding menu are hover texts, which are AFAIK in the .dll, so not sure.
Guess civilopedia will be doable.
Not sure if I can do it this weekend. Will be busy today with baking, and probably tomorrow with eating :D, so I'll have to find some time in between (living with a lot people can really be a time drain ^^).
 
Not sure if I can do it this weekend. Will be busy today with baking, and probably tomorrow with eating :D
Yay! Eating!

One of my personal favorite things to do. :p
 
:yumyum: tasted good, but I'll not again make cupcakes for 15 persons without a proper oven.

So, 3 options:
Spoiler :
attachment.php


#1: New line, no adjustment of the font size. Makes the whole thing ugly, but easy to merge.

#2: New line, adjustment of the font size. Looks better, but more difficult to merge.

#3: No new line, but the ranged strength is attached to the entry for the range itself.

Which one do you want?
 

Attachments

  • Clipboard01.jpg
    Clipboard01.jpg
    133.3 KB · Views: 305
I think the combined line with Range and then strength in the same line.

Would it also be possible to change the Strength Text to 'Melee'

So you have:
Melee: 6 (arm)
Ranged: 1/3 (arm)

that I thing would be lovelly :) if they could be next to each other as well if possible, instead of range at the bottom. That would be Awesome!

This is going to make designing units SO much easier :D
 
Not sure if melee will fit for tanks and musketmen :D.
Moving the range up should be easy.
Will have to see if I have time this evening (living together with many people is really a time drain; you can come home without doing anything and 2 hours might already be gone).
 
Not sure if melee will fit for tanks and musketmen :D.
Moving the range up should be easy.

Yeah the combat system in my game is different, most units (if they have a gun) have range strength, and melee strength is for moving in and finishing them off.
So tanks would have a melee (tank shock) ability, but most of their damge will come from range :) BIG GUN!! Melee also constitutes defensive strength/survivability
 
Spoiler :
attachment.php


Search for "combar-aircombat-civilopedia" in the .py file. There are 3 changes, all need to be copied, as well as a text XML for the text changes.

And sorry for the delay :blush:. I cannot really get anything done at the moment.
Means I'll probably not take any requests anymore, I just don't have the time for it :/.
 

Attachments

I'm trying to use BugData to persist some values across saves and it just doesn't seem to be working.

What I'm doing boils down to this:

Code:
def getDataValue(key):
    counters = BugData.getGameData().getTable("DS")
    if (not counters.hasTable(key)):
        counter = counters.getTable(key)
        result = None
    else:
        counter = counters.getTable(key)
        result = counter["val"]
    return result

def setDataValue(key, value):
    counters = BugData.getGameData().getTable("DS")
    counter = counters.getTable(key)
    counter["val"] = value

Everything works fine within the game, but when I save and reload, the values I put in with setDataValue() are gone. Even if I arrange to have BugData.save() called explicitly, it seems to have no effect.

What am I missing?
 
The notes at the start of the BugData.py file include:
## - Must be loaded at the start of the OnLoad event
## - Must be saved at the end of the OnPreSave event

Are you sure both of these things are the case?

Also, the data is stored in the script data of the CyGame object. If the setScriptData() function for the game object is called by anything else it will wipe out your data.
 
I wish I could tell for sure. What I'm working on is an extension to Unit Naming, and I've modified UnitNameEventManager to import it. If I understand correctly, UnitNameEventManager plugs in to BugEventManager, and it's the latter that provides the handlers for the OnLoad and OnPreSave events. In any case, UnitNameEventManager doesn't appear to explicitly handle those events.

It occurs to me that some calls to this code would run at import time so maybe it's just happening too early. You think maybe I should try to defer these calls until everything is loaded?
 
Hi. About civilopedia, I also have one request , if I may.
I finished the National Palaces part for my mod and the review would consider to be good, have in civilopedia the National Palace separate page . Do you think it's possible? Could you help me with this , please ?
thank you very much for your answer :)
Hroch
 
Back
Top Bottom