Thread Tools
Old July 29, 2002, 19:31   #1
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 06:09
Local Date: November 1, 2010
Join Date: Jun 2001
Posts: 7,665
Unit Updater Questions
Is there any way to make upgrading your own units selective? Rather than just at the point of the obsolete advance. For example, moving the old unit onto a city with a certain building and upgrading it ala Civ3.

And, is there a limit to how many upgrades you can script? Or more directly, does it slow down anything to have saaay 27 different upgrades?
Maquiladora is offline  
Old July 30, 2002, 07:18   #2
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 06:09
Local Date: November 1, 2010
Join Date: Jun 2001
Posts: 7,665
I noticed in Cradle, that has about 36 unit ungrades so im guessing speed isnt a problem.
__________________
Call to Power 2: Apolyton Edition - download the latest version (7th June 2010)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Maquiladora is offline  
Old July 30, 2002, 10:44   #3
centrifuge
Call to Power PBEMCall to Power II MultiplayerCTP2 Source Code Project
Prince
 
centrifuge's Avatar
 
Local Time: 22:09
Local Date: October 31, 2010
Join Date: Apr 2002
Location: USA
Posts: 916
I remember talk about this, a few months ago. I'm all for this idea as well, the requirement of a "barracks" some gold and PW, sounds good to me. The problem is if the AI can do it. IIRC, (correct me if I'm wrong) the AI in Civ3 doesn't use it. Perhaps it wouldn't be that big of deal as long as the AI keeps pumping out units on a regular basis.
centrifuge is offline  
Old July 30, 2002, 11:13   #4
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:09
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
In the code the AI automaticly have all of its units upgraded. so the AI isnt a problem.
I think the problem is how to trigger the code. The code now is triggered when you get an advance.
You idea from civ3 seems a nice one.
Anyway, Peter Triggs is a better person to talk about it.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old July 30, 2002, 11:52   #5
HuangShang
Call to Power II Democracy GameCTP2 Source Code Project
King
 
HuangShang's Avatar
 
Local Time: 22:09
Local Date: October 31, 2010
Join Date: Jul 2002
Location: Berkeley
Posts: 1,375
i like the idea too
HuangShang is offline  
Old July 30, 2002, 12:14   #6
centrifuge
Call to Power PBEMCall to Power II MultiplayerCTP2 Source Code Project
Prince
 
centrifuge's Avatar
 
Local Time: 22:09
Local Date: October 31, 2010
Join Date: Apr 2002
Location: USA
Posts: 916
Quote:
Originally posted by Pedrunn
In the code the AI automaticly have all of its units upgraded. so the AI isnt a problem.
I think the problem is how to trigger the code. The code now is triggered when you get an advance.
You idea from civ3 seems a nice one.
Anyway, Peter Triggs is a better person to talk about it.
I think that triggering it roughly same way would work fine from a game play aspect. The current code, only allows an upgrade once, after the initial advance is discovered. I'm SLIC handicapped, but it seems that it should be possible to offer the option of upgrade anytime that an advance is discovered. This won't allow for an upgrade on demand, as in Civ3, but will allow for more upgrades than are currently available.

An alterrnate route is to offer it every third turn (for example) and have the requirement of having a unit in a city with an improvement that is there strictly for the purpose of upgrading. Hey here's an idea, lets call that improvement a barracks
centrifuge is offline  
Old July 30, 2002, 12:40   #7
Hermann the Lombard
Prince
 
Local Time: 01:09
Local Date: November 1, 2010
Join Date: Jun 1999
Location: Hoboken, NJ, USA
Posts: 894
I have considered adding "2nd try" upgrade opportunities, and in fact I have done so occasionally when I "lost" an upgrade by trading for the tech, or most recently because if two unit types upgrade at the same advance, you can only select upgrades for one of the two types (only one pass through the unit list).

Hexagonian doesn't like 2nd chances here because he wants the human player to have to plan ahead to have the right gold at the right time.
__________________
"...your Caravel has killed a Spanish Man-o-War."
Hermann the Lombard is offline  
Old July 30, 2002, 21:06   #8
HuangShang
Call to Power II Democracy GameCTP2 Source Code Project
King
 
