Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Call To Power II > CtP2-Creation/AI/Mods/Scenarios > Help with Unit.txt
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:22
  Old Post 23-09-2004 22:33 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Help with Unit.txt Enter the AD-FREE zone

I'm sure these questions have been asked before but I didnt see it in the mod resources. A lot of these came from Martin's flaglist, but it doesnt have much details. Can anyone explain what these unit fuctions do or where to find info on them?


IsTrader
NeedsNoSupport
AssistedDrops
SettlerSlaveRaids
CreateParks
CanInjoin
IsSpecialForces
NotAffectedByLandMines
BonusFood
CanRustle
GovernmentType
CreateRift
CanCloak
TransformPartial

SettleBuilding - does this build time imp? and can you do it AI civs

ShieldHunger - does this mean we can make it cost shields per turn?
FoodHunger - does this mean we can make it cost food per turn?


BRange - IS this bombard Range? Doe sthis mean we can do ranged artillery bombardment like civ3?

CantMove - Is this like the immobile flag Solver was working on? can it still attack?


thanks

Maquiladora is offline Maquiladora
Emperor

Jun 2001
time: 05:22
  Old Post 24-09-2004 00:08 Visit Maquiladora's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Enter the AD-FREE zone

Ill just answer the ones im sure of.

quote:
IsTrader


Used for Caravans and Freights. This basically adds them to the available trade caravan count once theyre built i think. I think the move points for these units specified how many are added to the count, freight has 3 movement so 3 added to the available trade pool. That part is a guess though, i havent tested it.

quote:
NeedsNoSupport


Well its just used for cities.

quote:
CreateParks


This is used to specify which units can use the nanite cleansing attack on a city, which destroys the whole city. Only the eco-ranger has it in the unmodded game.

quote:
CanInjoin


This is used for units that can file injunctions (stop production for 1 turn), only the lawyer can do it in the unmodded game.

quote:
IsSpecialForces


Its used for special forces units, Samurai, Knights, Marines etc, when you lower military readiness the special forces units stay "at war" and cost full support all the time. If its used under other units like stealth etc then its so they always take full support cost all the time too.

quote:
GovernmentType


This says which government the unit can only be built under. Fascist under Fascism, Televangelist under Theocracy etc.

quote:
SettleBuilding - does this build time imp? and can you do it AI civs


This just allows when you use that unit with this flag (only the urban planner has it in unmodded game) when they found a new city the specified building is auto-built in that city.

code:
SettleBuilding IMPROVE_ACADEMY SettleBuilding IMPROVE_COURTHOUSE SettleBuilding IMPROVE_GRANARY SettleBuilding IMPROVE_SHRINE SettleBuilding IMPROVE_THEATER


quote:
ShieldHunger - does this mean we can make it cost shields per turn?


Yeah it does.

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:22
  Old Post 24-09-2004 04:31 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Re: Help with Unit.txt Inflate your Upload Space

A lot of the unused ones are hangovers from C:CtP, and probably don't work, if indeed they ever did.

quote:
AssistedDrops

Used by the Swarm unit in C:CtP. Offhand I can't think of any ability that was unique to the Swarm that would count as an Assisted Drop. Although it presumably relates to the space layer and is now redundant.

quote:
SettlerSlaveRaids

CtP2 flag that lets a slaver pick off unescorted settlers.

quote:
NotAffectedByLandMines

