Snipers????????

Aranor

Emperor
Joined
Nov 28, 2005
Messages
1,007
Location
Australia
Is it just me or does any body else love infantry?? I dont know but i do find something intensely satisfying when my pbi attacks a cavalry unit or even better some modern armor and wins :D To this effect I am trying to mod in a new unit for the game, the sniper. I have already figured out most of how the unit should work with xml and gimp (I suck at art work so it isnt as good as I'd like :cry: ) but now ive hit a wall and need some assistance from more expeirenced modders such as you guy and girls out there in civland :p im trying to make the unit a national unit and restrict it to only 3 units to be able to be built. Ive searched the xml files endlessly and have yet to find any clue as to how to do this. can any one help me???????? :confused: View attachment sniper.bmp Also here is my basic artwork, any critisism or assistance in improving it would be much apreciated
 
In CIV4UnitClassInfos.xml

<UnitClassInfo>
<Type>UNITCLASS_CHRISTIAN_MISSIONARY</Type>
<Description>TXT_KEY_UNIT_CHRISTIAN_MISSIONARY</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>3</iMaxPlayerInstances>
<DefaultUnit>UNIT_CHRISTIAN_MISSIONARY</DefaultUnit>
</UnitClassInfo>

So for you it would be:

<UnitClassInfo>
<Type>UNITCLASS_SNIPER</Type>
<Description>TXT_KEY_UNIT_SNIPER</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>3</iMaxPlayerInstances>
<DefaultUnit>UNIT_SNIPER</DefaultUnit>
</UnitClassInfo>

MaxPlayerInstances means each player can have a maximum of x of that type of unit.

MaxTeamInstances means if you play a game with a team , only x amount of units can exist within the team.

MaxGlobalInstances means only x amount of units can exist in the game , regardless of who owns them. This could be useful for something like a "man with the golden gun" scenario.

For all numbers above 0, that is the limit. If the value is set to -1 , that means there is no limit as to how many can be built.
 
Excellent thanks for that shqype:D now for another question, one i have only just stummbled over. How do i get my units to be invisible and only be seen by other units of the same type?? Ive tried the method for submarines. It works but the units can be spotted by subs and other sub hunting units, not exactly what i want :( any ideas on how to fix this anyone.
 
Unforuntately the only thing I can think of without looking at the code is the "Invisible" tag option that units have. Units that are themselves invisible and can see other invisible units (such as the spy) will still be able to see your UU , however.

But is that so bad?
 
tryed it, but didnt work. (Was the first option I tried)

This is specifically the lines of code Im talking about:
<Invisible>INVISIBLE_SUBMARINE</Invisible>
<SeeInvisible>INVISIBLE_SUBMARINE</SeeInvisible>

The insvisible_submarine are exactly the lines of text I want to edit but have not found any other reference to this in all the xml. When I changed these to Invisible_Sniper the game crashed, so it leads me to beleive that there is a section of code devoted to this, I just cant find it. Or maybe it in python:confused: if so Im screwed because I have no idea what Im doing when it comes to this :cry:
 
CIV4BasicInfos.xml
<InvisibleInfos>
<InvisibleInfo>
<Type>INVISIBLE_SUBMARINE</Type>
<Description>TXT_KEY_INVISIBLE_SUBMARINE</Description>
</InvisibleInfo>
</InvisibleInfos>

So just create a new reference definition:
<InvisibleInfos>
<InvisibleInfo>
<Type>INVISIBLE_SNIPER</Type>
<Description>TXT_KEY_INVISIBLE_SNIPER</Description>
</InvisibleInfo>
</InvisibleInfos>

CIV4GameTextInfos_Objects.xml
<TEXT>
<Tag>TXT_KEY_INVISIBLE_SUBMARINE</Tag>
<English>Submarines</English>
...
</TEXT>

So change this to:
<TEXT>
<Tag>TXT_KEY_INVISIBLE_SNIPER</Tag>
<English>Snipers</English>
...
</TEXT>

And you should be all set!
 
I'm glad to help people out. Does it work now?
 
How does your sniper function?

Intrigued !!
 
basically he is a scout during peace time, very handy as u can place him right next to a target city;) then when u declare war he acts as a infantry extreminator. He cannot capture cities though so you need to back him up quickly with support troops. Also if other snipers are in the area you need to becareful as they can see eachother and hunt one and other down. Specs are as follows:
Recon Units
Strength : 25
Movement : 1
Cost : 300
Requires:
Assembly Line and Rifling
National Unit : 3 allowed
Invisible to most units
can see snipers
cannot capture cities
can explore rival territory
2-3 first strikes
No Defensive Bonus
+75 against Gunpower Units

While it may seem abit overpowered the fact that you can only deploy 3 at a time ensures that snipers can win the war before it has begun :p That said if its depoyed correctly in a critical city it can turn the tide very quickly!! Im currently tinkering with the idea of a earlier unit to upgrade to the sniper called the Sharpshooter using a modified Redcoat skin, let me know what you all think :D
 
Give the sniper only 1 first strike, make sure it recieves defensive bonuses (a good sniper knows how to blend into his surroundings and use them to his advantage), and give +50% vs. gunpowder units.

That should help balance it out a bit.
 
Shqype said:
Give the sniper only 1 first strike, make sure it recieves defensive bonuses (a good sniper knows how to blend into his surroundings and use them to his advantage), and give +50% vs. gunpowder units.

That should help balance it out a bit.

Ill give it a go. The reason why he has no defensive bonus is, that sinpers are lousy defenders. The invisibility trait is their greatest defense. This is what I was hopeing to achieve with the no defnsive bonus. ( kind of force players to have to think about how to protect their asset) Ill make the other changes;)
 
Lets make it a real sniping unit, what I did in Civ 3 with cboy sniper unit was gave it a bombard ability with a range of one.

If any one figures out how to implement the old bombard back into Civ4, that could be an idea.
 
CrazyAce said:
Lets make it a real sniping unit, what I did in Civ 3 with cboy sniper unit was gave it a bombard ability with a range of one.

If any one figures out how to implement the old bombard back into Civ4, that could be an idea.
yea i really want him to be able to hit from range but as yet i have no idea how to acheive this :cry:
 
Back
Top Bottom