HuangShang's Avatar
 
Local Time: 22:09
Local Date: October 31, 2010
Join Date: Jul 2002
Location: Berkeley
Posts: 1,375
Quote:
Originally posted by Hermann the Lombard
I have considered adding "2nd try" upgrade opportunities, and in fact I have done so occasionally when I "lost" an upgrade by trading for the tech, or most recently because if two unit types upgrade at the same advance, you can only select upgrades for one of the two types (only one pass through the unit list).

Hexagonian doesn't like 2nd chances here because he wants the human player to have to plan ahead to have the right gold at the right time.
so... how did you do it... i mean add '"2nd try" upgrade opportunities'

thanx
HuangShang is offline  
Old July 31, 2002, 12:20   #9
Hermann the Lombard
Prince
 
Local Time: 01:09
Local Date: November 1, 2010
Join Date: Jun 1999
Location: Hoboken, NJ, USA
Posts: 894
I edited the SLIC (the extent of my SLIC editing, to date). The first time I had missed several upgrades by trading for the techs, before I realized that scotched the upgrades. Afraid of screwing something up, I created my own little mod, complete with Modswapper entry. For the actual editing, I merely substituted later techs for the enabling techs that I had "lost."

The only tricky part was figuring out which files I needed to edit to create the mod and to isolate my changes so they wouldn't affect anything else (providing I remember the Ritual of Reloadslic, of course). There were 3 text files and 2 slic files, some in default\gamedata and some in english\gamedata. If for some reason you wanted to see the changes, I have a zip file with the five files. Baby steps in THIS forum!!

The most recent time, I edited the updater SLIC to simply swap the entries for Archer and Composite Archer, so that now the Archer upgrades first, then the Composite Archer. I had enough cash to upgrade all my archer units, then I was able to upgrade Comp.Archers selectively.
__________________
"...your Caravel has killed a Spanish Man-o-War."
Hermann the Lombard is offline  
Old August 2, 2002, 20:27   #10
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 05:09
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
I'm not ignoring you guys. I've got some debugging to do but keep your fingers crossed and I might have something for you in a couple of days.

BTW, sneaky move, Hermann.
Peter Triggs is offline  
Old August 5, 2002, 10:48   #11
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 06:09
Local Date: November 1, 2010
Join Date: Jun 2001
Posts: 7,665
Hi Peter, thanks for looking into this.

I have another small query. You made a script a few weeks ago to remove the unproductive tiles and replace them with other tiles when the game generated a map, i tried to d/l the attachment from the original thread but its not available anymore, could you post it here if you still have it? or somewhere i can find it...
__________________
Call to Power 2: Apolyton Edition - download the latest version (7th June 2010)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Maquiladora is offline  
Old August 5, 2002, 13:42   #12
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:09
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
cool! I cant wait to see this!

__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old August 5, 2002, 19:34   #13
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 05:09
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
Quote:
Originally posted by Maquiladora:
Is there any way to make upgrading your own units selective? Rather than just at the point of the obsolete advance. For example, moving the old unit onto a city with a certain building and upgrading it ala Civ3.
That's an interesting idea. It might be possible, but I'm really not sure. What occurs to me is that you could add a new order, "Update", with it's own button, and then when you pressed the button you'd have a whole bunch of checks to see if the unit was in a city that had the Barracks and it's owner had the advance that enabled an update. That's a bit complicated and nobody's tried anything like it. It would mean writing new code that's essentially completely separate from the existing Updater system.

About the map thing: What mod are you playing?

Pedrunn,

Don't get too excited, I'm just working on fixing up the existing Updater code.
Peter Triggs is offline  
Old August 5, 2002, 19:55   #14
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 06:09
Local Date: November 1, 2010
Join Date: Jun 2001
Posts: 7,665
Quote:
Originally posted by Peter Triggs
About the map thing: What mod are you playing?
Not using it for any mod(yet). Im interested in excluding/replacing some terrain for my maps, specifically glacier, desert hill and desert mountain. Im going to convert the others i dont want to something new.
Maquiladora is offline  
Old August 5, 2002, 22:14   #15
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:09
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Ooops
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old August 7, 2002, 20:16   #16
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 05:09
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
The reason I asked about what mod you were playing with, is because the version I posted earlier used Martin's GoodMod1.slc, so it would only work in mods that already have that included. Here's a version that I've ripped out of it; this should work with any setup. Anyone who wants to use this needs to go to the file ...\ctp2_data\default\gamedata\script.slc and at the very bottom of it, add the line

