Please Help

Everything about mods can be found here.

Moderator: Morax

Please Help

Postby rockoe10 » 17 Oct 2013, 13:30

Hi, So i wanted to make a Handicap mod for me and my friends. We aren't all the same rank and want to balance the game when we play each other without having to have the more experienced players hold back. So I thought I could make a handicap mod that would make a particular faction stronger or weaker mainly through the ACU's resource production in the beginning of the game. To do this, and make it easy to modify on each computer (not good at making sophisticated mods like Phantom with a voting system), i wanted to use a hook rather than just including a .bp file for each ACU. But I can't get it to work...again... Any help or advice would be much appreciated.

Below is my code:

--#****************************************************************************
--#**
--#** Hooked To: /lua/system/blueprints.lua
--#**
--#** Modded By: Rockoe
--#**
--#*********************************************************************

HandicapPercentAeon = 1
HandicapPercentUEF = 1
HandicapPercentCybran = 1
HandicapPercentSeraphim = 1

local Handicap = function(all_bps)
for _, bp in all_bps do

-- Aeon Handicap
if bp.Categories.COMMAND and bp.Categories.AEON then

if bp.Economy.ProductionPerSecondEnergy then
bp.Economy.ProductionPerSecondEnergy = bp.Economy.ProductionPerSecondEnergy * HandicapPercentAeon
end
if bp.Economy.ProductionPerSecondMass then
bp.Economy.ProductionPerSecondMass = bp.Economy.ProductionPerSecondMass * HandicapPercentAeon
end
end
-- END Aeon Handicap

-- UEF Handicap
if bp.Categories.COMMAND and bp.Categories.UEF then

if bp.Economy.ProductionPerSecondEnergy then
bp.Economy.ProductionPerSecondEnergy = bp.Economy.ProductionPerSecondEnergy * HandicapPercentUEF
end
if bp.Economy.ProductionPerSecondMass then
bp.Economy.ProductionPerSecondMass = bp.Economy.ProductionPerSecondMass * HandicapPercentUEF
end
end
-- END UEF Handicap

-- Cybran Handicap
if bp.Categories.COMMAND and bp.Categories.CYBRAN then

if bp.Economy.ProductionPerSecondEnergy then
bp.Economy.ProductionPerSecondEnergy = bp.Economy.ProductionPerSecondEnergy * HandicapPercentCybran
end
if bp.Economy.ProductionPerSecondMass then
bp.Economy.ProductionPerSecondMass = bp.Economy.ProductionPerSecondMass * HandicapPercentCybran
end
end
-- END Cybran Handicap

-- Seraphim Handicap
if bp.Categories.COMMAND and bp.Categories.SERAPHIM then

if bp.Economy.ProductionPerSecondEnergy then
bp.Economy.ProductionPerSecondEnergy = bp.Economy.ProductionPerSecondEnergy * HandicapPercentSeraphim
end
if bp.Economy.ProductionPerSecondMass then
bp.Economy.ProductionPerSecondMass = bp.Economy.ProductionPerSecondMass * HandicapPercentSeraphim
end
end
-- END Seraphim Handicap

end
end

local OldModBlueprints = ModBlueprints
function ModBlueprints(all_blueprints)

OldModBlueprints(all_blueprints)

Handicap(all_blueprints.Unit)
end

--]]


My dream is to have a mod that could find each player in a game (maybe through their positions on the map) and in game have it voted on (or just set by the lobby) how much of a handicap that player would get.
ZeP: doesn't matter if it's an avatar, a trophy or a collection of dead cats
ZeP: it's the same code
User avatar
rockoe10
Avatar-of-War
 
Posts: 299
Joined: 05 Jan 2013, 05:09
Has liked: 36 times
Been liked: 17 times
FAF User Name: Rockoe10

Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest