Page 1 of 1

LUA+Hero+Balance Question, I need some details.

Posted: Wed Dec 10, 2008 10:53 pm
by vampire_lord
I have been playing for long and modding for a while, there has been always the eternal quest for balance in our mods, either by tweaking a unit's arsenal or even tunning down some stuff, but sometimes having the enemy hero wandering around when your team is losing tends to be unfair, so my question is the same as before.

Can we make script to do something like this?

If team X has equal or more than 50% advantage over team Y (being reinforcements count, command posts, flag points, elimination kills, etc.) disable heroes for team X until advantage equals 10% or less.

That might sound a little complicated, conquest being the more complex with CPs and Reinforcements, one team could have the lead by reinforcements but only one CP left, pretty unfair to not have a hero, it may require to declare an internal variable for CPs and reinforcements to add their values and make them count as 100/100 and recalculate every time heroes are enabled... or something like that.

Anyway, just tell me if that's possible, if not then I might consider using the AI hero to spawn as long as there is a player hero on the battlefield, but you know that's not always effective.

Thanks.

Re: LUA+Hero+Balance Question, I need some details.

Posted: Wed Dec 10, 2008 11:03 pm
by bobfinkl
I'm almost 100% sure you can get this to work, I don't have the specific code but I think it would be something like this (note this is not with all the triggers and such to activate it this just tells the game if team 1 gets under 10 reinforcements disable team 2 hero).

Code: Select all

ATT_ReinforcementCount = GetReinforcementCount(ATT)
if ATT_ReinforcementCount < 10 then
SetHeroClass(ALL, "")

Re: LUA+Hero+Balance Question, I need some details.

Posted: Thu Dec 11, 2008 6:53 pm
by vampire_lord
Thank you, now I only need some equations to balance the rules, any other suggestions are welcome...

Re: LUA+Hero+Balance Question, I need some details.

Posted: Thu Dec 11, 2008 10:28 pm
by Master_Ben
GetTeamPoints

Use that code instead of getreinforcementcount to get, well, team points.

EDIT: Ooh, i just got another one, Its a bit extreme. :) Use DeleteAIGoal to delete its goal to capture cp's and use a code like

reeinforcementcountATT-reinforcementcountDEF>50 then DeleteAIGoal(ATT,capturecps)

And then another code
reeinforcementcountDEF-reinforcementcountATT>50 then DeleteAIGoal(DEF,capturecps)

Then to reinstate the goal, add something like

reeinforcementcountATT-reinforcementcountDEF<50 then AddAIGoal(ATT,capturecps)
reeinforcementcountDEF-reinforcementcountATT<50 then AddAIGoal(DEF,capturecps)

This Is a plan of course and you'd have to add more to the lua like getting info and stuff. Wow thats a lot. :lol: :lol: :lol: