 |
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
"I wish there was a way to "capture" teritory with units or if anything certain improvements (not related to pop) would increase the control of your territory."
Forts and Watchtowers extend borders, but I cant remember if watchtowers were in the original or SAP games.
In my mod I introduced a new unit, the MIGRANT for transferring population from city to city. It's basically a very low value combat unit that cuses a pop point when built, then returns the pop point if disbanded in a city. I aded a cost of 250 gold for the function and extended that to all settler/nomad types.
In addition, I created a new tile improvement, the BORDER FORT, if you disband a migrant in the open inside existing territory and have 100 gold and 100-250 pw, you get a border fort which is like a watchtower, extends borders, but has no defence.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
Hi Ben,
Sent you an email a few minutes ago.
Can you clarify this for me please?
Not sure how CTP2 represents buildings from wonders. In civ 3 the building shows up in the inventory and is removed when the wonder is obsolete.
I was certain in the past that after I built a wonder like VOK, the building (apothecary) appeared in the inventory for each city, can remember selling apothecaries when preparing to get rid of cities.
However, I ran a test game and checked an old game and neither showed apothecaries in the inventory after VOK was built.
In my current game VOK has just become obsolete and cities do not have an apothecary in the inventory, but new cities also do not show apothecary as a building option.
Do you know exactly how wonder buildings are represented, is it effect only? and they dont show up in the build list?
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
E,
While it is feasible to do what you want, as IW said, I think that level of detail is not really applicable to a game of this scale. You would have to do it for Rubber, oil, aluminium, horses, copper etc.
If you are wanting a detailed scenario based on a particular period, then its probably worth while. The existing system generalises resources into three things, gold, food and PW which is better than civ 3.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
An then of course, you have to get the AI to do things with the new concepts.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
Thanks Ben, I figured that out by changing the name of the function and running the game, and when it returned no error I figured that that type of function was called every turn.
Hope you are back on line fully soon. Thanks.
Does anyone else know about how the Wonder Buildings are handled?
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
I think I figured out the problem.
Buildings from wonders do not show up in inventory for cities.
The buildings do still show up in the build queue if a wonder is built (we knew that, thats why wonderbuildings.slc was written).
However, when a wonder is obsolete, the building does not return to the build list, applicable only to cities built after obseleting, here being the problem.
I am very sure that unless the wonder is destroyed by it's city being destroyed, the player still is counted as having the wonder even after it is obsolete. It still shows up in the wonder list. Anyways, wonderbuildings.slc does not return the building to the build queue.
I solve the problem by altering wonderunits.slc so when a wonder is created, the buildings are built in the city and I removed the buildings from wonders.txt. The remaining issue is to build the building when a city is created until the obseleting advance is reached. I have written this amendment to militia creation. Cant quiet get the code right, can anyone see what I did wrong. Does not return any errors but does not work.
HandleEvent(CreateCity) 'CRA_MilitiaCityCreated' post { // triggers if a city is founded
location_t tmpLoc;
int_t tmpPlayer;
tmpPlayer = player[0];
tmpLoc = location[0];
city_t tmpCity;
CRA_CreateMilitia(1, tmpPlayer, tmpLoc); // create 1 Militia
tmpCity = city[0];
player[0] = tmpPlayer;
if (PlayerHasWonder(tmpPlayer, WonderDB(WONDER_VALLEY_OF_THE_KINGS)) && (!HasAdvance(tmpPlayer, ID_ADVANCE_DARK_AGES))) {
Event:CreateBuilding(tmpCity, BuildingDB(IMPROVE_APOTHECARY));
}
elseif (PlayerHasWonder(tmpPlayer, WonderDB(WONDER_HANGING_GARDENS))&& (!HasAdvance(tmpPlayer, ID_ADVANCE_DARK_AGES))) {
Event:CreateBuilding(tmpCity, BuildingDB(IMPROVE_AQUEDUCT));
}
elseif (PlayerHasWonder(tmpPlayer, WonderDB(WONDER_HADRIANS_WALL))&& (!HasAdvance(tmpPlayer, ID_ADVANCE_BANKING))) {
Event:CreateBuilding(tmpCity, BuildingDB(IMPROVE_WALL));
}
}
Thanks if anyone can help.
|
|
|  |
 |
|
hexagonian
|
 |
