Quick Modding Questions Thread

I'm making a mod with a new tech tree, and the tech tree has an error loading that doesn't specify why there's an error! What could be to blame for this?!
 
Yes I am able to code python.

I want to code python :)
A task outstanding in my RtW mod is adding more Historical Events into my mod.

i.e. from 1936 onwards ...

So having a template, created, based on my RtW that I can simply cut and paste and expand slowly to enrich the experience but not neccessarily change the game too much, the existing events can cover that.

e.g. at Turn 123 a message appears, describing a historical fact, from the Wkipedia list of events. (I can work out which turn equals which fortnight and year.

From what I understand from my basic understanding of Python, you can create a whole new file and use "includes" to feed it into the existing running scripts.

At later date I can then try to make ones that alter the game slightly, e.g. increase/decrease happiness in a city that an event occurs.
 
Edit: That was for Admiral Amarda.
Not functional dummy options, which you are free to use, if you need them.

@Bahmo: What? What does the exception say? And you you have a debug dll? Could help to diagnose it.

This is literally it. What's a debug dll?
 

Attachments

  • Civerror.jpg
    Civerror.jpg
    10.7 KB · Views: 145
Is caching deativated (default is not)?
If no: Hold down shift during loading, and see, if this changes something.

Actually, caching is deactivated (which is okay 4 me).

I actually realized that I was editing the wrong xml file.

In case anyone is using BUG mod and wishes to make changes to the Buildings, use the one in the Mod->BUGmod->Assets->XML->Buildings folder.

Thanks for the help ne ways, "The J".
 
I hope with the API you mean this one here ;).

I am prefer read *.py files, some of them have docs :)

A subversion system...oh, not many mods use one.
I think Legends of Revolutions (development stopped right now), BUG, RevolutionDCM and Affores Rise of Mankind modmod use one.

IMHO sunversion helps in all project if more then one developer :)

You might look into RevDCM. It adds lots of new rules to Civ4, maybe they have a use for another coder :D.

And if you need maybe just an interesting idea: FromAustria has asked a page before for an ethnical ingame GUI.
That should be possible in python, but it's quite a bit of work.

Thanks for info.

What are the modplayeroption1 options in the game options window?

modplayeroption1 is description of checkbox
PlayerOptionTypes.PLAYEROPTION_MODDER_1
This check box is disabled by default
Help says: "Player Option for Modding use 1"
 
This is literally it. What's a debug dll?

That's not very helpfull :confused:.

debug dll is a .dll, which has been compiled with some special options, so that the dll itself will show errors, which normally would not show up (e.g. like non existing ethnic art).
If your mod does not use a modified .dll, you could use the one in the download database.

I am prefer read *.py files, some of them have docs :)

Sure, but for the civ4 files, it's in most times not the case.
But many are very well written imho.

IMHO sunversion helps in all project if more then one developer :)

That's not the case for most of the mods here.
Many are only 1 person shows, with helpers for different things. It's relativly unlikely, that there's more than one responsible person here at a mod.

And additionally: Only a few modders here are computer scientists, which makes even more unlikely.
 
Well, my mod does use a modified dll, although I could probably remove it for testing purposes. Don't know about what I'd do with Quot Capita, though, the other mod that is giving me trouble.

Also, I searched for debug dll in the downloads database and didn't find it. What gives?
 
A task outstanding in my RtW mod is adding more Historical Events into my mod.

i.e. from 1936 onwards ...

So having a template, created, based on my RtW that I can simply cut and paste and expand slowly to enrich the experience but not neccessarily change the game too much, the existing events can cover that.

e.g. at Turn 123 a message appears, describing a historical fact, from the Wkipedia list of events. (I can work out which turn equals which fortnight and year.

From what I understand from my basic understanding of Python, you can create a whole new file and use "includes" to feed it into the existing running scripts.

At later date I can then try to make ones that alter the game slightly, e.g. increase/decrease happiness in a city that an event occurs.

Lets try to code.

first step:
Add lines to CvEventManager.py:

After imports:
from myscript import Each_turn_event

After: def onBeginPlayerTurn(self, argsList):
iGameTurn, iPlayer = argsList
Each_turn_event(iGameTurn,gc.getPlayer(iPlayer))

PS. Don`t forget an ident.

This code imports function (Each_turn_event) from file myscript.py
and calls it every turn.

Next put myscript.py to python folder.

Edit dateEvents dictionary as you wish.
 
Well, my mod does use a modified dll, although I could probably remove it for testing purposes. Don't know about what I'd do with Quot Capita, though, the other mod that is giving me trouble.

Also, I searched for debug dll in the downloads database and didn't find it. What gives?

Crap, you're right, there's only the normal 50 civs .dll in the database.

..er...are you able to compile a .dll? Then compiling a debug dll on your own should not be a problem.
 
Lets try to code.

first step:
Add lines to CvEventManager.py:

After imports:
from myscript import Each_turn_event

After: def onBeginPlayerTurn(self, argsList):
iGameTurn, iPlayer = argsList
Each_turn_event(iGameTurn,gc.getPlayer(iPlayer))

PS. Don`t forget an ident.

This code imports function (Each_turn_event) from file myscript.py
and calls it every turn.

Next put myscript.py to python folder.

Edit dateEvents dictionary as you wish.
Wow ... thanks for that.

So in
Code:
dateEvents = {
              0: (popup, ("First turn",)),
              2: (popup,("Second turn",)),
              4: (popup,("next turn",)),
              5: (popup,("next turn",)),
              6: (popup,("next turn",)),
              7: (popup,("next turn",)),
              8: (popup,("next turn",)),
              9: (popup,("next turn",)),
              }

each number (0: 4: etc. ) = actual turn

("NextTurn") = brief description of event e.g. "the ship sunk with total loss of life"
 
Crap, you're right, there's only the normal 50 civs .dll in the database.

..er...are you able to compile a .dll? Then compiling a debug dll on your own should not be a problem.

I am not able to do that. Perhaps I could with advice.
 
..er...are you able to compile a .dll? Then compiling a debug dll on your own should not be a problem.
That's not so true for everyone. The debug DLLs I tried to compile with VS2003 always crash with some "error_already_set" python error and new even reached main menu.:sad:
 
Wow ... thanks for that.
("NextTurn") = brief description of event e.g. "the ship sunk with total loss of life"

Python syntax:

("NextTurn") it is a string.
("NextTurn",) it is a tuple.

for example:
a = ("NextTurn")
b = ("NextTurn",)
a[0] = "N"
b[0] = "NextTurn"

And other feature:
You can input text in two format:
"Line1\line2\nline3"
or
"""Line1
line2
nline3"""
result will be same.

Triple quote(''' or """) has another bonus: you can use single " and ' inside text.
a = ''' Ship 'Boom' says "crack" '''
 
Tuple is somehow a "pair" in computer science language.

I am not able to do that. Perhaps I could with advice.

...er...than it might be a bigger thing, because it needs quite some installations and a bit time.
The general guide is here how to compile a .dll, which is the first thing to do.

Is no one here who can compile one?

That's not so true for everyone. The debug DLLs I tried to compile with VS2003 always crash with some "error_already_set" python error and new even reached main menu.:sad:

:vomit:
They should have given us a instruction how to compile it correctly.
 
Tuple is somehow a "pair" in computer science language.



...er...than it might be a bigger thing, because it needs quite some installations and a bit time.
The general guide is here how to compile a .dll, which is the first thing to do.

Is no one here who can compile one?



:vomit:
They should have given us a instruction how to compile it correctly.

If I send you my mod, might you be able to assess what's wrong?
 
Top Bottom