Used Ships (DLL-Diplo-Dialogue with King) [IMPLEMENTED]

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,637
Location
Stuttgart, Germany
Hi guys,

I implemented this small feature, simply because I had this idea today.
(It was just for fun, because I had a bit of time today.)

---------

Used Ships
(Available through DLL-Diplo-Dialogue with King)

From time to time, you may ask the King to help you find cheap used ships - similar to you being able to ask for troops.
(You actively have to ask him to do so, it is not an automatic event that pops up.)

These Ships are incredibly good bargains but you can not chose which Type of Ship you want.
You either take what you get offered or leave it be. Then have to wait until another offer gets available again.

If you accept his offer the Ship will wait ready for you in Europe.
(But it is damaged and you have to bring it to one of your Cities in the New World to fully repair its "Negative Promotion".)

---------

Most of the time the King will offer you Trade Ships. (e.g. Fluyt)
But from time to time he will also offer you a War Ship. (e.g. Ship of the Line)

So it is really worth checking it from time to time.

---------

Just for clarification:
The negative Promotion it comes with can only be repaired in one of your Cities.
(You simply need to have it heal a bit and then it is ready to go again just as new.)

---------

Pro:
Much cheaper than if you buy them new.
Also the new Ship already comes with a bit of XP.

(Small Cons)
You are not free to decide which Type of Ship you get offered.
They come damaged and with negative Promotions that have to be healed first.

Otherwise:
There are no negative consequences attached to asking the King for these Ships.

---------

If you ask him and he helps you find an offer, a timer will start no matter if you accept or decline.
(I wanted to prevent that this feature might become an exploit. So you may only buy these Used Ships in average every 30 turns.)

The price you get offered also depends on his Attitude towards you.
If he likes you, you get better deals and vice versa.

Once you start War of Independence, the feature cannot be used anymore of course.

---------

Explanation:

It creates some incentive to sometimes buy Ships you normally would not buy.
(Simply because from the price offer you get is so good and the Ship already having a bit of XP making it attractive.)

Also especially in the early game it creates an incentive to actively interact with your King.
(You really have to actively ask for these offers, similar to requesting troops.)

----------

XML settings to customize:

Spoiler :

Code:
    <!-- USED SHIPS -->
    <Define>
        <DefineName>FIRST_TURN_USED_SHIPS_AVAILABLE</DefineName>
        <iDefineIntVal>10</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>USED_SHIP_TIMER</DefineName>
        <iDefineIntVal>30</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>MIN_DISCOUNT_USED_SHIP_PERCENT</DefineName>
        <iDefineIntVal>20</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>MAX_DISCOUNT_USED_SHIP_PERCENT</DefineName>
        <iDefineIntVal>50</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>MIN_XP_SPAWNING_USED_SHIPS</DefineName>
        <iDefineIntVal>1</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>MAX_XP_SPAWNING_USED_SHIPS</DefineName>
        <iDefineIntVal>3</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>MIN_DAMAGE_PERCENT_USED_SHIPS</DefineName>
        <iDefineIntVal>25</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>MAX_DAMAGE_PERCENT_USED_SHIPS</DefineName>
        <iDefineIntVal>75</iDefineIntVal>
    </Define>


----------

Summary:

It is just for a bit of flavour and diversity.
So from time to time check out the offers of your King.

-----------

Comment for new modders:

Stuff like this is actually pretty simple once you understand how DLL, Python and XML are applied together in Civ4Col modding.
When I tried something like this the first time (for Native Mercenaries) it took me 3 to 4 days to figure out how it worked and finish it.

Now I need about 4 hours in average for a new Dialogue like this.
(About 2 hours more maybe if I need to figure out good AI logic.)

------------

Reminder to myself:
Still have to write a small piece of AI logic to have AI use this feature as well.
(Most likely it will get most of its Ships like this in early game, in late game however not use it anymore at all.)

Edit:
AI logic is now implemented as well.
(see post below)
 

Attachments

  • Civ4ScreenShot000.JPG
    Civ4ScreenShot000.JPG
    201.8 KB · Views: 102
  • Civ4ScreenShot0001.JPG
    Civ4ScreenShot0001.JPG
    196.3 KB · Views: 77
  • Civ4ScreenShot0002.JPG
    Civ4ScreenShot0002.JPG
    208.2 KB · Views: 77
  • Civ4ScreenShot0003.JPG
    Civ4ScreenShot0003.JPG
    228.8 KB · Views: 84
Last edited:
@devolution
I added AI logic for "Used Ships".

Maybe you want to check it. :dunno:
(If you feel it needs to be improved, let me know.)

It is this method here:
void CvPlayer::doAILogicforUsedShipDeals()

Edit:

Further improved the AI logic and now AI uses exactly the same game rules as Human for this feature.
(It is also tested ingame and AI can handle it nicely - meaning it also acquires Used Ships from time to time.)

Summary:
Feature fully done inlcuding AI.
:)
 
Last edited:
I also added a Message to the Event Log whenever a Used Ship gets available to be sold.
(It is silent however - so there is no annoying message popping up on the screen - you really have to look into the Event Log.)
 

Attachments

  • Civ4ScreenShot0004.JPG
    Civ4ScreenShot0004.JPG
    442.7 KB · Views: 77
Last edited:
hmm:think: will this be displayed in the message list at the top center of the screen? if yes, then it's not a problem.
but it would be nice to highlight keywords with color.
 
hmm:think: will this be displayed in the message list at the top center of the screen? if yes, then it's not a problem.
but it would be nice to highlight keywords with color.
Well ok, as you wish.

 

Attachments

  • Civ4ScreenShot0004.JPG
    Civ4ScreenShot0004.JPG
    208.1 KB · Views: 67
Top Bottom