Few More Buildings for VP

@gwennog I heard your Ski Resort is not compatible with Trade Opportunities. Here is what you have to add to it to be:
upload_2020-12-9_22-21-9.png

Can you verify it? It should look like this:
Spoiler Help texts for luxuries: :


This is also note is for anyone who is adding nw luxury resource in VP modmod.
 
Last edited:
@gwennog I heard your Ski Resort is not compatible with Trade Opportunities. Here is what you have to add to it to be:
View attachment 577926
Can you verify it? It should look like this:
Spoiler Help texts for luxuries: :


This is also note is for anyone who is adding nw luxury resource in VP modmod.

No problem, I will see this this weekend.
Sorry for the gene.
 
@gwennog I heard your Ski Resort is not compatible with Trade Opportunities. Here is what you have to add to it to be:

Can you verify it? It should look like this:
Spoiler Help texts for luxuries: :

This is also note is for anyone who is adding nw luxury resource in VP modmod.


Ski Resort corrected but I'm not sure of the result

Spoiler View 1 :
upload_2020-12-10_22-15-32.png


Texts seems OK but resources are unavailable while the civ has it.

Spoiler View 2 :
upload_2020-12-10_22-18-5.png


shown by monopoly view

Spoiler View 3 :
upload_2020-12-10_22-20-35.png
 
