hey there,
anyone here who is familiar with the ai hero support script? I know there is that ZZZ mod that adds hero support to all stock maps by using new mission files. But i'd like a more general solution using a user script that overwrites the old functions, so ANY map will support the ai heros.
But i'm not a mission scripter, so if someone could explain me how the old hero setup was done compared to the "new" one or if someone had an example script that uses AI heros, that would be very helpfull.
Help with the AIhero script
Moderator: Moderators
- Anakin
- Master of the Force
- Posts: 4817
- Joined: Sat Sep 19, 2009 11:37 am
- Projects :: RC Side Mod - Remastered - SWBF3 Legacy
- Location: Mos Espa (germany)
-
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: Help with the AIhero script
Normal heroes are implemented with SetHeroClass. Usage:
Archer's AI hero support script implements random heroes like so:
You instantiate AIHeroSupport into a new variable (much like you do with objectives), then calls its custom version of SetHeroClass to set the hero classes. The hero spawning is handled entirely via script logic. Where they're spawned is determined with the AddSpawnCP function, which takes the following arguments:
Then finally, the script logic is started by calling Start (duh).
Code: Select all
SetHeroClass(teamId, heroClassName)
Code: Select all
herosupport = AIHeroSupport:New{AIATTHeroHealth = 4000, AIDEFHeroHealth = 4000, gameMode = "NonConquest",}
herosupport:SetHeroClass(REP, "rep_hero_plokoon")
herosupport:SetHeroClass(CIS, "cis_hero_grievous")
herosupport:AddSpawnCP("cp1", "cp1_spawn")
herosupport:AddSpawnCP("cp2", "cp2_spawn")
herosupport:Start()
Code: Select all
AddSpawnCP(cpName, spawnPathName)