Quick Modding Questions Thread

The game doesn't use unicode, but raTHER CodePage 1252, aka windows 1252. To make matters worse, there is a bug preventing line 8_ and 9_ to display correctly in signs and city billboards.

Uh... what?

You need to html escape the second half of the characters (8_ and everything below it).

What what what?
 
That golden shiny theme is not unmodded BTS. Most likely it is not loading the CustomXML folder which is why the file cannot be located
That's just Blue Marble, nothing otherwise.
 
The game doesn't use unicode, but rather CodePage 1252, aka windows 1252. To make matters worse, there is a bug preventing line 8_ and 9_ to display correctly in signs and city billboards.

You need to html escape the second half of the characters (8_ and everything below it). To write ã, you need to use the number 227, which you do by typing "& # 227" (without spaces).
Looks like I need to explain it in a different way.

Following the link, you can see which characters can be used. There are 3 groups:

0_ to 7_: those will just work. No need to do anything special about those.

8_ and 9_: try to avoid using those two lines. There is a display bug in signs and city billboards and they will be blank if I remember correctly. The bug can be fixed, but only in DLL.

The rest:
Those will need html escapes to be typed. Say you want to type the character ½. You look it up in the table and it has the number 189. You then write
Code:
& # 189
Once again without spaces. If I remove the spaces, your browser will convert the character. It's not ideal, but it is the way to avoid encoding issues.

Notepad++ has the ability to convert the "selected text" to and from html escapes. This allows you to type normally and then use the plugin to convert to html escapes and the game will be able to read what you have written. I can't remember offhand how to enable the html escape feature, but I think you need to install a plugin.
 
The name "Ngāpuhi" shows up as a city called "Ng?puhi" ingame. The code I used for ā is ā. Can the game simply not handle this, or am I doing something wrong? Diaereses seem to be handled just fine.

It doesn't support 'ā' as Civ4 uses Windows-1252 encoding (sometimes called ANSI, incorrectly) and that doesn't include characters with macrons. The wikipedia article that Nightinggale linked to shows which characters can be used.
 
But there are more characters allowed in Civ4 than those listed. I use this list here.

If I take Leoš Janáček as an example: I can use the small s with a caron by using character number 353. But I can't write the small c with a caron by using the character number 269, it returns a ?, just like in Mouthwash's example.

Result: Leoš Janá?ek.

Edit: I see now that the š is in the Windows-1252 list as 154 in the 9th row.

Looks like these characters were predefined in XML with new numbers:
Spoiler :
Œ U+0152 (338)
œ U+0153 (339)
Š U+0160 (352)
š U+0161 (353)
Ÿ U+0178 (376)
ƒ U+0192 (402)
 
How do I change the position of leaderhead backgrounds? I tried putting Gandhi's background behind Akbar, but it is shifted to the right and up. It also seems distorted somehow... maybe the picture itself is the problem?
 
But there are more characters allowed in Civ4 than those listed. I use this list here.

If I take Leoš Janáček as an example: I can use the small s with a caron by using character number 353. But I can't write the small c with a caron by using the character number 269, it returns a ?, just like in Mouthwash's example.

Result: Leoš Janá?ek.

So then how do I do the ā?
 
Still, you can't do it.
 
I made Keshiks ignore city defenses from buildings, and confirmed that it worked ingame. Still, nothing shows up in the description. How do I manually edit to make it say "ignores city defenses" along with all the Keshik's other abilities?
 
Similar to what I said earlier about buildings: you can insert an help tag in-between the "Strategy" and "Advisor" ones.

<Help>TXT_KEY_UNIT_KESHIK_HELP</Help>

or simply

<Help>Keshiks ignore city defenses from buildings</Help>
 
Similar to what I said earlier about buildings: you can insert an help tag in-between the "Strategy" and "Advisor" ones.

<Help>TXT_KEY_UNIT_KESHIK_HELP</Help>

or

<Help>Keshiks ignore city defenses from buildings</Help>

No, I want it under "special abilities," not the Civilopedia entry.
 
It appears in the tool tips - when you check what to build/train and when you mouse over the unit - plus in the Civilopedia under "special abilities" - what do you want more?!
 