Gnawing on your mind...
Jun 1999 time: 23:34
|
|
quote: Originally posted by stankarp
My mod unfortunately is too big to publish on Apolyton. Cut down to its minimum, it would be nearly 100 meg. I have 50 meg in special effect sprites which are in effect, small AVI's that play when you get disasters, good events, a leader dies, you capture a capital or kill an AI and when Attila the Hun arrives or dies.
|
This Mod has a lot of potential. (I've been fortunate enough to have access to it, thanks to stankarp sending me a CD copy) But it may not be reasonable for stankarp to send a file to everyone who asks for it - though the traffic here for CTP2 files is light. A 4-year old game does that...
Although the AVIs and soundfiles are a nice atmospheric touch, I'd suggest setting up a 'bare bones' public version of your Mod that only includes stuff essential to the actual gamplay.
You can also possibly merge the use of sprites, using tga files (which are a lot smaller than spritefiles) to differentiate your generals.
It would be a little more work at your end (keeping track of multiple file setups), but the important thing for you is to get the Mod into the public's hands - not only for playing, but for some playtesting.
Last edited by hexagonian on 14-10-2004 at 01:46
|
|
|  |
 |
|
E
|
 |
July 24,2005 Ctp2 Tiles in sig!
May 1999 time: 21:34
|
|
quote: Originally posted by Immortal Wombat
So you want a running total of resource points, that should be easy enough to calculate, probably. Though it may mean scanning the map.
- Does it count if the resource is outside a city radius?
- If there is a mine, must there also be a road? If not, does a road = +1 and a mine = +5 or is 5 the maximum?
Then when you upgrade a unit, you want to subtract a point. What if there are no more points? If you plan to hijack the existing upgrade code, this could get pretty complicated I would think: you'd have to check for gold availability and PW availability and iron-points availability before upgrading! Strings aplenty to be working with.
Then does the iron score then reset to the total the following turn, or later that turn. i.e. is the amount needed to upgrade a comparison to or a depletion of the points? Do points only get added when the tile improvement is built (and deducted when pillaged), or is the points total a function of their existence? |
Thats IW and Stankarp. Essentialy I'd like to work a resources concept via SLIc. The community seems split on having resources at all, and those that do have different opinions on how to implement it.
I'm oping to make SLIC for a scenario, probably only using iron, horses, and oil. Somethig to make the late game more interesting.
As for your questions
I want the score to be totaled at the beginig of the turn and then subtracted as you upgrade by the end of the turn. That total score then gets added to anything is "produced" each turn.
i'm loking to have the points geberated if they have tile improvement os them and you get no bonus if they are pillaged (Maybe I could add a resource bonus for pillaging but that can be discussed later)
I think the resource should be counted only when its in a civs radius and have some improvement on it, to show an active use of it (road, mine, etc)
And I'm thinking the upgrade would require looking at availability of gold, pw, and iron before bing allowed to upgrade for certain units.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
Hi Ben,
Can you see why my code above does not work, something to do with the declarations again.
Thanks if you can help.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
Phew, problem figured out. I recommend anyone who wants to write slic should seek a medical opinion first, it is very, very frustrating.
The problem is that, I am 99% sure, you cannot build a building in a city in the turn the city is created. I eventually added a getcitybyindex loop to my code and still did not get a building, then had a thought and created cities on successive turns. The city created the previous turn then got the building.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
Thanks Big Mc,
However, that will involve a different settler type for each wonder that provides buildings, and restricitng that unit ala med mod or AG scenario to the player with the wonder. Then you would need one nomad type for each possible combination of wonders, eg,
has VOK but not HG and HW, or has HG but not HW and VOK, etc, etc, etc.
I now have it all worked out except that the last city built by the wonder owner does not have the building, since its lev 1, plenty of time to build the buildings and its not critical to that city that is does not have the wonder.
The reason why I persevered with this is I am sure that building effect supplied by a wonder, does not mean the city has the building if you do a hasbuilding check, such as in the disaster code.
|
|
|  |
 |
|
Immortal Wombat
|
 |
in perpetuity
Dec 2000 time: 05:34
|
|
That depends. From what I remember of the code, the messages called above lead into the main updating sequence. If you simply copied that for PW and resource points, it would try and update three times, horrible things would happen.
What I think you need to do is to work out before that block of code the total cost in gold, PW and iron points (and this will probably involve two more arrays similar in form and function to PER_UNIT_UPDATE_COST[]), work out if any of the three resources (gold, pw, iron) are too small to do the whole lot, and then message accordingly. If two (or all three) resources are too small, you'll have to message the player using the least one I guess.
The good news is that you might be able to hijack the existing messages once you have worked that out, using variable string text to tell the player which resource is limited, and then use the same updater code.
If none of the three things are limited, you need the code to go into the "enough gold" loop. And of course, alll the messages will have to be changed to tell the player how much public works he's putting into the updating so that he/she can tell the code when to stop.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
Very Quick Question
Does reloadslic reset global variables?
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
E,
this bit of code searches the map for a particular tile_imp belonging to the each player.
if(IsHumanPlayer(player[0])){ // once each player-cycle. This means that AI players will get gold early, but
// it saves scanning the map 8 times
for(i=0; i < GetMapWidth(); i = i + 1){
for(j=0; j < GetMapHeight(); j = j + 1){
MakeLocation(tmpLoc,i,j); // scan map for locations
if(TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_OUTPOST))){ // if it's a outpost
if(CellOwner(tmpLoc)){ // and owned
AddGold(CellOwner(tmpLoc),10); // gift some gold
}
if(CellOwner(tmpLoc)){
if (HasGood(tmpLoc)>=0){
AddGold(CellOwner(tmpLoc),10);
}
}
Note, it does not have the right number of "}" at the end of code, its copy and paste job from part of a 30 page code.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
Forgot, adds 10 gold for the tile_imp and another 10 gold if there is a good there.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
Hi Ben,
Any idea how to maintain a separate in game score that wont reset with reloadslic. I have set up a system that adds to a global variable when-
a) a capital is captured,
b) a AI is killed.
c) a wonder is built
then once per 100 turns, adds that value to a score worked out on number and size of cities. This gives a score and an appropriate message to the human player and displays the score.
The problem, if I have to reloadslic for the occassional crash, the score resets to 0.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
Actually, I figured out how to do it, as long as local variables are not reset to 0 with a reloadslic.
Instead of simply having a line
score = score +25;
in each part of code where I want the score to increase, replace it with a function that simply adds 25 to a variable inside the function then writes it to the global variable. That way if the global variable is reset, it gets updated next time the score function is run.
So the simple question is, do local variables reset to 0 with reloadslic?
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:34
|
|
Answered my own question with a test, local variables do reset with reloadslic, even inside a function.
So back to Ben for any ideas. Sigh.
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:34. Apolyton Time is 00:34. |
top of page
|
|
|
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
|
|
|
|
|
|