News:

Rings of Reznor!

Main Menu

Map- Specific Attributes... Can This Be Done?

Started by The Hitman, July 09, 2009, 05:49:58 PM

Previous topic - Next topic

The Hitman

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!

stumpy

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().
Courage is knowing it might hurt, and doing it anyway. Stupidity is the same. And that's why life is hard. - Jeremy Goldberg

The Hitman