Thread Tools
Old January 15, 2003, 09:19   #1
MrBaggins
CTP2 Source Code Project
King
 
MrBaggins's Avatar
 
Local Time: 14:27
Local Date: November 1, 2010
Join Date: May 1999
Posts: 1,528
Problem in GM1_Goods.slc (in Cradle 1.35)
After a pretty long hiatus, I've come back to see what the product of all the hard work on CtP2 mods have yielded, and thought I'd give Cradle a shot...

I've installed CtP2 (fresh install), The 1.11 patch, modswapper and Cradle 1.35. CRA_Goods.slc is GM1_Goods.slc v.1.6

I started checking out what could be done in the editor (using a 100x200 map.) I put some goods clustered together for a test. I had some issues with goods; when starting the scenario, not all of the new additional goods I placed have their associated underlying terrain improvements. The issue is reproducable. At first I thought it might be due to the number of goods on the map, however, I reproduced the problem on another map, which I started from scratch.

It seems to happen often when goods are placed close together (within a square.) Some or all of the goods may or may not be affected.

It can be easily reproduced if you start the editor with a small map, place a couple of 3x3 blocks of goods close to your start location, and start it as a scenario.

It can be worked around since its not necessarily a critical issue; you don't often need to place resources close together like that, but might want to in a scenario.

Any thoughts?

MrBaggins
MrBaggins is offline  
Old January 15, 2003, 10:32   #2
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 15:27
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
I think it's probably caused by the fact that the 'good' tile improvement placement only happens once, when the map is generated for the first time. When you place goods again afterwards, they do not get the tile improvements done underneath.

Try starting the scenario, then opening the chat window (press ' ), type /reloadslic, press enter...
Next turn, the tile improvements should be placed underneath the tiles.
__________________
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 January 15, 2003, 13:49   #3
MrBaggins
CTP2 Source Code Project
King
 
MrBaggins's Avatar
 
Local Time: 14:27
Local Date: November 1, 2010
Join Date: May 1999
Posts: 1,528
The code is being executed: the fresh map has the goods placed... is saved as a scenario, then started as a new game. The code in question is executed (I checked with a message box.) However it doesn't handle all cases.

Could it be that somehow the improvement is 'cut' before its finished, when the resources are grouped closely (and just hasn't been seen since its not been used in this situation before) I'm trying a few things with the code to see if I can come to a solution, but other peoples effort is appretiated.

MrBaggins
MrBaggins is offline  
Old January 15, 2003, 14:27   #4
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 14:27
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
Next thing we know CD and Nordicus will be posting.

Good to see you again MrBaggins!
Peter Triggs is offline  
Old January 15, 2003, 14:35   #5
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 16:27
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
Quote:
Originally posted by MrBaggins
Could it be that somehow the improvement is 'cut' before its finished, when the resources are grouped closely (and just hasn't been seen since its not been used in this situation before) I'm trying a few things with the code to see if I can come to a solution, but other peoples effort is appretiated.
That's not the problem all auxiliry tile improvements are cut before the good tile improvement is finished. The problem is that the auxiliry tile improvement is placed on a random neighbour terrain tile of the good and if there is a good then the good tile improvment is cut of with the auxiliry tile improvement.

To test this you could go to the MG_CutUnitImprovement event handler, there is CutImprovement event called, comment this line out and you should get a map with a lot of terrain owned by the Barbarians, and you should also find some of them on goods with the good improvement. The alternative would be to put the tile imps of your new goods manually on the map. They should be on the map if you create a scenario. But then you have to disable the good improvment process. That can be done by going to the MG_NewGoodImprovement event handler and find there these lines:

if (GetCurrentRound () == 0 ) {//&& player[0] == 1
elseif (GetCurrentRound () > 1) {//if someone reloads slic

by

if (GetCurrentRound () == -1 ) {//&& player[0] == 1
elseif (GetCurrentRound () > -1) {//if someone reloads slic

That has the effect the good improvement code is never executed in the scenario game (remember the tile imp locations should be saved with the map, so no need to put them again on the map). In the original scrip the good improvment process is only executed on turn 0, otherwise the code will be disabled. In the new version would be run the good improvement code on turn -1, as there is no turn -1 it is never executed, so that the elseif statement is always true and will disable the code.

I think it is possible to work out a sollution to improve the goods without the auxiliry improvement but this needs time that I don't have, unfortunatly.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old January 15, 2003, 15:22   #6
MrBaggins
CTP2 Source Code Project
King
 
MrBaggins's Avatar
 
Local Time: 14:27
Local Date: November 1, 2010
Join Date: May 1999
Posts: 1,528
Thanks for the feedback

I had a thought about a possible solution and it seems to work... although I'm going to test it out more.


I replaced the following four lines of "HandleEvent(BeginTurn)'MG_NewGoodImprovement'pre {"

Code:
GetRandomNeighbor(MGGoodLoc, MGUnitLoc);
CreateUnit(0, UnitDB(UNIT_BOMBER), MGUnitLoc, 1, MGGoodUnit);
Event:CreateImprovement(0,MGUnitLoc, MGTestImp,0 );
Event: DisbandUnit(MGGoodUnit);
with

Code:
for (k=0; k<=7 ; k=k+1) {
   GetNeighbor(MGGoodLoc, k, MGUnitLoc);
   if( HasGood(MGUnitLoc) == -1 ) {
      CreateUnit(0, UnitDB(UNIT_BOMBER), MGUnitLoc, 1, MGGoodUnit);
      Event:CreateImprovement(0,MGUnitLoc, MGTestImp,0 );
      Event: DisbandUnit(MGGoodUnit); 
      k=k+7;
   }
}
you need to initialize k with
Code:
int_t k;
in the header of the event.


Essentially, rather than randomly picking a neighbor square to place the unit and test tile imp on, it picks the first one without a good on.

I thought it might not work on a 3x3 grid of goods, but I was wrong... that seems to work ok too.

mrbaggins
MrBaggins is offline  
Old January 15, 2003, 15:50   #7
Engineer_J
Settler
 
Local Time: 14:27
Local Date: November 1, 2010
Join Date: Dec 2002
Posts: 12
Speaking of tile improvements, remind me it has been awhile since I looked at this, but in CTP2 do any goods add to the food a tile brings into the city? I know Civ 3 has wheat and CTP had this also (it is easier to see when you move citizens around). Just wondering.
Engineer_J is offline  
Old January 15, 2003, 16:38   #8
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 16:27
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
In the default CTP2 game no good gives a food, gold or production bonus for your city. This was possible in CTP1 but not in the default game, too. In CTP2 it was intended but because of bugs or unfinsihed work it doesn't work, therefore I have to use the workaround to place invisible Tile Improvements on the good tiles to add such a terrain bonus.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old January 15, 2003, 18:22   #9
Engineer_J
Settler
 
Local Time: 14:27
Local Date: November 1, 2010
Join Date: Dec 2002
Posts: 12
What mods have that feature and which goods do they effect? Can I see the bonus in the game someway easily?
Engineer_J is offline  
Old January 15, 2003, 18:37   #10
MrBaggins
CTP2 Source Code Project
King
 
MrBaggins's Avatar
 
Local Time: 14:27
Local Date: November 1, 2010
Join Date: May 1999
Posts: 1,528
GoodMod is basically what you are looking for. Its available as an addon to CityMod2, MedPack2 and the Apolyton Pack, and its also included in Cradle of Civilization.

Find what you need here

To discover what bonuses, just right click a square, or view the civilopedia entries for the trade goods.
MrBaggins 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 10:27.


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