View Full Version : Chuck Norris (World Unit?)


Robo Magic Man
Feb 25, 2006, 01:22 PM
Is there a way to make a unit a World Unit, as opposed to a National Unit, so that there can only be one? I need this for a Chuck Norris unit, and I've finished everything for the mod except making sure that there can't be 30 Chuck Norrises of different nationalities running all over the world (Madness!:eek:) Please help.

TheLopez
Feb 25, 2006, 02:01 PM
Well, one way is to save the id of the unit using pickle, when someone tries to create another of the same unit you can check to see if the value has been previously set or not. I have been using pickle through the SD-Toolkit, it has been working pretty good for me.

anjf
Feb 25, 2006, 02:07 PM
It is possible, the same concept is use in the Fall from Heaven mod by keal. Perhapse you should ask him how he did that.

Hardner
Feb 25, 2006, 02:13 PM
:rotfl: :rotfl: :rotfl: :rotfl: :rotfl:
CHUCK NORRIS!!!!!!!!!!!
Great!!!
Strenght: 1000!?!?!?!?!?!
For some reference:
www.chucknorrisfacts.com

RogerBacon
Feb 25, 2006, 02:30 PM
:rotfl: :rotfl: :rotfl: :rotfl: :rotfl:
CHUCK NORRIS!!!!!!!!!!!
Great!!!
Strenght: 1000!?!?!?!?!?!
For some reference:
www.chucknorrisfacts.com

Yeah but you'd have to take a pretty big culture hit. Have you seen his movies?

Roger Bacon

Hardner
Feb 25, 2006, 02:34 PM
Yeah but you'd have to take a pretty big culture hit. Have you seen his movies?

Roger Bacon

right, but..oh no, now he's surely coming for you with a roundhouse...:lol:

Wei-Yan
Feb 25, 2006, 03:11 PM
:rotfl: :rotfl: :rotfl: :rotfl: :rotfl: :rotfl: right, but..oh no, now he's surely coming for you with a roundhouse...:lol:
Chuck Noriss chief export is pain:lol:

Rabbit, White
Feb 25, 2006, 06:32 PM
Is there a way to make a unit a World Unit, as opposed to a National Unit, so that there can only be one? I need this for a Chuck Norris unit, and I've finished everything for the mod except making sure that there can't be 30 Chuck Norrises of different nationalities running all over the world (Madness!:eek:) Please help.
Some would say that one Chuck Norris is already too much :p

TheBladeRoden
Feb 25, 2006, 07:36 PM
When Chuck Norris brushes his hair it causes blizzards on the east coast.

Shqype
Feb 25, 2006, 08:03 PM
Python is definitely not needed, all you need is XML!
In CIV4UnitClassInfos.xml:
<UnitClassInfo>
<Type>UNITCLASS_BUDDHIST_MISSIONARY</Type>
<Description>TXT_KEY_UNIT_BUDDHIST_MISSIONARY</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>3</iMaxPlayerInstances>
<DefaultUnit>UNIT_BUDDHIST_MISSIONARY</DefaultUnit>
</UnitClassInfo>

Make a new entry for the Chuck Norris unitclass and the Chuck Norris unit. Set iMaxGlobalInstances to 1. Keeping it on -1 means an unlimited amount. Set the other 2 tags to -1, and the max global instances will override them. Once there is 1 Chuck Norris, there is ONLY 1 Chuck Norris!

Also, be careful that this unit is not available WITHOUT any resources or technologies, just like the warrior. If it is, then it will be available as the starting unit to only 1 player upon starting a new game, since the game gives the player 1 free military unit (best one available) once the game begins.

Big_Ben
Feb 25, 2006, 08:16 PM
You could also make a world wonder "The Texas Rangers" and it gives you a free unit, Chuck Norris.

Kael
Feb 25, 2006, 08:55 PM
In the CIV4UnitClassInfos.xml you can declare these values:


<UnitClassInfo>
<Type>UNITCLASS_CONJURER</Type>
<Description>TXT_KEY_UNIT_CONJURER</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<DefaultUnit>UNIT_CONJURER</DefaultUnit>
</UnitClassInfo>


The above unit isn't limited.


<UnitClassInfo>
<Type>UNITCLASS_CONJURER</Type>
<Description>TXT_KEY_UNIT_CONJURER</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>3</iMaxPlayerInstances>
<DefaultUnit>UNIT_CONJURER</DefaultUnit>
</UnitClassInfo>


The above unit is limited to 3 for each player.


<UnitClassInfo>
<Type>UNITCLASS_CONJURER</Type>
<Description>TXT_KEY_UNIT_CONJURER</Description>
<iMaxGlobalInstances>1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<DefaultUnit>UNIT_CONJURER</DefaultUnit>
</UnitClassInfo>


The above unit is limited to 1 in the game (a world unit).

Shqype
Feb 25, 2006, 08:59 PM
I thought I explained that :p Thanks for the hands-on approach :)

Kael
Feb 25, 2006, 10:33 PM
I thought I explained that :p Thanks for the hands-on approach :)

Yeah, no worries. He had PM'ed me the question too, and I saw that before I saw this thread so I just copied my responce here. It is pretty much redundant with yours.

Shqype
Feb 25, 2006, 10:46 PM
I like you Kael, you're a nice guy and always try to help people out. Thanks for your in-depth response (and for what you've helped me out with as well). :)

BFD8656
Feb 26, 2006, 12:26 PM
So once this Chuck Norris is made will you make it avaliable for download? I am afraid to even play the game now with out it for because Mr. Norris might roundhouse me. You know Chuck Norris' tears cure cancer. . . too bad he never cries!

AndyTerry
Feb 26, 2006, 12:38 PM
Idea is great :lol: :lol: :lol:

Robo Magic Man
Feb 26, 2006, 07:06 PM
Ok, thanks for the help everyone. The mod is now posted here (http://forums.civfanatics.com/showthread.php?t=160988)

Hardner
Feb 26, 2006, 07:25 PM
looks awesome!! just needs another unit icon, i think you can put a chuck pic in there. 50Strenght, enough?