 |
|  |
 |
|
Alpha Wolf
|
|
Prince of the Barbarians
Feb 2001 time: 05:14
|
|
quote:

Originally posted by Harlan on 01-06-2001 04:31 PM
Alpha,
If its like CTP1, any file that starts with a number can be changed, but you have to change that number too. So if it was the Units.txt, add three new units and then add three to that start number.
Luckily, many files now no longer use that number, which is great, cos it was a real pain to keep that straight.
 |
I was just making a joke If I had more time, I'd have sat down with the SLIC doc and be doing it myself. But since coding and analyzing crappy code is what I do all day, I mostly just want to have fun when I play. unfortunately, I just cant turn off all those "what if" thoughts 
I really wish they had gotten rid of all the size limitations. Most have really bogged their computers down when they had unlimited everything. Of course, definitions of more of the fields would be helpful. Been playing with the Ai to see if I can maximize its aggressiveness without being reckless.
------------------
History is written by the victor.
[This message has been edited by Alpha Wolf (edited January 06, 2001).]
|
|
|  |
 |
|
Bluevoss
|
|
Orlando, Florida
Dec 2000 time: 05:14
|
|
What I would like to see (outside of normal disasters) are some disasters political in nature. Say that your happyness drops 5-10 points in every city, and any city that drops into unrest has a good chance of going barbarian. This might be considered a civil war, the death of a powerful ruler, or something.
I think this would be good, since it would give us a reason to keep building all those theaters and stuff that dont seem to make a differnce.
Outside of that, does anyone know how to increase the unhappyness due to overcrowding?
Thanks,
------------------
Bluevoss-
|
|
|  |
 |
|
Radical_Manuvr
|
|
Maryland, USA
Dec 2000 time: 05:14
|
|
AW,
Looking at the 4th post on this thread it appears you want an 80% chance of some type of natural disaster to occur every turn. Is that correct? I suppose that is the easy part anyway and could be modified by anyone to have x% chance of the disaster routine on each turn once the other code is written. I'm pretty sure I can get a randomly placed bombardment for the earthquakes. The drought/great weather part seems as though it may be more complicated, but I'll give it a shot. I doubt I could do the tidal wave thing and honestly won't even try. I remember reading something about changing terrain could have unpredictable or undesirable results so I'm not going to mess with that.
|
|
|  |
 |
|
heardie
|
|
Radical_Manuvr that would be good if you got to work on the bombardemnt functioons. I will create some simplle framework, like messageboxes and the like, adn determing what disaster occurs. Then you/we can simply insert the functions into the code and get it running.
And if i get that all done, I'll also have a go at bombarding but i doubt that i will.
Good Luck!
|
|
|  |
 |
|
heardie
|
|
RE: To do food production
Drought: Create a building that decrease food by 25%
IMPROVE_DROUGHT {
DefaultIcon ICON_IMPROVE_GRANARY
Description DESCRIPTION_IMPROVE_GRANARY
EnableAdvance ADVANCE_AGRICULTURE
ProductionCost 0
Upkeep 0
FoodPercent -0.25
}
Surplus: Create building increase by 25%
IMPROVE_SURPLUS {
DefaultIcon ICON_IMPROVE_GRANARY
Description DESCRIPTION_IMPROVE_GRANARY
EnableAdvance ADVANCE_AGRICULTURE
ProductionCost 0
Upkeep 0
FoodPercent 0.25
}
Can that work?
Then all we do is create them, and then after x amount of turns remove them.
Is that right?
|
|
|  |
 |
|  |
 |