I have two questions:
1) I have idea to make small mod comp Destabilization, idea:
If game option destabilization is set, next things will happen. If enemy capture your capital city this will cause destabilization in your empire, this will check all your cities and give them 25% chance (for each city, not for all your cities) to rebel and join to barbarians with all your units in cities and around cities (only for rebels cities). This would not to be problem, in SDK add new game option because i want to this be like game option and in python do this with rebelion.
BUT...
I will like to add this to some another civilization, something like another barbarians (similar like demons and animals civilizations from FFH2, there you have 3 kinds of barbarians in game).
With dll for 50 regular players + 1 barbarian = 51 total players, i will want to have 50 regular player + 3 barbarian players = 53 total players (If this is possible). One more thing this new Barbarians(i will call them ALIENS and INDEPENDENTS) will not spawn like regular barbarian, they will spawn throw some special events, like capturing capitals in destabilization your empire will split and some of your cities will join to INDEPENDENTS, if your neighbor lose capital too their cities will also join to INDEPENDENTS. One more thing INDEPENDENTS, ALIENS and BARBARIANS are in war with all players and in war between each other, and there is no DIPLOMACY with them, they are all some kinds of barbarians. How to add INDEPENDENTS and ALIENS ? Some idea ? Maybe to use code from FFH2 ?
2) This question is more personal and has nothing to do with civilization, maybe is here wrong place to ask this but i know there are lots of programmers here. How many threads you can create in C# and in JAVA ? I want to make some little real time strategic game with constant war and massive units build-up, this more like demo or prototype, and i want to add one thread per unit, if i build 8000 units and enemy build 12000 units that will be about 20000 units, and there is 20000 threads. Is this good idea to add one thread per unit, of course if unit die, thread die too.
 
Uh, I still have that problem on the previous page that I can't get solved.

Someone help me, please?
 
2) This question is more personal and has nothing to do with civilization, maybe is here wrong place to ask this but i know there are lots of programmers here. How many threads you can create in C# and in JAVA ? I want to make some little real time strategic game with constant war and massive units build-up, this more like demo or prototype, and i want to add one thread per unit, if i build 8000 units and enemy build 12000 units that will be about 20000 units, and there is 20000 threads. Is this good idea to add one thread per unit, of course if unit die, thread die too.

Short answer - don't even consider using this approach ... really, just put it totally out of your mind.

Slightly longer answer - There are lots of reasons why this is a non starter, but some obvious comments would be:

1 - You are confusing objects with threads. An object represents a unique instance of a 'thing'; a unit is an example of a thing. A thread is an independent thread of execution, i.e. it doesn't care about any other threads (until you start synchonising or other means of inter-thread interaction) so if you applied this to units it would mean that units would be independent of each other; in a game the whole point is usually to have units interact (avoid, fight, etc)

2 - Threads use system resources so your app would be a resource hog

3 - Having 20,000 units in a game would not be considered small unless you were aggregating them, but your comment about having a thread each indicates that this is not the case.

4 - If you want a prototype limit yourself to a much smaller number. A prototype probably wouldn't need more than 100 units.

My advice would be to do some research on programming and the differences between objects and threads as you obviously appear to have no formal programming experience. Apologies if this sounds harsh, but before you start to embark on a one way trip to programming hell I suggest you reign in your ambitions and try something smaller and more manageable.

If you are going to use either Java or C# I would recommend that you look up some of the many resources on the web to get a grounding in the languages and the basic concepts first ... threading is an advanced topic and I would stay well clear of it in your first programming attempts. I sincerely wish you well in starting programming, but suggest you try walking before you run ;)
 
Uh, I still have that problem on the previous page that I can't get solved.

Someone help me, please?
It has been explained fairly well how to do it and I'm not sure anybody can write anything to help you anymore than what has already been written. The only solution I can think of is you uploading your entire mod and then somebody else figures out how you messed up.