Somewhere in the early stages of C:CtP's programming they apparently toyed with the idea of landmines. Presumably they'd work in the same way as the Cow unit did, except with explosions rather than food. I would *guess* that the unaffected unit(s) would the Sweeper unit (unused sprite #37 in CtP1) and maybe some future-age tanks or something. Either way, the whole lot got scrapped, presumably since landmines were too easy to exploit, or too hard to program the AI around.

quote:

BonusFood
CanRustle

Cow-unit hangers-on from C:CtP. The intention being that cow units in a city radius would provide the city's food, and the rustler unit would come along and snaffle them, much in the same way a slaver would take a settler, although hypothetically the cow unit would just switch to the rustler's civ's ownership rather than being disbanded. This concept was also scrapped, probably due to similar reasons as the landmines.

quote:
CreateRift

The C:CtP DEFAULT_SPRITE for a city is apparently a RIFT_GATE in units.txt, but of course this is superceded by the citysprite.txt so isn't used. There may be other references elsewhere, I forget. Either it's something to do with the wormhole probe victory, or another scrapped concept with space teleportation or something. We still don't know what the unit in Martin's avatar was meant to do/be. (Note the game one has blue stripes not red)

quote:
CanCloak

The "Phantom" spaceship in C:CtP could cloak- basically it became a stealth unit, but could still attack. I can't remember how it affected zones of control (if at all). Doubt if it works in CtP2.

quote:
TransformPartial

Appears to be completely unused. No idea.

quote:

ShieldHunger
FoodHunger

SheildHunger is the flag the game uses to calculate upkeep as far as I know. The FoodHunger flag is pretty hard to test, but I don't think anyone has had any success making it work.

quote:

BRange - IS this bombard Range? Doe sthis mean we can do ranged artillery bombardment like civ3?

Unfortunately not.

quote:

CantMove - Is this like the immobile flag Solver was working on? can it still attack?

I'm pretty sure Locutus tried this while making the militia code without success. It would be pretty cool to have a working one though.

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:22
  Old Post 24-09-2004 04:54 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Inflate your Upload Space

Thanks IM and Maq

Just hope maybe some coders get them worker and maybe add some new ones...

another question though
quote:
"CanCloak

The "Phantom" spaceship in C:CtP could cloak- basically it became a stealth unit, but could still attack. I can't remember how it affected zones of control (if at all). Doubt if it works in CtP2."

I guess that means a spy unit with an attack value cant attack. I'd test if I had my computer, but I thought somewhere that it could and you wouldnt know who did it.

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:22
  Old Post 24-09-2004 05:01 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Remove this text

I think it's the IsCivilian flag that prevents attacking (though the CantCaptureCity flag is probably a good one to disable as well if you want it to be a stealthy military unit). If you're attacked by a stealthy unit (EcoWarriors for example have attack values and stealth), it will show up anyway in the battle view, surely? I don't know what would happen if it attacked in a situation where the battle view was off.

BureauBert is offline BureauBert
Chieftain
Vienna, Europe
Apr 2003
time: 06:22
  Old Post 24-09-2004 18:27 Visit BureauBert's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Increase the size of your Attachments

Here is some information we have in the "Modding Knowledgebase" until now. It's incomplete - please feel free to improve the information by adding your comments:
IsTrader
NeedsNoSupport
IsSpecialForces
BonusFood
GovernmentType
CreateRiftOrder
ShieldHunger
FoodHunger
IsCivilian

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:22
Post  Old Post 24-09-2004 20:46 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Re: Help with Unit.txt Full PM-box? Change here!

quote:
Originally posted by E
BonusFood


It is from the CTP1 cow unit, in CTP1 the cow gave a food bonus of five to the underlying terrain.

quote:
Originally posted by E
CanRustle


Whether this unit can steal foreign cows. Probably doesn't work in CTP2 and in CTP1 either

quote:
Originally posted by E
CreateRift


Probably the ability of a unit to turn a oiece of land into a rift. But is probably unimplemented as well.

quote:
Originally posted by E
ShieldHunger - does this mean we can make it cost shields per turn?


The production support costs for this unit per turn.

quote:
Originally posted by E
FoodHunger - does this mean we can make it cost food per turn?


Probably the same but for food, possibly unimplemented.

quote:
Originally posted by E
BRange - IS this bombard Range? Doe sthis mean we can do ranged artillery bombardment like civ3?


Maybe this is the purpose, but I doubt that this is implemented.

-Martin

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:22
  Old Post 25-09-2004 05:13 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

quote:
Originally posted by Immortal Wombat
SheildHunger is the flag the game uses to calculate upkeep as far as I know. The FoodHunger flag is pretty hard to test, but I don't think anyone has had any success making it work.


FoodHunger is never used in the source, so I think it's safe to assume it does nothing.

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:22
  Old Post 27-09-2004 21:45 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Support Apolyton or Terrorists Win

has anyone looked in the code for these abilities? are there any more there than can be fixed/finished?

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:22
  Old Post 28-09-2004 00:31 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Avatar Enlargement: We've got the solution

Well, in theory, of course, all of them can be made to do something. I have looked at a couple and seen no half-finished chunks of code or anything like that, but there might well be in some.

I'm happy to go investigating some in particular if there are any you're especially curious about, but investigating the whole list seems a little daunting .

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:22
  Old Post 28-09-2004 00:56 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Thanks J,

Actually I'm just curious about a few "maybe simple" things like:

making hungerfood work

seeing if its possible to copy/edit hungershield into a hungergood function

looking at the settlecity code and see if it can be made into a settleimprov code so a unit when it settles builds a specified improvement

So most are seeing if original code can be copied and then modified to do a few new things


For an original one I was wonering if there is a way to take the POW SLIC used in conquests that creates captured units and make it into a unit function but with a 33% or 50% chance of success and the possibility of typing after the function POW in unit.txt what kind of unit is created i.e.
POW Unit_Fascist so 33% or 50% of the time when this unit wins a battle it would create a fascist. the other option would be that when POW is not followed by a specified unit, then it just changes the ownership of the unit captured i.e.
POW
If an infantry captures another infantry it stays an infantry instead of becoming a facsist or something.

Hope that doesnt blow you away J. I've been goin through SLIC but I'm no programmer but if I think I see the unit files in:

ctp2_code\gs\gameobj

But I couldnt make sense out of it. But I did see the "include" part in the beginning and I'm also wonder if we include tileimp and wonder files then we might be able to apply abilities/functions associated with tile imps and wonders to units?

thanks

Last edited by E on 28-09-2004 at 03:26

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:22
  Old Post 30-09-2004 01:13 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Put an end to popups!

quote:
Originally posted by E
Actually I'm just curious about a few "maybe simple" things like:

making hungerfood work

seeing if its possible to copy/edit hungershield into a hungergood function


It wouldn't be as simple as that, no. Although FoodHunger shouldn't be so hard to implement as ShieldHunger, it's surprisingly different, and it would have to be pretty much written from scratch. I might have a go, if I feel in the mood to, but no promises .

quote:
looking at the settlecity code and see if it can be made into a settleimprov code so a unit when it settles builds a specified improvement


You mean tile improvements? I'm not really sure how that would work. Do you mean improvements on the city square or around it? If the latter, how would you decide where to put them, and which ones to use?

quote:
For an original one I was wonering if there is a way to take the POW SLIC used in conquests that creates captured units and make it into a unit function but with a 33% or 50% chance of success and the possibility of typing after the function POW in unit.txt what kind of unit is created i.e.
POW Unit_Fascist so 33% or 50% of the time when this unit wins a battle it would create a fascist. the other option would be that when POW is not followed by a specified unit, then it just changes the ownership of the unit captured i.e.
POW
If an infantry captures another infantry it stays an infantry instead of becoming a facsist or something.


Is there anything in particular wrong with the existing SLIC, or are you just wanting it to go a little bit faster, or be easier to implement?

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:22
  Old Post 06-10-2004 01:07 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

rfom gs/readiness.cpp

code:
void MilitaryReadiness::SupportUnit(const Unit &u, sint32 gov) { double unitCost = GetSupportCost(u); m_cost += unitCost; g_network.Block(m_owner); ENQUEUE(); g_network.Unblock(m_owner); } double MilitaryReadiness::GetSupportCost(const Unit &u) { if(u.GetIsProfessional()) return 0; if(u.GetNeedsNoSupport()) return 0; double unitCost; if(u.GetDBRec()->GetIsSpecialForces()) { unitCost = u.GetShieldHunger() * GetSpecialForcesSupportModifier(g_player[m_owner]->GetGovernmentType()); } else { unitCost = u.GetShieldHunger() * GetSupportModifier(g_player[m_owner]->GetGovernmentType()); } unitCost -= unitCost * double((double)wonderutil_GetReadinessCostReduct ion( g_player[m_owner]->GetBuiltWonders()) / 100.0); unitCost *= g_theGovernmentDB->Get(g_player[m_owner]->m_government_type)->GetSupportCoef(); return unitCost;


other instances of shield hunger are in unit.cpp and unit.h but nothing other than this.
I wonder if its just looking for the flag and value after it?

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:22
  Old Post 06-10-2004 04:16 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton, buy Civilization 2

quote:
Originally posted by E
I wonder if its just looking for the flag and value after it?


Sorry, I don't understand you...

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:22
  Old Post 06-10-2004 04:32 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Tired of ads?

It looks like this code looks to see if a unit has the hungershield flag and then looks for the value after it and then subtracts that value from the players PW.

So it looks like that in order to fix hungerfood or add hungergold, we'd have to create the flag and then look for the number value after the flag...

Also the unit support code I listed previously doesnt mention hungerfood which may be why the flag appears unimplemented

code:
sint32 Unit::GetShieldHunger() const { return GetDBRec()->GetShieldHunger(); } sint32 Unit::GetFoodHunger() const { return GetDBRec()->GetFoodHunger();



I may have to start a new thread on re-implementing it in the source code area

Last edited by E on 06-10-2004 at 05:10

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:22
  Old Post 06-10-2004 15:51 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Inflate your Upload Space

Is there an empire-wide food variable? I thought it was city based. If so, where would you deduct the food from?

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:22
  Old Post 06-10-2004 17:22 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

quote:
Originally posted by Immortal Wombat
Is there an empire-wide food variable? I thought it was city based. If so, where would you deduct the food from?


There is no such variable. That's why I said it would be a big job - you'd have to comprehensively rework the way food is handled.

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:22
  Old Post 07-10-2004 01:12 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

Would it be coprehensive to have the system look for the city with the highest excess food first and subrtract from it until it was no longer then subtract from the next highest one.

Basically a function that checks for the city with highest bonus, subtracts, checks again, subtracts, etc until either all are supplied or there is no bonus food left...

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:22
Post  Old Post 07-10-2004 01:30 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#19 Report this post to a moderator
Put an end to popups!

quote:
Originally posted by E
Would it be coprehensive to have the system look for the city with the highest excess food first and subrtract from it until it was no longer then subtract from the next highest one.

Basically a function that checks for the city with highest bonus, subtracts, checks again, subtracts, etc until either all are supplied or there is no bonus food left...


This system reminds me of Civ2, a city based instead of a empire wide based system, however maybe that could achieved over the food coefficent from the government stuff, or somewhere a function that calls us how many food must be deducted from each city.

Something like:

Needed food by units / number of cities and then substract it from all cities.

-Martin

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:22
  Old Post 07-10-2004 02:08 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#20 Report this post to a moderator
Support Apolyton

i think I like that idea for food better Martin. I think this highlights a bigger issue with food though, that there is no distribution system that models a real world situation. Like egypt was rome's bread basket and Rome grew based on food imports, likewise with the midwest. I guess a future issue, probably in governor.cpp, would be able to shift food (maybe also with the trade route system)

As for gold, its managed empire-wide so it shouldnt be as hard to implement right?


I think I hould open this up in a new thread, in the source code...

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:22.
Apolyton Time is 00:22.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0520 seconds (92.51% PHP - 7.49% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net