|
heardie
|
|
And everyone (drumroll) here is some cool code 
Alpha I thought about that too(tracking improvements) and here is what i came up with:
have a variable say isDrought - and default it to -1.
When we have a drought set it to three and then decrement it bu 1 each turn. when it gets to zero remove the improvment and set it to -1. Too easy. Anyway the code that can be added to mine is:
1+2. Drought/Good Weather Building
I can't work out how to add a building to a city. anyone?
3. Add a earthquake code.
I also took the liberty to add floods as a natural disaster as there is already a flood function.
Enough rambling lets post some crappy code 
code:
#include "msg.slc"
HandleEvent(BeginTurn) 'FirstTurn' pre
{
Message (g.player, 'StartMessage'); //Message when you start a game
DisableTrigger('FirstTurn')
}
HandleEvent(BeginTurn) 'EveryTurn' pre
{
int_t DisasterType;
int_t FloodStrength;
int_t isDrought; //Used to determing whether we are is drought, or something else.
isDrought = -1;
//The next will do two checks. If it is greater than zero, decrement.
//If it is 0 then destroy all the 'Drought' buildings and set it to -1
if (isDrought > 0) {
isDrought = isDrought - 1;
}
elseif (isDrought == 0) {
isDrought = -1;
Message (g.player, 'DroughtEnd'); //Message when drought ends
}
int_t isWeather; //Used to determing whether we are is drought, or something else.
isWeather = -1;
//The next will do two checks. If it is greater than zero, decrement.
//If it is 0 then destroy all the 'Drought' buildings and set it to -1
if (isWeather > 0) {
isWeather = isWeather - 1;
}
elseif (isWeather == 0) {
isWeather = -1;
Message (g.player, 'WeatherEnd'); //Message when good wheather ends
}
//Start the disaster code here
DisasterType = random (10);
if (DisasterType == 1)
{
Message (g.player, 'DroughtBegin');
//Create the building 'Drought'
for(m = 0; m <= player.cities; m = m + 1){
//Insert Building Code here
}
isDrought = 3; //Three turns of drought
}
if (DisasterType == 2)
{
Message (g.player, 'WeatherBegin');
//Create the building 'GoodWeather'
for(m = 0; m <= player.cities; m = m + 1){
//Insert Building Code here
}
isWeather = 3; //Three turns of weather
}
if (DisasterType == 3 | | DisasterType == 4 | | DisasterType == 5 | | DisasterType == 6)
{
Message (g.player, 'Earthquake');
//Do the Earthquake Stuff
}
if (DisasterType == 7 | | DisasterType == 8)
{
Message (g.player, 'Flood');
FloodStrength = Random(3) + 1
Flood(FloodStrength);
}
}
I havent yet tested this(its not ready) so there may be careless spelling errors, missing ';'s, etc.
Alsoo I think this (part of it, anyway) should just be for large random disasters. I was thinking that up the top I could just at a
if(random(10)==1) then
and then there is only a 1/10 chance of anything occuring at all.
What do you think?
Radical_Manuvr got any code for me?
|
|
|  |
 |
|
Radical_Manuvr
|
|
Maryland, USA
Dec 2000 time: 05:14
|
|
I just started on the earthquake stuff. Determined how to indicate the random location based on map size so it will work with any map, but I've only spent an hour on it so far so. Haven't tested yet either and I'm not sure how long it will take me.
Question about using building for the +/- food. If this is a human player, what's to stop them from selling the building? I don't have another method for the +/- food at this point but just thought I would throw that out.
To add a building I didn't find a nice easy way, maybe someone else knows of one. Here are the functions I think you need to do it.
VOID ClearBuildQueue(city)
Remove all items from the build queue of the given city. Example:
city_t tmpCity;
int_t i;
for(i = 0; i < player[0].cities; i = i + 1) {
GetCityByIndex(player[0], i, tmpCity);
if(CityisValid(tmpCity)) {
ClearBuildQueue(tmpCity)
}
}
//clears the build queues of all of player[0]’s cities
VOID AddBuildingToBuildList(city, buildingType)
Add the building type to the end of the city’s queue. Example:
if(!city[0].buildqueuelength) {
AddBuildingToBuildList(city[0], BuildingDB(IMPROVE_CITY_WALLS));
}
//if the city is not building anything, it will put the improvement City Walls into its build queue.
2 events that may help
BuildFront(city_t)
Try to build the first thing in a city's queue
OR
BuyFront(city_t)
Rush buy an item in a city
BuildFront is probably better. It may not require gold since it looks like BuyFront does. The above set of functions and events may require you to determine the gold a player has, how much the rush buy costs and add enough gold using AddGold(city).
I haven't tried the event below but it may work nice and clean. Since int_t is integer I suppose you have to know the index number of the building you want to add. Hopefully this will work.
CreateBuilding(city_t, int_t)
Create a building
For getting rid of the building
VOID DestroyBuilding(city, building)
Remove the specified building from the city.
Example:
DestroyBuilding(city[0], BuildingDB(IMPROVE_SILO));
Back to work on the quakes. Later
|
|
|  |
 |
