Plot.SetResourceType (Civ5 API)

From Civilization Modding Wiki
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of Plot.

This is an instance method, invoke it with a colon.
Puts a resource on this plot.


Usage

void Plot:SetResourceType(ResourceType resourceID, int numResource)


Parameters

resourceID: The integer ID of the resource to place.
numResource: For strategic resources, this is the amount of that resource to place.


Source code samples

Redundant occurences have been removed.

Amazon_XP.lua (G&K)

DLC/Expansion/Maps/Amazon_XP.lua
1421
res_plot:SetResourceType(selected_ID, selected_quantity);


AssignStartingPlots.lua (G&K)

DLC/Expansion/Gameplay/Lua/AssignStartingPlots.lua
3492
plot:SetResourceType(self.banana_ID, 1);
3497
plot:SetResourceType(self.deer_ID, 1);
3502
plot:SetResourceType(self.sheep_ID, 1);
3509
plot:SetResourceType(self.cow_ID, 1);
3514
plot:SetResourceType(self.wheat_ID, 1);
3541
plot:SetResourceType(self.fish_ID, 1);
3610
plot:SetResourceType(choice, 2);
3613
plot:SetResourceType(self.iron_ID, 2);
3789
plot:SetResourceType(self.stone_ID, 1);
7506
res_plot:SetResourceType(res_ID[use_this_res_index], res_quantity[use_this_res_index]);
7663
res_plot:SetResourceType(resource_ID, quantity);
8930
res_plot:SetResourceType(self.marble_ID, 1);
9146
res_plot:SetResourceType(self.fish_ID, 1);


WorldBuilderRandomItems.lua

Gameplay/Lua/WorldBuilderRandomItems.lua
0173
plot:SetResourceType(resourceID, resourceNum);
0188
otherPlot:SetResourceType(resourceID, resourceNum);


WorldView.lua

UI/InGame/WorldView/WorldView.lua
0190
plot:SetResourceType(g_ResourcePlopper.ResourceType, g_ResourcePlopper.ResourceAmount);
0196
plot:SetResourceType(-1);
0280
plot:SetResourceType(iResourceID, 5);



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.