Freedom Reborn

Freedom Force Forums => Scripting Forum => Topic started by: kiapet on August 29, 2009, 05:44:25 AM

Title: Need help with AI_MakeIntoHero
Post by: kiapet on August 29, 2009, 05:44:25 AM
This is for Freedom Force 1 if it makes any difference.

I am trying to mod a level where Wolverine fights Deadpool to a certain health, then Deadpool joins your squad as a hero.  Deadpool is a villain.  When I use AI_MakeIntoHero, I control him but he acts strange.  None of the bad guys can hurt him.  Attacks go through him, and it doesn't show his name when I mouse over him.

Am I doing something wrong?  Is there some other command that would let me make him into a hero?  It works if I change him to hero in template tab but then he's controllable from the begining.   :banghead:

Thanks!
Title: Re: Need help with AI_MakeIntoHero
Post by: bearded on August 29, 2009, 06:56:03 AM
this is only a guess, but see if 'campaign use only' box is ticked in ffedit.  that box does odd things.  it should be ticked in most cases.
Title: Re: Need help with AI_MakeIntoHero
Post by: kiapet on August 29, 2009, 02:48:57 PM
Yes, it is ticked.  I will try unticking it just in case.  I'm not sure what it does.
Title: Re: Need help with AI_MakeIntoHero
Post by: kiapet on August 29, 2009, 02:52:54 PM
Unfortunately didn't change anything.

Does it mean anything that when I take him into danger room, he works fine?  Anyone know how it turns the first four characters selected into heroes even if there villain class?
Title: Re: Need help with AI_MakeIntoHero
Post by: bearded on August 29, 2009, 03:37:08 PM
see, i've had this problem but it was years ago, so i can't remember.  what is his ai?  you want GAmeObjectMinion not GameObjectVillian.  i remember that was important for some reason.
Title: Re: Need help with AI_MakeIntoHero
Post by: stumpy on August 29, 2009, 06:22:17 PM
One approach to that situation is to create an actual hero version of the character in FFEdit. It can be an exact copy of the baddy character except for name and AI (and you can make him appear to have the same name by using the same name in the strings.txt file). Then, when the baddy version is KOed and comes back to join the squad, use Object_Destroy() on the baddy and then spawn the hero version, who should show up on the squad and be a normal playable character, assuming there are fewer than four heroes on the squad before.
Title: Re: Need help with AI_MakeIntoHero
Post by: kiapet on August 29, 2009, 07:05:37 PM
@Bearded -- tried setting to minion (was villian) but no luck.

@Stumpy -- thanks for the response.  That's my back up plan but I was trying to figure our how to do it without resorting to that.  Doesn't some of the ffx powers work liek that?  Like posession or mimic?  Shouldn't they be able to make a villian/minion into a hero?  MAybe I can borrow from that code??
Title: Re: Need help with AI_MakeIntoHero
Post by: kiapet on August 29, 2009, 07:26:07 PM
Hmm....

I brought Jericho (villain) into the mix.  He could not possess Deadpool.  100% resistance no matter what.

I made a hero version of Jericho.  He possessed Deadpool successfully -- but Deadpool still didn't work right as a hero.  Couldn't mouse over him, couldn't hurt him, etc.

When I "emerged", I lost my Jericho.  He was replaced by the villain version.  But I think that was because I forgot to run FFX Control Centre again so they shared the same complex number.

But that means stealing the ffx code probably won't work.  Looks like the game isn't going to like making villains into heroes.  And if it only lets you make cops into heroes I'll be making an awful lot of extra versions of people.  Is there a limit to how many cna be made?
Title: Re: Need help with AI_MakeIntoHero
Post by: bearded on August 30, 2009, 05:22:25 AM
in my mod, i've gotten it working perfectly.  in the morning i'll post the exact code i use.
Title: Re: Need help with AI_MakeIntoHero
Post by: bearded on August 31, 2009, 04:59:17 AM
bah.  sorry.  i meant tomorrow morning of course.
Title: Re: Need help with AI_MakeIntoHero
Post by: bearded on August 31, 2009, 02:22:48 PM
def GetMercList():
return ["vixen", "sandman", "deathstroke", "creeper", "bronze_tiger", "boomerang", "black_cat", "catwoman", "mystique", "juggernaught", "lobo", "hulk", "white_queen", "elektra", "deadshot", "polaris", "kraven"]

def Merc():
Mission_CustomAction('Mercenary', '', 'building_rundown', 'Call_mercenary', 18, 1)

def Call_mercenary(spawnName, dude):
heroesList = getAllHeroes()
heronum = len(heroesList)
if heronum <= 3:
Campaign_AddPrestige(-100)
heroList = GetMercList()
randMarker = 7
gotoMarker = "hero_" + `randMarker`
dude = heroList.pop(randint(0, len(heroList)-1))
Object_Spawn(dude, dude, gotoMarker)
AI_MakeIntoHero(dude)
NextStage()

this is the whole code, totally works.  i think the problem isn't in your code, but something to do with the setup of your character.
Title: Re: Need help with AI_MakeIntoHero
Post by: kiapet on September 14, 2009, 02:17:53 AM
Thanks, Bearded!!
Title: Re: Need help with AI_MakeIntoHero
Post by: DrMike2000 on September 14, 2009, 03:33:54 PM
I remember AI_MakeIntoHero being buggy, and creating some strange hybrid character who didnt work correctly. If it was used in FFX for Freedom Force 1 ever, it got replaced with the respawn method, Im pretty sure.

In the Freedom Force missions by Irratioanl where they make a character playable half way through (eg Mentor or Eve's intro missions) they do it by destroying the old one and spawning in a hero template - I'd recommend just doing that.