|
Radical_Manuvr
|
|
Maryland, USA
Dec 2000 time: 05:14
|
|
Forgot to add that the flood function or event (forgot which it is) is like the global warming disaster. As far as I know that would affect all coasts and possibly swamps (if it works like CTP1) anywhere on the map not just those near a random epicenter.
|
|
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:14
|
|
Important correction: to add a building one should use the code:
Event:CreateBuilding(tmpCity, BuildingDB(IMPROVE_DROUGHT));
So with 'Event:' in front of the eventname. I don't know how that could fallen away. To destroy it the function DestroyBuilding will work, as Radical mentioned earlier.
To get non-global floods, you could use the Terraform function. My suggestion would be: check all squares in a 3 tile radius (or something similar) and if a tile is swamp, plain or grassland either adjacent to sea or with a river running through it, terraform it to beach/shallow water (whatever turns out to work best), do the same for all squares adjacent to it. (To get an adjacent tile, use a for loop and GetNeighbor). If a tile is of any other terraintype or doesn't have a river or sea near it, check the next tile. A good way to cycle through tiles could be to use a double for-loop with MakeLocation that has variables x and y(which range from location.x - 3 to location.x + 3, similar for y) as arguments, which come from the for-loops.
|
|
|  |
 |
|
Radical_Manuvr
|
|
Maryland, USA
Dec 2000 time: 05:14
|
|
I've got part of the earthquake stuff working.
So far if it's centered on a city it may destroy a building depending on the size quake. Also depends on if the building is there or not. It may try to destroy a building that isn't built yet in which case nothing happens. If it's level 8 (highest) you'll lose city walls. That can be easily changed by anyone to something else or deleted.
Random tiles surrounding the epicenter may lose tile improvements.
Random units in or around the epicenter will lose hitpoints. At this point I don't have them getting killed. I have it tied to the scale of the quake but if their hit points are less than 8 I'm not taking hitpoints because they ended up with negative hitpoints in some cases and weird stuff started happening.
All this works with me specifying a location I know is a city. I'm working on the random location part but it's been crashing so far. I haven't tried with specifying a location say one tile from a city to see what happens. Probably gonna break for a while and watch some football. I'll post what works later today even if I don't get the random location part working. Maybe someone else can get that. I was trying to make it so this would work with any size map automatically. It may turn out that you just have to edit scenario.txt and plug in your map size.
I'm trying to use GetMapHeight () and GetMapWidth ()
I'm not sure if a variable goes between the () or not. I'm crashing with nothing between the (). Hopefully Locutus or someone else can answer before I get back to it later.
|
|
|  |
 |
|
Radical_Manuvr
|
|
Maryland, USA
Dec 2000 time: 05:14
|
|
AW, please type your email address so I can send you the files. I'll post here but figured it would be eaiser for you if I sent them. I'll also send to Locutus and Herdie if his addy is here. Your addy came up strange when I clicked on the email icon.
|
|
|  |
 |
