Freedom Reborn

Freedom Force Forums => Mods => Topic started by: The Hitman on July 09, 2009, 05:49:58 PM

Title: Map- Specific Attributes... Can This Be Done?
Post by: The Hitman on July 09, 2009, 05:49:58 PM
Is it possible to have certain Attributes be applied to a character or characters automatically when on a certain Map?

For example, say I had a space map. Could it be worked to apply a weightless Attribute, a High Knockback Attribute, and/or a slow- moving Attribute (to simulate space), no matter the character? I'm working on something that takes place both inside and outside a space station, and I really don't want to have to make 2 herofiles for each character.

Thanks!
Title: Re: Map- Specific Attributes... Can This Be Done?
Post by: stumpy on July 09, 2009, 06:14:35 PM
I think it might be tricky to get the attributes themselves to know which map the characters are on. But, it would be pretty easy to use the mission's script to activate certain FFX attributes on all the characters (or maybe just on particular characters) for the mission. E.g., you could add something like the following to mission.py for the appropriate missions.
SpaceAttribs = ['ffqlowgravflier']  # this list could have more attribs

def InitSpaceAttribs(event):
    for char in filter(lambda o: Object_GetClass(o)&OC_CHARACTER,Mission_GetDynamicObjects()):
        for attrib in SpaceAttribs:
            if not hasAttribute(char,attrib):
                execInitAttrib(char,attrib,0)
    regTimer('InitSpaceAttribs',2)


And add a call to InitSpaceAttribs(1) to the mission's OnPostInit().
Title: Re: Map- Specific Attributes... Can This Be Done?
Post by: The Hitman on July 09, 2009, 07:03:42 PM
That'll work! Thanks, man!