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

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
vampire_lord
Rebel Sergeant
Rebel Sergeant
Posts: 216
Joined: Thu Mar 20, 2008 7:02 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Mexico City
Contact:

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

Post 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.
User avatar
bobfinkl
Rebel Colonel
Rebel Colonel
Posts: 593
Joined: Sun Jul 13, 2008 9:01 am
Projects :: Lots of unreleased stuff
Games I'm Playing :: Life
xbox live or psn: No gamertag set
Location: The quaint little city gametoast.

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

Post 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, "")
User avatar
vampire_lord
Rebel Sergeant
Rebel Sergeant
Posts: 216
Joined: Thu Mar 20, 2008 7:02 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Mexico City
Contact:

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

Post by vampire_lord »

Thank you, now I only need some equations to balance the rules, any other suggestions are welcome...
Master_Ben
Lieutenant General
Lieutenant General
Posts: 675
Joined: Wed Nov 12, 2008 9:50 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Watching your PC over your shoulder. No, the other sholder....

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

Post 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:
Post Reply