With dll for 50 regular players + 1 barbarian = 51 total players, i will want to have 50 regular player + 3 barbarian players = 53 total players (If this is possible). One more thing this new Barbarians(i will call them ALIENS and INDEPENDENTS) will not spawn like regular barbarian, they will spawn throw some special events, like capturing capitals in destabilization your empire will split and some of your cities will join to INDEPENDENTS, if your neighbor lose capital too their cities will also join to INDEPENDENTS. One more thing INDEPENDENTS, ALIENS and BARBARIANS are in war with all players and in war between each other, and there is no DIPLOMACY with them, they are all some kinds of barbarians. How to add INDEPENDENTS and ALIENS ? Some idea ? Maybe to use code from FFH2 ?
You change MAX_PLAYERS in the dll (it's a define in a header. CvDefines.h or something). In theory the max is 64, but it seems that the actual max is a bit lower than that. Search around for the limit for MAX_PLAYERS. There is one you can set with a single line change and some people claim there is an even higher limit if you mod multiple lines.

The ideal solution would be to have one barbarian for each city as that would create complete anarchy with everybody attacking everybody, like the civil war in China 1800 years ago (the romance of the 3 kingdom event). However that would be quite advanced, if not impossible to implement.

I'm not sure what it takes to make a civ into a barbarian. Somebody else will hopefully know more on this topic.

threading is an advanced topic and I would stay well clear of it in your first programming attempts.
I generally have bad experience with threading. A thread can only use one CPU core, which mean the normal single threaded program like the civ4 DLL will only use one. To use all cores in a modern CPU, you will have to use multiple threads. However the threads runs in parallel and you have to keep them in sync and this thread control have a tendency to make multi threaded applications slower than if all were done in a single thread with no overhead. The exception is when you really know what you are doing.

My experience tells me that using one thread for each CPU core have a strange tendency to spend around the same time as the singlethreaded approach. I tried handling CvPlot::doTurn() in 8 threads and I cut 0.4 seconds away from a 60 second next turn delay and I made bug hunting much harder in the process. This example is surprisingly ideal because I managed to use all shared memory as read only, hence minimal overhead, but the OS level overhead still killed the gain. I even used ThreadPool 0.2.3 (newest compatible with boost from civ4) to minimize overhead when moving on to the next plot. I think I had to compile the thread boost dll before I could use it, which in itself is quite tricky.

I agree with Archid. Threads is for people who know what they are doing. I would say kind of the same about making a game from scratch. Modding is fairly easy (relatively speaking) because somebody wrote the game engine for you. If you make your own game, you need to handle all the code where you draw on the screen and stuff. If you really want to make your own game, start by looking for an engine you can use. You can even find some, which are free for non-commercial use. Even with an engine, making a game from scratch sounds.... tricky for somebody who doesn't know the difference between an object and a thread.
 
Just set them as minor civs. Minor civs behave like barbs, at war with all and no diplomacy, but are not barbs.
 
It has been explained fairly well how to do it and I'm not sure anybody can write anything to help you anymore than what has already been written. The only solution I can think of is you uploading your entire mod and then somebody else figures out how you messed up.
IT'S THE UNMODIFIED VERSION! I repeat: the gold shiny hud is because of Blue Marble, which, as far as I'm aware of, modifies no XML or python.

I can't even get it to work by placing the mod straight into my mod folder. I repeat tjhat I'm not the one to blame, because a mod should be working by placing it in the mod folder. And it doesn't work, try to download the mod yourself so you can confirm that it doesn't work or does work.
 
Well, unfortunately I have to contradict you in that it is not the mod to blame, but something you have done as I have just taken it out of the box and it works as advertised.

When the guantlet is thrown down an idiot shall arise, that idiot is me!

Germany and France are now at permanent war... The end of stinky cheese and large sausage is nie... God Help Us All!!!

Chances are you need to put it in the xml folder of your mod, not a customxml folder, and change the appropriate file paths as if you are running blue marble then it is not an unmodified state.

You are either running a mod with blue marble, or have changed the base structure of the game...(Never a good idea!)

if that is still not right, then you will need to start a thread and show your working, because you are clearly doing something that is incorrect, but no one can know what that is unless you show exactly what you are doing, then maybe someone will spot the error that you are making.
 
How do I make a civic give +25 production for all buildings, irregardless of religion?
 
Back
Top Bottom