Freedom Reborn

Freedom Force Forums => Scripting Forum => Topic started by: bearded on April 09, 2009, 07:29:20 PM

Title: randomizing the list for ffx
Post by: bearded on April 09, 2009, 07:29:20 PM
is there a way to randomize the template lists for the ffx in some of the custom attributes, such as; private army, guardian angel, summon ally?

as a custom spawn i have this:
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()

and i see in private army the variables are called 'name', and 'template'.  how could i substitute the above with a merc list and the variable dude with the private army name?  could i simply insert the above in the ffxS code?  maybe something to do with 'getarmyname'?
Title: Re: randomizing the list for ffx
Post by: Epimethee on April 16, 2009, 02:24:43 AM
> is there a way to randomize the template lists for the ffx in some of the custom attributes, such as; private army, guardian angel, summon ally?
Yes, we can! ...err, sorry, yes, it is possible, but you'll need to customize the code (say, by adding checks for a name being "random" or, more usefully, a list from which to pick, e.g. "iron_clothes, black_sheep, red_herring").

As for your second question, I'm not sure I understand you fully here; it's a bit hard without seeing your GetMercList() code. Is this attribute only for one specific character?
Title: Re: randomizing the list for ffx
Post by: bearded on April 17, 2009, 05:08:26 AM
i thought somehow that the code presented could be used to determine character sets from a list.  it's a bit over my head how to do so, however.
Title: Re: randomizing the list for ffx
Post by: Epimethee on April 17, 2009, 11:49:34 PM
Actually, no worry, it's probably reasonably simple (that is, once you've has the chance to play around with the basic code concepts*). But the actual code required will change based on what you want to do precisely, the whole of your relevant code and whether if it's for a specific character or for a general-purpose attribute usable for custom characters (the former being often much easier), hence my questions.

*: For example, since I had no example of uses of the Python dictionary data format in FFX (back in the 1.x -2.3 days), it took me the longest time to actually "get" where to use them.
Title: Re: randomizing the list for ffx
Post by: bearded on April 18, 2009, 03:53:22 AM
ah, the code is for any character, i applied it to the guardhouse building.
Title: Re: randomizing the list for ffx
Post by: bearded on August 26, 2009, 08:31:47 AM
i think i have a way to do it.  if i have the avengers mansion as an object, with the custom spawn on it with a list of avengers.
is there a way to set up summon or private army with a building as the summoned/spawned?