Can you check if the same "unavailable" problem is with the Tern Egg from More Wonders or some resources from Even More Resources? I have no computer now, so I cannot check that by myself :( Download latest TOfVP version.
 
  • Write "Monopoly Bonus". It's important for the code.
  • And if there's no bonus, write simple: none. It saves the screen area if there are more luxuries on the list. Less text is better. You can see it on my previous post with Spoiler.
1. Maybe mod load order affects this? Check if mods adding resources are loaded before TO.
2. How the Shrimp resource works? Is it placed on map?
3. If you have some spare time and want to check what's going on then you can do one more thing for me. "Unavailable" status is set when this code (in /UI/DiploTradesStatus.lua file):
Code:
if IsAvailableLuxury(eResource) and IsVisibleUsefulResource(eResource, pActivePlayer) then
returns false, so either resource is not on the overall list of available resource or is not treated as visible (player must have it or be near it). You can print out (one line earlier put
Code:
print(eResource, IsAvailableLuxury(eResource), IsVisibleUsefulResource(eResource, pActivePlayer))
) to see which one of those two returns false and see it in lua.log. But first check Tern Egg and Even More Resources if possible.
  • eResource in log is id of resource. Must be checked in SQLite. Check for both resources (Shrimp, Muled Wine).
  • if second parameter is false then check why it is false in the same way;
Code:
if IsPlayerHasResource(pPlayer, eResource) or IsPlayerNearResource(pPlayer, eResource) then


If something is wrong I will think of solution.
Crap, I want my comp back :(
 
Last edited:
2. How the Shrimp resource works? Is it placed on map?

Shrimp are place on map by lua

Spoiler Code :
Code:
function C15_Senshi_SeaResources(playerID, plotX, plotY)
    local player = Players[playerID]
    if (not player:IsAlive()) then return end
    if (not HasTrait(player, traitCajunID)) then return end
    local plot = Map.GetPlot(plotX, plotY)
    local city = plot:GetPlotCity()
   
    local tPlots = {}
   
    for adjacentPlot in PlotAreaSweepIterator(plot, 3, SECTOR_NORTH, DIRECTION_CLOCKWISE, DIRECTION_OUTWARDS, CENTRE_EXCLUDE) do
        if (adjacentPlot:GetOwner() == -1 or adjacentPlot:GetOwner() == player:GetID()) then
            if ((adjacentPlot:IsCoastalLand() and adjacentPlot:GetFeatureType() == GameInfoTypes.FEATURE_MARSH) or (adjacentPlot:GetTerrainType() == GameInfoTypes["TERRAIN_COAST"] and adjacentPlot:GetFeatureType() == -1) or adjacentPlot:GetFeatureType() == GameInfoTypes["FEATURE_LAKE_VICTORIA"]) and adjacentPlot:GetResourceType() == -1 then
                table.insert(tPlots, adjacentPlot)
            end
        end
    end
   
    if #tPlots > 0 then
        local tRandom = {1,2,2,2,2,2,3,3}

        local iRandom = tRandom[JFD_GetRandom(1, #tRandom)]
        if iRandom > #tPlots then iRandom = #tPlots end

        for iNum = 1, iRandom do
            local iPlot = JFD_GetRandom(1, #tPlots)
            local plot = tPlots[iPlot]
            plot:SetResourceType(resourceShrimpID, 1)
            table.remove(tPlots, iPlot)

            if player:IsHuman() then
                local sResource = Locale.ConvertTextKey("TXT_KEY_RESOURCE_SHRIMP")
                local sCity = city:GetName()

                local sTooltip = Locale.ConvertTextKey("TXT_KEY_MISC_YOU_DISCOVERED_RESOURCE", sResource, sCity)
                local sTitle = Locale.ConvertTextKey("TXT_KEY_NOTIFICATION_SUMMARY_FOUND_RESOURCE", sResource)
                player:AddNotification(NotificationTypes.NOTIFICATION_DISCOVERED_LUXURY_RESOURCE, sTooltip, sTitle, plot:GetX(), plot:GetY(), resourceShrimpID, -1)
            end
           
        end
    end  

end

GameEvents.PlayerCityFounded.Add(C15_Senshi_SeaResources)

3. If you have some spare time and want to check what's going on then you can do one more thing for me. "Unavailable" status is set when this code (in /UI/DiploTradesStatus.lua file):

When Shrimp appear, print test returns : Nil True
Resource is not on the overall list of available resource :undecide:

But first check Tern Egg
It's OK, available and visible

Resources placed at the start of the game or by a building are OK.
But since a reload makes a resource added by lua available, is that it's correctly introduced in the SQL base (I checked, it's the case) but either something is missing in my code, or it there is a bug. Do you have an idea?
 
It creates the list on game launch and unfortunately code cannot check lua stuff. So after restart table is recreated when resource is already placed on map (not only virtually in lua) so it becomes correctly processed. I will look into this.

What about Muled Wine?
 
It creates the list on game launch and unfortunately code cannot check lua stuff. So after restart table is recreated when resource is already placed on map (not only virtually in lua) so it becomes correctly processed. I will look into this.

Can be a way to enter the resource into the table when civilization loads, at start.
I want to try 4UC and saw that the Inca have a luxury resource (Coca) added by lua, should that be the same problem?

What about Muled Wine?
I modified the text as requested but I haven't tested, it is the same functionality as Tern Egg so it should work.
On the other hand it starts after TO, I will ask to @Asterix Rage if we can assign a number to the pack like (10) -
 
Code checkes resources on map, added via building (2 sql functions), added via CS and from Civs like Indonesia.

This can be no relation to load order.
Indonesia is a value in the resource table for pepper etc. in the civ column if I recall correctly. If you add this value and it will work, then I will add some info in TO OP.

I suppose Coca is recognized by building but im not sure.
 
Last edited:
Also, I believe <Name>Ski Resort for VP</Name> should match with the folder name.

EDIT. That's what I did with (9a)EAW to have it loaded before modmods
I think load order is not dependent on alphabet unfortunately.
 
I'm sure of nothing but some test tell me yes... some others tell me no !

After multiple attempts, I almost sure that the alphabet changes the positioning.
Whether it is the .modinfo name or the mod name in the .modinfo, the ranking effect looks the same.

Two tests :

Change just the .modinfo name

Spoiler change .modinfo name :
upload_2020-12-12_21-29-57.png


and lua1.log

Change just the mod name in the .modinfo

Spoiler Change just the mod name in the .modinfo :
upload_2020-12-12_21-34-8.png


and the lua2.log

Either way, 10 is not a good idea :nono:
 

Attachments

  • Lua1.7z
    5.1 KB · Views: 34
  • Lua2.7z
    5.1 KB · Views: 49
Top Bottom