Glitch Storm Trooper Corporal
Messages : 408 Registration Date : 2012-04-02 Age : 29 Location : Baktoid Combat Automata
| Subject: [unrésolu]Random Heroes? 12/17/2012, 12:47 pm | |
| I think it would be interesting if I could somehow implement the use of random heroes when plain Phase I or Phase II clones are used. (Excluding the few maps that have Jedi Generals that lead a specific legion) I know that each side can only use 9 different classes at a time. Maybe I'll add all heroes to new sides. hbd hgd Ex: Enter the map Naboo Theed as the Republic and play as Jinn or Kenobi when the hero is unlocked. Does anyone know if this is possible? ------------------------------------------------------------------------------------------------------------------------------------------ Edit: I received a reply from Marth8880 - Marth8880 wrote:
- I don't know how well it would work or if it would work at all, and I've only really tested it once or twice for Unification, but what you could do is create a looping timer that, upon elapse, initiates a math.random function to decide a new hero.
Example: - Code:
-
function DecideSSVHeroClass() CreateTimer("ssv_hero_timer") SetTimerValue("ssv_hero_timer", 45) StartTimer("ssv_hero_timer") ShowTimer("ssv_hero_timer") OnTimerElapse( function(timer) DecideSSVHeroClass = math.random(1,4) print("execute 'decide ssv hero class") if DecideSSVHeroClass == 1 then print("decide ssv hero::decide shepard class") DecideShepClass() -- decide random Shepard class elseif DecideSSVHeroClass == 2 then print("decide ssv hero::samara") SetHeroClass(REP, "ssv_hero_samara") elseif DecideSSVHeroClass == 3 then print("decide ssv hero::jack") SetHeroClass(REP, "ssv_hero_jack") elseif DecideSSVHeroClass == 4 then print("decide ssv hero::legion") SetHeroClass(REP, "ssv_hero_legion") else end SetTimerValue("ssv_hero_timer", 45) StartTimer("ssv_hero_timer") end, "ssv_hero_timer" ) end I'll experiment with this line of code for the time being. I believe that it must be placed in a mission lua file, I will work with it from there and ask for help if nessassary. (Attempting to get at least two heroes working on each side)
Last edited by Glitch on 1/9/2013, 6:04 pm; edited 1 time in total |
|
Glitch Storm Trooper Corporal
Messages : 408 Registration Date : 2012-04-02 Age : 29 Location : Baktoid Combat Automata
| Subject: Re: [unrésolu]Random Heroes? 12/24/2012, 4:56 am | |
| Finally got a chance to try this out. It does not randomize the heroes but you can still choose between them after getting to the class selection menu. I cannot use the number of heroes I was hoping for, each time I add a new one it takes up one of the 3 slots remaining for classes. The additional hero uses the first heroes spawn lines and death lines. I need to find a way to correct this or find a new method. Edit: Ah, another detail I forgot to mention. All heroes have been moved over to the JED side. (I have run into errors, none of which caused this. I've managed to fix them all up to this point) |
|