Any way for Civs to meet without the Diplo screen popup in LUA?

sman1975

Emperor
Joined
Aug 27, 2016
Messages
1,370
Location
Dallas, TX
Hello,

I'm working on a WW2 scenario that can be played on any map. It keeps the WW2 Civs, Units, Techs, etc. from my World at War scenario, but won't be tied to any specific map.

As the scenario is set in the 1930's, one can assume the world map is completely known and all the Civs already have long-since met. Here is the code:

Code:
function CustomizedInitialMeetups()                                                            -- Function ensures all playable Civs have already met at game start
    for iDX = 0, GameDefines.MAX_MAJOR_CIVS-1 do                                            -- Loop through all major players
        local pPlayer = Players[iDX]                                                        -- Set up the loop player pointer
        if pPlayer and pPlayer:IsAlive() then                                                -- If player is alive (at GT 0), then...     
            for iDY = iDX + 1, GameDefines.MAX_MAJOR_CIVS-2 do                                -- Loop through all major players
                if (Players[iDY]:IsAlive()) and (iDX ~= iDY) then                            -- If the inner loop player is alive and not the same as the outer loop player, then...
                    Teams[pPlayer:GetTeam()]:Meet(Teams[Players[iDY]:GetTeam()]:GetID(), false)        -- Introduce inner and outer loop players
                end
            end
        end
    end
end

It works fine, except at the start of the game, you get to see each of the AI Civ's Diplo screen and hear that leader's First Greeting response. In a game with 19 Civs, this is a bit of a click-fest to start a game.

Is there any other way to have Civs meet each other before game starts and not have to see all these smiling faces?

Thanks!
 
Code:
  <api object="Team" method="Meet">
      <arg pos="2" type="TeamTypes" name="eOtherTeam"/>
      <arg pos="3" type="bool" name="bSuppressMessages"/>
      <ret type="void"/>
  </api>
Have you tried true for the second argument ?

Also, erm
Code:
Teams[Players[iDY]:GetTeam()]:GetID()
 
Hi, @LeeS - yes, I've tried True, False, and leaving it blank. Even tried 1 and 0 as the second argument. None of these prevented the Diplo popups. I've looked at the scenarios from the game that use a map script, and all of them use this Meet method at game start to introduce players. It's not a huge problem, but still seems odd that you can't suppress this.

BTW: where did you get the content of your first insert? Man, that looks helpful!
 
It's from William Howard's reference thread on lua methods shown as xml print-outs.

I couldn't find the thread so here's the "mod" he made the output into:
 

Attachments

  • BNW_LUA_API_as_XML.zip
    55.6 KB · Views: 52
Last edited:
WOW! :eek: Man, is this quite the resource. Appreciate sending it my way. Can really help answer a lot of "guessing" when dealing with Method arguments. Thanks!
 
Top Bottom