Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
function OnInitID()
Pinopine(PinopineSettings)
-- [[ Markers ]]
-- [[ Squad Groups ]]
-- [[ Entity Groups ]]
end
-- Pinopinetweak script that balances team, increases pop cap, balances resource rates and start resources.
PinopineSettings =
{
MaximumPlayers = 8,
DefaultPlayerPopCap = 200
}
function Pinopine(settings)
local maximumPlayers = settings.MaximumPlayers
local defaultPlayerPopCap = settings.DefaultPlayerPopCap
local playerCount = World_GetPlayerCount()
local team1Size = 0
local team2Size = 0
for i = 1, playerCount do
local currentPlayer = World_GetPlayerAt(i)
local currentTeamId = Player_GetTeam(currentPlayer)
if currentTeamId == 0 then
team1Size = team1Size + 1
else
team2Size = team2Size + 1
end
end
local teamPopCap = (maximumPlayers * defaultPlayerPopCap) / 2.0
local team1PlayerPopCap = math.floor(teamPopCap / team1Size + 0.5)
local team2PlayerPopCap = math.floor(teamPopCap / team2Size + 0.5)
local popCapResourceFactor = defaultPlayerPopCap / 100
local team1ResourceFactor = (maximumPlayers / team1Size / 2.0) * popCapResourceFactor
local team2ResourceFactor = (maximumPlayers / team2Size / 2.0) * popCapResourceFactor
for i = 1, playerCount do
local currentPlayer = World_GetPlayerAt(i)
local currentTeamId = Player_GetTeam(currentPlayer)
local currentFactor = 1.0
-- select the proper factor
if currentTeamId == 0 then
Player_SetPopCapOverride(currentPlayer, team1PlayerPopCap)
currentFactor = team1ResourceFactor
Modify_PlayerResourceRate(currentPlayer, RT_Manpower, math.sqrt(2.41 * (5.3 - team1Size) * (5.3 - team1Size)) / 2)
Modify_PlayerResourceRate(currentPlayer, RT_Munition, math.sqrt(2.41 * (5.3 - team1Size) * (5.3 - team1Size)) / 2)
Modify_PlayerResourceRate(currentPlayer, RT_Fuel, math.sqrt(2.41 * (5.3 - team1Size) * (5.3 - team1Size)) / 2)
else
Player_SetPopCapOverride(currentPlayer, team2PlayerPopCap)
currentFactor = team2ResourceFactor
Modify_PlayerResourceRate(currentPlayer, RT_Manpower, math.sqrt(2.41 * (5.3 - team2Size) * (5.3 - team2Size)) / 2)
Modify_PlayerResourceRate(currentPlayer, RT_Munition, math.sqrt(2.41 * (5.3 - team2Size) * (5.3 - team2Size)) / 2)
Modify_PlayerResourceRate(currentPlayer, RT_Fuel, math.sqrt(2.41 * (5.3 - team2Size) * (5.3 - team2Size)) / 2)
end
local manpower = math.floor(Player_GetResource(currentPlayer, RT_Manpower) * currentFactor + 0.5)
local munition = math.floor(Player_GetResource(currentPlayer, RT_Munition) * currentFactor + 0.5)
local fuel = math.floor(Player_GetResource(currentPlayer, RT_Fuel) * currentFactor + 0.5)
Player_SetResource(currentPlayer, RT_Manpower, manpower)
Player_SetResource(currentPlayer, RT_Munition, munition)
Player_SetResource(currentPlayer, RT_Fuel, fuel)
end
end
-- end of Pinopinetweak script