[MODCOMP] Multi-Bonus Building Requirement

TheLopez

Deity
Joined
Jan 16, 2006
Messages
2,525
Location
Oregon
Multi-Bonus Building Requirement Mod
By: TheLopez

Last Updated 08/27/10

Version: v0.4BtS
Patch Compatibility: Beyond the Sword v3.19
MP Compatible: ?
Download Mod v0.4BtS


Version: v0.2w
Patch Compatibility: Warlords v2.0.8.0
MP Compatible: ?
Download Mod v0.2w

Version: v0.1
Patch Compatibility: v1.61
MP Compatible: ?
Download Mod v0.1

Description for BtS:
Spoiler :

This mod changes the behavior of the <PrereqBonuses> tag and adds the
<PrereqOrBonuses> tag that retains the original behavior of the <PrereqBonuses>
tag. Any bonuses added in between the <PrereqBonuses> tag will now be required
to build the building. One of the bonuses added in between the
<PrereqOrBonuses> tag will now be required to build the building. An
<iBonusAmout> tag has also been added to allow the specification of how many
number of bonuses are required of a specific type to build the unit.

For instance the updated castle definition using the new tag and updated tag
looks like:
Code:
      <Bonus>BONUS_STONE</Bonus>
      <PrereqBonuses>
        <PrereqBonus>
          <Bonus>BONUS_IRON</Bonus>
          <iBonusAmount>1</iBonusAmount>
        </PrereqBonus>
      </PrereqBonuses>
      <PrereqOrBonuses>
        <PrereqOrBonus>
          <Bonus>BONUS_GOLD</Bonus>
          <iBonusAmount>1</iBonusAmount>
        </PrereqOrBonus>
        <PrereqOrBonus>
          <Bonus>BONUS_SILVER</Bonus>
          <iBonusAmount>2</iBonusAmount>
        </PrereqOrBonus>
        <PrereqOrBonus>
          <Bonus>BONUS_GEMS</Bonus>
          <iBonusAmount>1</iBonusAmount>
        </PrereqOrBonus>
      </PrereqOrBonuses>


Description for Warlords and Vanilla:
Spoiler :

This mod changes the behavior of the <PrereqBonuses> tag and adds the
<PrereqOrBonuses> tag that retains the original behavior of the <PrereqBonuses>
tag. Any bonuses added in between the <PrereqBonuses> tag will now be required
to build the building. One of the bonuses added in between the
<PrereqOrBonuses> tag will now be required to build the building.

For instance the updated warrior definition using the new tag and updated tag
looks like:

<Bonus>BONUS_STONE</Bonus>
<PrereqBonuses>
<Bonus>BONUS_IRON</Bonus>
</PrereqBonuses>
<PrereqOrBonuses>
<Bonus>BONUS_GOLD</Bonus>
<Bonus>BONUS_SILVER</Bonus>
<Bonus>BONUS_GEMS</Bonus>
</PrereqOrBonuses>

-----Screenshot-----
Spoiler :




-----Notes to Modmakers-----

If you want to use this mod component in your mod I have tried to make things
as easy as possible for you. In the XML files I have added
<!-- Multi-Bonus Building Requirement Start --> and
<!-- Multi-Bonus Building Requirement End --> in all of the places where
changes were made. In the SDK files I have added
// < Multi-Bonus Building Requirement Start > and
// < Multi-Bonus Building Requirement End > in all of the places where
changes were made.

-----Version Information-----
-----v0.4BtS------

- Updated Prereq bonus tag structure to allow the specification of bonus
amounts.

Spoiler :


-----v0.3BtS------

- Updated to be compatible with Beyond the Sword v3.19 patch.

-----v0.2w------

- Updated to be compatible with Warlords v2.0.8.0 patch.

-----v0.1------

- Setup the Multi-Bonus Building Requirement Mod infrastructure

- Updated the <PrereqBonuses> to be <PrereqOrBonuses> instead

- Added the new <PrereqBonuses> tag that allows for multiple bonuses to be
required for building buildings.

- Updated the CIV4BuildingInfos.xml file so all buildings that had multiple
bonuses listed in the <PrereqBonuses> now use the <PrereqOrBonuses> tag
instead.

- As an example of how to use the new tags castles have been updated in the
CIV4BuildingInfos.xml file so it requires stone iron and one of the
following: gold, silver or gems.


-----===Credits & Thanks===-----

- Exavier
Composite Mod - readme.txt format
 
Updated Warlords version to be compatible with the v2.0.8.0 patch.
 
Updated to be compatible with the Beyond the Sword v3.19 patch
 
nice!

say, can you make a tag for units and buildungs that require two bonuses of the same kind?

also, how about decaying resources?

Huh, that should be easy, instead of having a boolean flag I could have a resource count... that shouldn't be that hard.

I am working on converting the multi-bonus unit requirements mod so it is compatible with BtS v3.19 right now and it should be ready in a few hours...

huh, decaying resources, as in you can mine, fish, etc. for a number of turns and then it goes away?
 
Huh, that should be easy, instead of having a boolean flag I could have a resource count... that shouldn't be that hard.

I am working on converting the multi-bonus unit requirements mod so it is compatible with BtS v3.19 right now and it should be ready in a few hours...

