1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[Mod Development] Diplomacy Insults

Discussion in 'Civ4Col - Creation & Customization' started by Kailric, Jul 16, 2009.

?

Do you want to tell the King where to put his ring?

  1. Yes, I would love to.

    15 vote(s)
    93.8%
  2. Nay, not for me. Long live the King!

    1 vote(s)
    6.3%
  1. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    This change is already in my recent release of Privateers, Pirates, and Buccaneers. Do you have your own custom Mod you play? If so I could show you had to add this change?
     
  2. Nixeh

    Nixeh Chieftain

    Joined:
    May 19, 2009
    Messages:
    25
    Any idea if that live map is poss at all Kailric
     
  3. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone

    Anything is possible :) But I am a novice so I may not can figure out somethings. So you want a diplomacy contract option that allows you to what .. see each others units and the inside of cities but your are not allies?

    Do ya'll play Vanilla or do you use a mod when you play?
     
  4. Nixeh

    Nixeh Chieftain

    Joined:
    May 19, 2009
    Messages:
    25
    Yeah pretty much bang on there.

    I play AOD 2 v1.11
     
  5. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    I'll check into it sometime tonight and tomorrow and see what I can do. Do you know how to merge mods? I can just post the SDK changes and stuff and you can merge them with AOD?
     
  6. Nixeh

    Nixeh Chieftain

    Joined:
    May 19, 2009
    Messages:
    25
    think its relatively simple
     
  7. Nixeh

    Nixeh Chieftain

    Joined:
    May 19, 2009
    Messages:
    25
    Had a gander through a fair few xml files and a scan through some of the DLL files, but couldnt find where Permanent Alliance was defined and where/how it was structured. Im hoping its structured in such a way that it stacks the attributes that are enabled whilst in permanent alliance. If so it means that it could be possible to just add in the extra options by breaking down the permanent alliance.
     
  8. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    I haven't played any multiplayer and I am not sure if the AI asks to do Pernament Alliances but I couldn't figure out much either. I know if you are both on the same team you can see each others plots. So I am assuming makeing a Pernament Alliance puts you on the same team.

    Anyway, I wrote the below code that will make it so that all Human players see each other's units, or see what they see. It worked for me with the AI units, so it should work with Humans by setting the "isHuman()" tag. If you know how to edit and build the SDK then just add add this code to the CvPlot.cpp file.


    Code:
    void CvPlot::changeAdjacentSight(TeamTypes eTeam, int iRange, bool bIncrement, CvUnit* pUnit)
    {
    	if(pUnit != NULL)
    	{
    		if(!pUnit->isOnMap())
    		{
    			return;
    		}
    	}
    //tk
    if (pUnit != NULL)
        {
            if (pUnit->isHuman())
            {
                for (int iI = 0; iI < MAX_PLAYERS; iI++)
                {
                    if (((PlayerTypes)iI) != pUnit->getOwner())
                    {
                    
                        if (GET_PLAYER((PlayerTypes)iI).isAlive())
                        {
                            if (GET_PLAYER((PlayerTypes)iI).isHuman())
                            {
                                pUnit->plot()->changeAdjacentSight(GET_PLAYER((PlayerTypes)iI).getTeam(),  iRange, bIncrement, NULL);
                            }
                        }
                    }
                }
            }
        }
        //tkend
     
  9. Nixeh

    Nixeh Chieftain

    Joined:
    May 19, 2009
    Messages:
    25
    On occasion the AI ask to permy it up.

    Sadly my knowledge of all things code is very limited. I can read it but when it comes down to writing my own stuff and compiling, i havent done it.

    How easy would this be to add to a current mod?
     
  10. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Really easy if you can build DLLs. Just pop that code in the right file, build the DLL, pop that in your mod and there you go.
     
  11. Nixeh

    Nixeh Chieftain

    Joined:
    May 19, 2009
    Messages:
    25
    Im downloading visual studio as we speak but its taking a fair while to do so. Im assuming it cant be as easy as just altering it via notepad and then testing it?
     
  12. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    I use codeblocks. You need a way to build the DLL and notepad can't do that. You can edit in notepad though, but I use the free codeblocks. There is an excellent tutorial here for Codeblocks here:


    http://forums.civfanatics.com/showthread.php?t=166933
    Its for Civilization but works just the same.

    Edit: if you can't figure it out I can prolly do it for you when I get the chance. You will need to put the AODII source code in the SDK then edit the file, then build the DLL.
     

Share This Page