|
Radical_Manuvr
|
|
Maryland, USA
Dec 2000 time: 05:14
|
|
Still didn't get random location to work. It just crashes with no msg when I include the lines for that. It may be that it's putting the location off the map. Perhaps limiting to between 3 and max x-4 would fix it. Same with y. Anyway, this works for a certain location, whatever is in tmpXloc, tmpYloc. I commented out the last random part I tried to get to work.
I was using huge map size for testing it so it may not work with other sizes. Put a city in the location, add some bldgs, and units all around and in the city and see what happens. Pretty cool, IMHO. It works at locations other than cities as well. I probably have some unnecessary stuff in this but it works (except the random part) anyway. Never claimed to be a programmer. I planned to add a msg and maybe have a city lose a pop if the epicenter was a city, but this is what's done for now.
scenario.slc
/////////////////////////////////////////////////////////////////////////////////////
// Script for the earthquake disaster mod 1.0 //
// last update 01-07-2001 by Charles Rothermel Apolyton name Radical_Manuvr //
/////////////////////////////////////////////////////////////////////////////////////
//////////////////////
// Global variables //
//////////////////////
int_t humanPlayer; // The human player number
int_t tmpYloc;
int_t tmpXloc;
int_t turnCount; // Number of turns elapsed
int_t turnMax; // Turns until scenario ends
location_t disasterLoc;
location_t disasterLoc2;
#include "EQ_func.slc" // Functions
//////////////
// Handlers //
//////////////
//---------------------------------
// Stuff to do when the game starts
//-----------------------------------
HandleEvent(BeginTurn) 'EQStart_F' pre {
int_t tmpPlayer;
if(IsHumanPlayer(player[0])) {
humanPlayer = player[0];
turnMax = 600; // if turnCount reaches turnMax, the game ends
turnCount = 0; // number of turns elapsed
// tmpXloc = 64; // max x for huge map, if using different size enter max x here
// tmpYloc = 128; // max y for huge map, if using different size enter max y here
// tmpXloc = GetMapWidth();
// tmpYloc = GetMapheight();
DisableTrigger('EQStart_F');
}
}
//-----------------------
// Stuff to do every turn
//-------------------------
HandleEvent(BeginTurn) 'EQEachTurn_F' post {
city_t tmpCity;
int_t i;
int_t tmpPlayer;
int_t tmpRichter; // Richter scale simulator
int_t tmpDestroy; // used to determine which building to destroy
int_t tmpnumberUnits;
tmpPlayer = player[0];
// tmpXloc = Random(63); // -1 from map size since random starts at 0
// tmpYloc = Random(127); // -1 same
tmpXloc = 29;
tmpYloc = 75;
if (tmpPlayer == 1) {
turnCount = turnCount + 1; // increment turn counter
if (turnCount > turnMax) {
if (humanPlayer == 1) {
Event:GiveMap(2,1); // this is temporary just need something here
}
} // temp for testing take out later
MakeLocation(disasterLoc, tmpXloc, tmpYloc);
tmpRichter = Random(8); // random number from 0-8
tmpDestroy = Random(52); // random number from 0-52
GetCityByLocation(disasterLoc, tmpCity);
if (CityIsValid(tmpCity)) { // if a city exists at the epicenter
tmpnumberUnits = UnitsInCell(disasterLoc); // number of units in cell
if (tmpnumberUnits > 0) {
QuakeDamage (disasterLoc, tmpnumberUnits, tmpRichter);
}
for (i = 0; i < tmpRichter; i = i + 1) {
GetRandomNeighbor(disasterLoc, disasterLoc2); // find a random tile one tile from epicenter
Event:CutImprovements(disasterLoc2); // destroy tile improvements if found
tmpnumberUnits = UnitsInCell(disasterLoc2); // number of units in cell
if (tmpnumberUnits > 0) {
QuakeDamage (disasterLoc2, tmpnumberUnits, tmpRichter);
}
}
if (tmpRichter > 5) { // if quake is 6, 7, or 8 a building will be destroyed if it exists
// if the building doesn't exist nothing happens to buildings
if (tmpDestroy == 0 | | tmpDestroy == 1) { // 2 in 52 chance
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_VR_AMUSEMENT_PARK));
} elseif (tmpDestroy == 2) { // 1 in 52 chance
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_ACADEMY));
} elseif (tmpDestroy == 3) { // 1 in 52 chance from here down
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_AIRPORT));
} elseif (tmpDestroy == 4) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_ANTI_BALLISTIC_MISSILES));
} elseif (tmpDestroy == 5) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_AQUA_FILTER));
} elseif (tmpDestroy == 6) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_AQUEDUCT));
} elseif (tmpDestroy == 7) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_ARCOLOGIES));
} elseif (tmpDestroy == 8) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_ARENA));
} elseif (tmpDestroy == 9) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_BALLISTA_TOWERS));
} elseif (tmpDestroy == 10) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_BANK));
} elseif (tmpDestroy == 11) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_BASCILICA));
} elseif (tmpDestroy == 12) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_BATTLEMENTS));
} elseif (tmpDestroy == 13) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_BAZAAR));
} elseif (tmpDestroy == 14) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_BEHAVIORAL_MOD_CENTER));
} elseif (tmpDestroy == 15) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_BODY_EXCHANGE));
} elseif (tmpDestroy == 16) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_BROKERAGE));
} elseif (tmpDestroy == 17) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_CAPITOL));
} elseif (tmpDestroy == 18) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_CITY_WALLS));
} elseif (tmpDestroy == 19) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_COMPUTER_CENTER));
} elseif (tmpDestroy == 20) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_CORNUCOPIC_VAT));
} elseif (tmpDestroy == 21) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_CORRECTIONAL_FACILITY));
} elseif (tmpDestroy == 22) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_COURTHOUSE));
} elseif (tmpDestroy == 23) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_DRUG_STORE));
} elseif (tmpDestroy == 24) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_E_BANK));
} elseif (tmpDestroy == 25) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_ECO_TRANSIT));
} elseif (tmpDestroy == 26) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_FACTORY));
} elseif (tmpDestroy == 27) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_FLAK_TOWERS));
} elseif (tmpDestroy == 28) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_FOOD_SILO));
} elseif (tmpDestroy == 29) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_FORCEFIELD));
} elseif (tmpDestroy == 30) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_FUSION_PLANT));
} elseif (tmpDestroy == 31) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_GAIA_COMPUTER));
} elseif (tmpDestroy == 32) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_GRANARY));
} elseif (tmpDestroy == 33) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_HOSPITAL));
} elseif (tmpDestroy == 34) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_INCUBATION_CENTER));
} elseif (tmpDestroy == 35) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_MATTER_DECOMPILER));
} elseif (tmpDestroy == 36) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_MICRO_DEFENSE));
} elseif (tmpDestroy == 37) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_MILL));
} elseif (tmpDestroy == 38) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_MOVIE_PALACE));
} elseif (tmpDestroy == 39) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_NANITE_FACTORY));
} elseif (tmpDestroy == 40) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_NUCLEAR_PLANT));
} elseif (tmpDestroy == 41) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_OIL_REFINERY));
} elseif (tmpDestroy == 42) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_ORBITAL_LABORATORY));
} elseif (tmpDestroy == 43) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_POWER_SATELLITE));
} elseif (tmpDestroy == 44) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_PUBLIC_TRANSPORTATION));
} elseif (tmpDestroy == 45) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_PUBLISHING_HOUSE));
} elseif (tmpDestroy == 46) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_RECYCLING_PLANT));
} elseif (tmpDestroy == 47) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_ROBOTIC_PLANT));
} elseif (tmpDestroy == 48) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_SECURITY_MONITOR));
} elseif (tmpDestroy == 49) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_SHRINE));
} elseif (tmpDestroy == 50) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_TELEVISION));
} elseif (tmpDestroy == 51) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_THEATER));
} elseif (tmpDestroy == 52) {
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_UNIVERSITY));
}
if (tmpRichter == 8) { // if quake is 8, city walls will be destroyed if they exist
// at this magnitude something should go
DestroyBuilding(tmpCity, BuildingDB(IMPROVE_CITY_WALLS));
}
}
} else { // no city at epicenter
Event:CutImprovements(disasterLoc); // destroy tile improvements if found at epicenter
tmpnumberUnits = UnitsInCell(disasterLoc); // number of units in cell
if (tmpnumberUnits > 0) {
QuakeDamage (disasterLoc, tmpnumberUnits, tmpRichter);
}
for (i = 0; i < tmpRichter; i = i + 1) {
// the higher the Richter number the more likely a tile improvement will be destroyed
// can be up to 8 tile improvements destroyed surrounding epicenter
GetRandomNeighbor(disasterLoc, disasterLoc2); // find a random tile one tile from epicenter
Event:CutImprovements(disasterLoc2); // destroy tile improvements if found
tmpnumberUnits = UnitsInCell(disasterLoc2); // number of units in cell
if (tmpnumberUnits > 0) {
QuakeDamage (disasterLoc2, tmpnumberUnits, tmpRichter);
}
// possible that it will use the same tile 8 times or other combos, ex. 1 twice, another once, another 3 times
// losing all tile impr. around epicenter should be rare
}
}
}
}
EQ_func.slc
///////////////
// Functions //
///////////////
// Damages all units in location
void_f QuakeDamage (location_t tmpLoc, int_t tmpNum, int_t tmpNum2)
{
int_t i;
unit_t tmpUnit;
for (i = 0; i < tmpNum; i = i + 1) {
GetUnitFromCell(tmpLoc, i, tmpUnit);
if (tmpUnit.hp > 8) {
DamageUnit(tmpunit, tmpNum2); // Subtract tmpNum2 hit points from the specified unit
}
}
}
|
|
|  |
 |