sweet! i cant wait, i want it to make units need for instance - 2 oil bonus, 1 isnt enough :)
civ5 , as published, will have some limit on how much you can support an army with just 1 bonues, meaning lets say for a 100 units you need 1 oil, for over then 100 you need 2, so this is kinda alike, but still different. just a thought i had.

huh, decaying resources, as in you can mine, fish, etc. for a number of turns and then it goes away?

yeah exactly, once you mined a resource it will exhausted it self after a few turns (maybe there should be some logic - disappear depends on the game speeds)
once a res' is gone - youll have new resources popping out in another location (1 or more).

cool huh?
 
sweet! i cant wait, i want it to make units need for instance - 2 oil bonus, 1 isnt enough :)
civ5 , as published, will have some limit on how much you can support an army with just 1 bonues, meaning lets say for a 100 units you need 1 oil, for over then 100 you need 2, so this is kinda alike, but still different. just a thought i had.



yeah exactly, once you mined a resource it will exhausted it self after a few turns (maybe there should be some logic - disappear depends on the game speeds)
once a res' is gone - youll have new resources popping out in another location (1 or more).

cool huh?

Yep, decaying resources is really cool...

As for the multi-bonus unit requirements... I am going through all of the SDK/Python/XML code to make sure I catch EVERYTHING... wanna test it before I release it to the public keldath?
 
thanks for the offer lopez, but im swamped with merging sdk,

im busting my head just now on an sdk error. (im merging a mod)... maybe ill have some time tomorrow.

What's the error? And you wouldn't have to test it right now... just some time in the near future (1-3) days.
 
ok, send me the files in a pm ill test it sometime on the weekend, i thought you wanted it fast.

the error,
well, i got a line that the error says its not defined, and when i define it, it gives another un clear error, can you help?
if so im attaching the file - the error is in line 2363 :

Code:
/*****************************************************************************************************/
/**  Author: TheLadiesOgre                                                                          **/
/**  Date: 16.09.2009                                                                               **/
/**  ModComp: TLOTags                                                                               **/
/**  Reason Added: Implement AI_paradrop for other UNITAI's now that it is potentially available    **/
/**  Notes: 14.10.2009-- Added bCity check                                                          **/
/*****************************************************************************************************/
		if (bCity)
		{
			if (AI_paradrop(getDropRange()))
			{
				return;
			}
		}

/*****************************************************************************************************/
/**  TheLadiesOgre; 16.09.2009; TLOTags                                                             **/
/*****************************************************************************************************/

it says that bcity is not defined, but when i add a definition:
Code:
bool bCity = plot()->isCity();
from line 2472,
i get an error concerning
Code:
void CvUnitAI::AI_paratrooperMove()

hope you can help perhaps,
i think i shouldnt have posted this here, ill remove it later after you reply.

cheers.
 

Attachments

  • CvUnitAI.zip
    104.5 KB · Views: 138
ok, send me the files in a pm ill test it sometime on the weekend, i thought you wanted it fast.

the error,
well, i got a line that the error says its not defined, and when i define it, it gives another un clear error, can you help?
if so im attaching the file - the error is in line 2363 :

Code:
/*****************************************************************************************************/
/**  Author: TheLadiesOgre                                                                          **/
/**  Date: 16.09.2009                                                                               **/
/**  ModComp: TLOTags                                                                               **/
/**  Reason Added: Implement AI_paradrop for other UNITAI's now that it is potentially available    **/
/**  Notes: 14.10.2009-- Added bCity check                                                          **/
/*****************************************************************************************************/
		if (bCity)
		{
			if (AI_paradrop(getDropRange()))
			{
				return;
			}
		}

/*****************************************************************************************************/
/**  TheLadiesOgre; 16.09.2009; TLOTags                                                             **/
/*****************************************************************************************************/

it says that bcity is not defined, but when i add a definition:
Code:
bool bCity = plot()->isCity();
from line 2472,
i get an error concerning
Code:
void CvUnitAI::AI_paratrooperMove()

hope you can help perhaps,
i think i shouldnt have posted this here, ill remove it later after you reply.

cheers.

Honestly I would have to have the entire SDk to see what the problem is. I don't see anything wrong... what are the specific errors after you add the bool bCity = plot()->isCity();
 
well,

thats the error i get:
Code:
CvUnitAI.cpp(4520) : error C2601: 'CvUnitAI::AI_cityDefenseMove' : local function definitions are illegal


would you mind checking this thing out?

im attaching the whole sdk,

all you need to do is change the makefile path of you sdk and vc+,
and compile.

maybe you can save me?
 

Attachments

  • CvGameCoreDLL-rv2.8.zip
    2.9 MB · Views: 135
well,

thats the error i get:
Code:
CvUnitAI.cpp(4520) : error C2601: 'CvUnitAI::AI_cityDefenseMove' : local function definitions are illegal


would you mind checking this thing out?

im attaching the whole sdk,

all you need to do is change the makefile path of you sdk and vc+,
and compile.

maybe you can save me?
Looking at it now... compiling...
 
keldath - check your PMs
 
Updated to allow specification of bonus amounts like the Multi-bonus unit requirements mod
 
Top Bottom