Quote:
#include "MAQ_Terra.slc"
and then just put the attached file in the folder ...\ctp2_data\default\gamedata

I don't know how familiar you are with SLIC, but it's all done with the terraform function:

Quote:

VOID Terraform(location, terrain)

Change location into a different terrain type.

0 TERRAIN_TYPE_FOREST
1 TERRAIN_TYPE_PLAINS
2 TERRAIN_TYPE_TUNDRA
3 TERRAIN_TYPE_GLACIER
4 TERRAIN_TYPE_GRASSLAND
5 TERRAIN_TYPE_DESERT
6 TERRAIN_TYPE_SWAMP
7 TERRAIN_TYPE_JUNGLE
8 TERRAIN_TYPE_MOUNTAIN
9 TERRAIN_TYPE_HILL
10 TERRAIN_TYPE_WATER_SHALLOW
11 TERRAIN_TYPE_WATER_DEEP
12 TERRAIN_TYPE_WATER_VOLCANO
13 TERRAIN_TYPE_SPACE
14 TERRAIN_TYPE_WATER_BEACH
15 TERRAIN_TYPE_WATER_SHELF
16 TERRAIN_TYPE_WATER_TRENCH
17 TERRAIN_TYPE_WATER_RIFT
18 TERRAIN_TYPE_DEAD
19 TERRAIN_TYPE_BROWN_HILL
20 TERRAIN_TYPE_BROWN_MOUNTAIN
21 TERRAIN_TYPE_WHITE_HILL
22 TERRAIN_TYPE_WHITE_MOUNTAIN
23 TERRAIN_TYPE_DEAD_HILL
The numbers in the left hand column are used in the code as follows. MGGoodLoc is the tile location being looked at.

Code:
     ran=random(3); //generate a random number 0 <= ran < 3
     if (TerrainType(MGGoodLoc)==2 || TerrainType(MGGoodLoc)==3){
     //if the location is tundra or glacier
	    if (ran==0){//33% chance of changing it to grassland
	        terraform(MGGoodLoc,4);//change to grassland 
	    }
          elseif (ran==1){//33% chance of changing it to plains
		  terraform(MGGoodLoc,1);//change to plains 
	    }
	    else{//33% chance of changing it to forest
		  terraform(MGGoodLoc,0);//change to forest
	    }
     }
I put the random number bit in so that it would break up the big clumps of terrain (tundra/glacier above) that you often find.

I hope that's enough info to let you get on with changing it if you want to. If not, feel free to ask for advice.

It works fine for me but this may be because of the way I've modified some of the data in const.txt. Tell me how it works with the data you're using.


PS, The new updater code will take a few more days. I'm, er uhm, having too much fun beta testing Call to Bloodlust.
Attached Files:
File Type: slc maq_terra.slc (1.7 KB, 6 views)
Peter Triggs is offline  
Old August 7, 2002, 21:08   #17
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 06:09
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
if you, er... need any help beta-testing...
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Immortal Wombat is offline  
Old August 8, 2002, 10:09   #18
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 06:09
Local Date: November 1, 2010
Join Date: Jun 2001
Posts: 7,665
Thanks Peter. Ill have a little dabble around and find my way. Unfortunately what i know about writing/interpreting slic you could write on the back of a stamp, but this looks alright.
Maquiladora is offline  
Old August 8, 2002, 17:48   #19
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:09
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
A small sugestion, Peter. It is not going to affect the code but i really think you shoul change numbers to
TerrainDB(TERRAIN_*).
That was the first thing i did when i got BlueO's original city expansion. This prevents incompatibilities with mods (There isnt a mod that changed the order of the terrains but it might have in the future), and really save you the time of having to look this chart you showed, prevents small mistakes with huge consequences and makes editing easier.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand

Last edited by Pedrunn; August 8, 2002 at 17:54.
Pedrunn is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:09.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team