|
Alpha Wolf
|
|
Prince of the Barbarians
Feb 2001 time: 05:14
|
|
quote:

Originally posted by Radical_Manuvr on 01-07-2001 07:03 PM
AW, please type your email address so I can send you the files. I'll post here but figured it would be eaiser for you if I sent them. I'll also send to Locutus and Herdie if his addy is here. Your addy came up strange when I clicked on the email icon.
 |
CTPAlphaWolf@aol.com
When I setup that account on aol i set it up as CTP Alpha Wolf forgetting that the email address would freak out on the spaces. Took me a few days of harrassing poor Dan and Mark in order to figure out that my actual email address didnt have the spaces. Now I'm afraid to touch it in my profile....LOL
I think i remember seeing that buildings are assigned a number as its read into the database. If so, you can just do a loop thru the number of buildings and would save a ton of code.
Something like:
if (tmpRichter > 4) { // if quake is 5, 6, 7, or 8 buildings have a chance to be destroyed
// if the building doesn't exist nothing happens to buildings
for(b = 0; Building.Type[b] <> ""; b = b + 1)
{ //assuming this is how to identify the end of the array
if random(tmpRichter * 3) > 12 {
//chance any building will be destroyed
DestroyBuilding(tmpCity, Building.Type[b])
}
}
Also, depending on how SLIC does there rounding, tmpRichter = Random(8); will most likely give you a range of 0 to 7. Most of the randomizers i've seen over the years simply drop fractional values so getting the 8 would be so rare that in essence it would never happen. However, if SLIC's randomizer rounds then you can get 8 more often.
------------------
History is written by the victor.
[This message has been edited by Alpha Wolf (edited January 07, 2001).]
[This message has been edited by Alpha Wolf (edited January 07, 2001).]
|
|
|  |
 |
|
heardie
|
|
Great work!
I'll force that together with my code and see what happens. This should be good
|
|
|  |
 |
|
Alpha Wolf
|
|
Prince of the Barbarians
Feb 2001 time: 05:14
|
|
What is
#include "EQ_func.slc" // Functions ????
I put the code into scenario.slc but the game crashes on that line.
------------------
History is written by the victor.
|
|
|  |
 |
|
heardie
|
|
EW_FUNC
code:
///////////////
// Functions //
///////////////
// Damages all units in location
void_f QuakeDamage (location_t tmpLoc, int_t tmpNum, int_t tmpNum2)
{
int_t i;
unit_t tmpUnit;
for (i = 0; i < tmpNum; i = i + 1) {
GetUnitFromCell(tmpLoc, i, tmpUnit);
if (tmpUnit.hp > 8) {
DamageUnit(tmpunit, tmpNum2); // Subtract tmpNum2 hit points from the specified unit
}
}
}
|
|
|  |
 |
|
heardie
|
|
So close to getting this work..
Okay now
I added this
##################################################
##########
IMPROVE_DROUGHT {
DefaultIcon ICON_IMPROVE_GRANARY
Description DESCRIPTION_IMPROVE_GRANARY
EnableAdvance ADVANCE_AGRICULTURE
ProductionCost 0
Upkeep 0
FoodPercent -0.25
}
##################################################
##########
IMPROVE_GREATWEATHER {
DefaultIcon ICON_IMPROVE_GRANARY
Description DESCRIPTION_IMPROVE_GRANARY
EnableAdvance ADVANCE_AGRICULTURE
ProductionCost 0
Upkeep 0
FoodPercent 0.25
}
##################################################
##########
ANd it crashed saying
'buildings.txt:727: Record does not start with name'
not how can I fix this?
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:14. Apolyton Time is 00:14. |
top of page
|
| archivepost |
|
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
|
|
|
|
|
|