Thread Tools
Old March 8, 2002, 13:05   #1
hexagonian
The Courts of Candle'Bre
Emperor
 
hexagonian's Avatar
 
Local Time: 16:28
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Smemperor
Posts: 3,405
A SLIC request...
Having read the ongoing discussion about small wonders, it sparked an idea in my mind about a related subject - in-game occurances that add atmosphere (Similar to Ben's disaster code). So here is a first step toward that, and if somebody can create this file, feel free to do so.

I'm looking for a series of in-game triggers that occur when a particular advance is completed. Here's the list

10 turns of (+10%) gold - civ wide
Triggering advances
Applied Math/Bureaucracy/Economics

10 turns of (+10%) food - civ wide
Triggering advances
Granaries/Agricultural Revolution

10 turns of (+10%) science - civ wide
Triggering advances
Philosophy/Classical Education/Chemistry

10 turns of (+10%) production - civ wide
Triggering advances
Currency/Machine Tools/Industrial Revolution

10 turns of (+1) happiness - civ wide
Triggering advances
Ethics/Renaissance/Criminal Code

(+10%) population in each city - civ wide
Triggering advances
Architecture/Mechanical Clock/Corporation

5 turns of (-1) happiness - civ wide (this one may be a problem as the AI often gets Slave Labor off the bat, so I am wondering how the code will affect the AI in this situation)
Triggering advances
Slave Labor/Feudalism

One thing though - I am hoping that the AI will benefit from this too, if the code cannot be set up to also affect the AI, then I will reduce the benefit to 5 turns. This code is mainly for ingame atmosphere.

I will need a set of messages for each trigger - hopefully a different message for each event. (For example, I want to avoid a repetitive message for all production bonuses)

And if the creator of this file can quickly test it on the current Cradle setup for SLIC crashes before sending it to me, it would be greatly appreciated.

At the same time, I wouldn't mind have some more negative oriented ones too. I'm open for suggestions.
__________________
Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
hexagonian is offline  
Old March 8, 2002, 14:19   #2
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 22:28
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Isn't this possible by adding to feats.txt?
__________________
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 March 8, 2002, 22:14   #3
hexagonian
The Courts of Candle'Bre
Emperor
 
hexagonian's Avatar
 
Local Time: 16:28
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Smemperor
Posts: 3,405
One small problem though...

Aren't the feats only awarded to the first civ that reaches the advance? I want it for all civs.

I'll have to look at the file.
__________________
Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
hexagonian is offline  
Old March 9, 2002, 08:17   #4
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 23:28
Local Date: October 31, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
Although a fair amount of work, the easiest way might be to simply make 32 different versions of the same feats. Same prereqs and effects, different names...
__________________
Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery
Locutus is offline  
Old March 9, 2002, 09:36   #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: 23:28
Local Date: October 31, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
This should be the slic code for the new feats:

PHP Code:
HandleEvent(GrantAdvance'MG_AccomplishFeats' post {    // when player gets an advance
int_t advanceType;
int_t i;
int_t MGCity;
int_t MGPopAdd;
advanceType value[0];
advance[0] = advanceType;
    if (
advanceType == AdvanceDB(ADVANCE_CURRENCY)
    || 
advanceType == AdvanceDB(ADVANCE_MACHINE_TOOLS)
    || 
advanceType == AdvanceDB(ADVANCE_INDUSTRIAL_REVOLUTION)) {
        
Event:AccomplishFeat(FeatDB(FEAT_PLUS10%_PRODUCTION), player[0]);
        
//AddFeat(featIndex, playerIndex)//no idea if the AccomplishFeat event gives you more than once the same feat, maybe the AddFeat function
    
}
    elseif (
advanceType == AdvanceDB(ADVANCE_APPLIED_MATH)
    || 
advanceType == AdvanceDB(ADVANCE_BUREAUCRACY)
    || 
advanceType == AdvanceDB(ADVANCE_ECONOMICS)) {
        
Event:AccomplishFeat(FeatDB(FEAT_PLUS10%_COMMERCE), player[0]);
    }
//    elseif (advanceType == AdvanceDB(ADVANCE_GRANARIES)
//    || advanceType == AdvanceDB(ADVANCE_AGRICULTURAL_REVOLUTION)) {
//        Event:AccomplishFeat(FeatDB(FEAT_PLUS10%_FOOD), player[0]);
//    }//no idea how to write this feat in feat.txt yet
    
elseif (advanceType == AdvanceDB(ADVANCE_PHILOSOPHY)
    || 
advanceType == AdvanceDB(ADVANCE_CLASSICAL_EDUCATION)
    || 
advanceType == AdvanceDB(ADVANCE_CHEMISTRY)) {
        
Event:AccomplishFeat(FeatDB(FEAT_PLUS10%_SCIENCE), player[0]);
    }
    elseif (
advanceType == AdvanceDB(ADVANCE_ETHICS)
    || 
advanceType == AdvanceDB(ADVANCE_RENAISSANCE)
    || 
advanceType == AdvanceDB(ADVANCE_CRIMINAL_CODE)) {
        
Event:AccomplishFeat(FeatDB(FEAT_PLUS1_HAPPINESS), player[0]);
    }
    elseif (
advanceType == AdvanceDB(ADVANCE_SLAVE_LABOR)
    || 
advanceType == AdvanceDB(ADVANCE_FEUDALISM)) {
        
Event:AccomplishFeat(FeatDB(FEAT_MINUS1_HAPPINESS), player[0]);
    }
    elseif (
advanceType == AdvanceDB(ADVANCE_ARCHITECTURE)//adds 10% population to each city when these advances are discovered
    
|| advanceType == AdvanceDB(ADVANCE_MECHANICAL_CLOCK)
    || 
advanceType == AdvanceDB(ADVANCE_CORPORATION)) {
        
message(player[0],'Feat10%MorePopsPerCity');
        for(
0player[0].cities1) {
        
GetCityByIndex(player[0], iMGCity);
            if(
CityisValid(MGCity)) {
                
MGPopAdd MGCity.population/10;
                
AddPops(MGCityMGPopAdd);
            }
        }
    }
}

messagebox 'FeatPlus10%Production' {
    
Show();
    
Title(ID_FEAT_ACCOMPISHED_TITLE);
    
Text(ID_FEAT_PLUS10%_PRODUCTION);
}

messagebox 'FeatPlus10%Commerce' {
    
Show();
    
Title(ID_FEAT_ACCOMPISHED_TITLE);
    
Text(ID_FEAT_PLUS10%_COMMERCE);
}

messagebox 'FeatPlus10%Sience' {
    
Show();
    
Title(ID_FEAT_ACCOMPISHED_TITLE);
    
Text(ID_FEAT_PLUS10%_SCIENCE);
}

messagebox 'FeatPlus1Happiness' {
    
Show();
    
Title(ID_FEAT_ACCOMPISHED_TITLE);
    
Text(ID_FEAT_PLUS1_HAPPINESS);
}

messagebox 'FeatMinus1Happiness' {
    
Show();
    
Title(ID_FEAT_ACCOMPISHED_TITLE);
    
Text(ID_FEAT_MINUS1_HAPPINESS);
}

messagebox 'Feat10%MorePopsPerCity' {
    
Show();
    
Title(ID_FEAT_ACCOMPISHED_TITLE);
    
Text(ID_FEAT_10%_MORE_POPS_PER_CITY);

This should be the new feats for the feats.txt:

PHP Code:
FEAT_PLUS10%_PRODUCTION {
    
Duration 10
    Description str_ldl_0
    EffectIncreaseProduction 10
    SlicMessage 
"FeatPlus10%Production"
}

FEAT_PLUS10%_COMMERCE {
    
Duration 10
    Description str_ldl_0
    EffectIncreaseCommerce 10
    SlicMessage 
"FeatPlus10%Commerce"
}
FEAT_PLUS10%_SCIENCE {
    
Duration 10
    Description str_ldl_0
    EffectIncreaseScience 10
    SlicMessage 
"FeatPlus10%Sience"
}

FEAT_PLUS1_HAPPINESS {
    
Duration 10
    Description str_ldl_0
    EffectIncreaseHappiness 1
    SlicMessage 
"FeatPlus1Happiness"
}

FEAT_MINUS1_HAPPINESS {
    
Duration 5
    Description str_ldl_0
    EffectIncreaseHappiness 
-1
    SlicMessage 
"FeatMinus1Happiness"

Note that this will only work if the AccomplishFeat event gives you more than once the same feat or the AddFeat function will do this job otherwise we have to find a work around for it. At least the 10 plus pop code will work, oh and of course so far the code is NOT tested therefore it can be still buggy and the strings for the new feat message boxes are missing.

And finnaly here are all the flags that can be used in the feats.txt.

-Martin

Code:
Duration
Description
SlicMessage
SlicMessageValue
EffectBoatMovement
EffectBoatMovementValue
EffectCityDefenseBonus
EffectCityDefenseBonusValue
EffectReduceCityWalls
EffectReduceCityWallsValue
EffectIncreaseCityVision
EffectIncreaseCityVisionValue
EffectIncreaseProduction
EffectIncreaseProductionValue
EffectIncreaseCommerce
EffectIncreaseCommerceValue
EffectIncreaseHappiness
EffectIncreaseHappinessValue
EffectEliminateDistancePenalty
EffectEliminateDistancePenaltyValue
EffectIncreaseBoatVision
EffectIncreaseBoatVisionValue
EffectIncreaseScience
EffectIncreaseScienceValue
EffectGiveMaps
EffectIncreaseHitPoints
EffectIncreaseHitPointsValue
EffectScriptedTurn
EffectScriptedTurnValue
EffectScriptedCity
EffectScriptedCityValue
ExcludeAdvance
ExcludeWonder
ExcludeFeat
ExcludeFunction
ExcludeFunctionValue
CancelAdvance
CancelWonder
CancelFeat
CancelFunction
CancelFunctionValue
Building
BuildingValue
MinimumSizeOfCiv
MinimumSizeOfCivValue
PS: The slic file and the modified feats.txt is on the way to you Dave.
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old March 9, 2002, 09:57   #6
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 23:28
Local Date: October 31, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
Good one, Martin, should have thought of that one myself
__________________
Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery
Locutus is offline  
Old March 9, 2002, 10:27   #7
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 22:28
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
That would be by far the simplest way if it works. Otherwise adding food and production is a pain.


Though that does only give one message per feat, you'd need three times as many feats to have individual messages for each advance.
__________________
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 March 9, 2002, 12:16   #8
hexagonian
The Courts of Candle'Bre
Emperor
 
hexagonian's Avatar
 
Local Time: 16:28
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Smemperor
Posts: 3,405
Well, the limited message thing is something I can live with...It's more of a luxury to have separate messages.

Still, this looks good and is what I am looking for. I'll post this as an new Modswapper option next week.
__________________
Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
hexagonian 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 17:28.


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