Please login or register.

Login with email, password and session length
 

News:

Happy Holidays!


Author Topic: Assimilator into Matter Eating and Other Sundries  (Read 156 times)

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 15322
    • The Greylands
Assimilator into Matter Eating and Other Sundries
« on: June 06, 2019, 03:54:52 AM »
Howdy guys, I am trying to figure out how to properly portray Matter Eater Lad, and I cam across the FFX attribute Assimilator, which lets you consume parts of objects to get new powers and weapons.  I'm wondering if there's anyone with the know-how to take that attribute and tweak it into something that just gives you health or energy for 'eating' objects.
« Last Edit: June 10, 2019, 02:03:08 AM by BentonGrey »
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out my DC voicepacks at my yahoo group.
https://groups.yahoo.com/neo/groups/bentongrey
https://groups.yahoo.com/neo/groups/bentongrey2

Offline Epimethee

  • Patron god of afterthought
  • Hero Member
  • Posts: 2802
  • Currently in suspended animation
    • FFX add-on for FFvsTTR
Re: Assimilator into Matter Eating
« Reply #1 on: June 09, 2019, 04:43:08 PM »
Since Assimilator is built to affect a different target, it might be easier to customize Transmutator instead. For example (caveat emptor: not tested, I don't have access to a PC and I haven't played with these in a looong time), in ffx.py (back up first!) you could add a OnTransmuteToHealth function to add 10 hp, say, right between the lines for def OnHarmlessGas2(event): and def OnFlashGas(target,char):

Code: [Select]
def OnTransmuteToHealth(target,char):
    Trigger_Damage(char,-10)
    OnTransmute(target,char,'OnHarmlessGas2')

(If you want a different FX instead of the effect_ffx_pheremones, you'd have to replace OnHarmlessGas2 by a new call to a copy of the function with a different name and a different FX.)

In ffxtransmutes.py, under the transmutables=( list, you would have to add a line before the final closing parenthesis:
Code: [Select]
('CUSTOM_EAT','solid','OnTransmuteToHealth'),
('solid' could be replace by any of the other available types, of course.)

Finally, you'll need to add the CUSTOM_EAT entry to strings.txt and compile the file.

This could be made more sophisticated, to check for the object's HP and give corresponding health or for eating objects bite by bite. However, as I'm unable to use trial and error, I can't be of much help.
FFX add-on for FFvsTTR at ffx.freedomforceforever.com

Offline Epimethee

  • Patron god of afterthought
  • Hero Member
  • Posts: 2802
  • Currently in suspended animation
    • FFX add-on for FFvsTTR
Re: Assimilator into Matter Eating
« Reply #2 on: June 09, 2019, 04:52:42 PM »
To also increase both health and energy, you could probably use this:
Code: [Select]
def OnTransmuteToHealth(target,char):
    Trigger_Damage(char,-10)
    currentEnergy = Object_GetAttr(char, 'energyPoints')
    FFX_SetEnergy(char,currentEnergy+10)
    OnTransmute(target,char,'OnHarmlessGas2')

FFX add-on for FFvsTTR at ffx.freedomforceforever.com

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 15322
    • The Greylands
Re: Assimilator into Matter Eating
« Reply #3 on: June 09, 2019, 07:14:27 PM »
Epi, you are awesome!  I will have to test these out soon, but (so far as I can tell in my great ignorance) they seem pretty perfect!  Thanks man!
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out my DC voicepacks at my yahoo group.
https://groups.yahoo.com/neo/groups/bentongrey
https://groups.yahoo.com/neo/groups/bentongrey2

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 15322
    • The Greylands
Re: Assimilator into Matter Eating and Other Sundries
« Reply #4 on: June 20, 2019, 03:54:45 AM »
Alright, here's a new one.  Would/could anyone tweak the Mimic attribute to copy powers/stats and not appearance? 
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out my DC voicepacks at my yahoo group.
https://groups.yahoo.com/neo/groups/bentongrey
https://groups.yahoo.com/neo/groups/bentongrey2

Offline Epimethee

  • Patron god of afterthought
  • Hero Member
  • Posts: 2802
  • Currently in suspended animation
    • FFX add-on for FFvsTTR
Re: Assimilator into Matter Eating and Other Sundries
« Reply #5 on: June 21, 2019, 10:59:17 PM »
Copying stats should be  easy. Copying powers without using the mesh, on the other hand… basically impossible IIRC, plus animations are not standardized, so it wouldn't be reliable anyway. The only way it could be made to work would be for a specific campaign with a set Mimic and specific targets. You'd basically create a copy of every character and powers to use with the mimic's mesh and keyframes. I think Dr.Mike did this in The Strangers with Devil Doll.
FFX add-on for FFvsTTR at ffx.freedomforceforever.com

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 15322
    • The Greylands
Re: Assimilator into Matter Eating and Other Sundries
« Reply #6 on: July 12, 2019, 05:16:14 AM »
Yeah, I should have realized that.  Thanks Epi!

So, what do I need to do to create a version of Transmutator that ONLY allows you to munch down on solid matter as a melee attack?
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out my DC voicepacks at my yahoo group.
https://groups.yahoo.com/neo/groups/bentongrey
https://groups.yahoo.com/neo/groups/bentongrey2

Offline Epimethee

  • Patron god of afterthought
  • Hero Member
  • Posts: 2802
  • Currently in suspended animation
    • FFX add-on for FFvsTTR
Re: Assimilator into Matter Eating and Other Sundries
« Reply #7 on: July 14, 2019, 05:39:02 PM »
Good point! Since the distance is hard-coded into the Transmutator attribute’s custom actions, you currently can’t. You could change the Transutator script to add a new category similar to “solid”, but for melee range – let’s call it “food”.

Code: [Select]
def inittransmutator(char,update=0):
    if isMP():
        return
    if update==0:
        for set in transmutables:
            if type(set[1]) == TupleType:
                for entry in set[1]:
                    Mission_CustomAction(set[0],char,entry,set[2],30,0)
            else:
                if set[1]=='all':
                    for temp in templates:
                        if isObject(temp[0]):
                           Mission_CustomAction(set[0],char,temp[0],set[2],30,0)
                if set[1]=='solid':
                    for temp in templates:
                        if isObject(temp[0]) and isSolid(temp[2]):
                           Mission_CustomAction(set[0],char,temp[0],set[2],30,0)
                if set[1]=='food':
                    for temp in templates:
                        if isObject(temp[0]) and isSolid(temp[2]):
                           Mission_CustomAction(set[0],char,temp[0],set[2],5,0) #tweak that penultimate number to the correct melee distance based on in-game tests
                elif set[1]=='metal':
                    for temp in templates:
                        if isObject(temp[0]) and temp[2]==1:
                           Mission_CustomAction(set[0],char,temp[0],set[2],30,0)
                elif set[1]=='throwable':
                    for temp in templates:
                        if isObject(temp[0]) and temp[1]!=FFX_TOO_HEAVY:
                           Mission_CustomAction(set[0],char,temp[0],set[2],30,0)
                elif set[1]=='stone':
                    for temp in templates:
                        if isObject(temp[0]) and temp[2]==2:
                           Mission_CustomAction(set[0],char,temp[0],set[2],30,0)
                else:
                    Mission_CustomAction(set[0],char,set[1],set[2],30,0)

However, what I completely missed (oops, weird how much one forgets after stopping working on something for twelve years): Transmute will still give you the other transmute built-in commands, which don't fit your MEL character. Possible solutions:

1. Create a new copy of the Transmute attribute (Matter Eater) to get only the matter eating part.
2. Use the existing Metal Eater attribute instead, even if it doesn't quite follow the way MEL power work in the comics, it could be considered close enough as game mechanics go.
3. Create a carrier power swap to melee attack objects directly. However, FFX uses the effect status to swap these effects, and this depends on EVENT_CHARACTER_STATE_CHANGED and EVENT_CHARACTER_SEC_STATE_CHANGED, which, IIRC, don't trigger for non-characters. Of course, as objects don't dodge or block much (and depending on the state effect, either resist 100% or not at all), we could just bypass this and use some mlog animate check, but it would still mean implementing a whole new carrier attack system…

FFX add-on for FFvsTTR at ffx.freedomforceforever.com

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 15322
    • The Greylands
Re: Assimilator into Matter Eating and Other Sundries
« Reply #8 on: July 14, 2019, 08:55:35 PM »
Thanks Epi!  Okay, so I'm getting better at this stuff, but I'm still pretty dense.  What, exactly, will I need to copy/change to get the new copy of Transmutator as Matter Eater?  I haven't done that kind of thing before.
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out my DC voicepacks at my yahoo group.
https://groups.yahoo.com/neo/groups/bentongrey
https://groups.yahoo.com/neo/groups/bentongrey2

Offline Epimethee

  • Patron god of afterthought
  • Hero Member
  • Posts: 2802
  • Currently in suspended animation
    • FFX add-on for FFvsTTR
Re: Assimilator into Matter Eating and Other Sundries
« Reply #9 on: July 14, 2019, 10:22:35 PM »
I'd guess it would be something like this:

In ffx.py, you'd add the following before the def initassimilator(char,update=0): line:

Code: [Select]
def initmattereater(char,update=0):
    if isMP():
        return
    if update==0:
        for temp in templates:
            if isObject(temp[0]) and isSolid(temp[2]):
                Mission_CustomAction('CUSTOM_EAT',char,temp[0],OnTransmuteToHealth,5,0) #tweak that penultimate number to the correct melee distance based on in-game tests

def OnTransmuteToHealth(target,char):
    Trigger_Damage(char,-10)
    currentEnergy = Object_GetAttr(char, 'energyPoints')
    FFX_SetEnergy(char,currentEnergy+10)
    OnTransmute(target,char,'OnEating')

def OnEating(event):
    target=event.object
    Object_PlayEffect(target,'effect_ffx_pheremones') #replace with a different effect
    damage=randint(3,7)
    Trigger_Damage(target,damage)
    if Object_IsAlive(target):
        if event.user<4:
            RegTimer('OnEating',2,event.user+1,target)

In FFEdit, add an attribute named "mattereater".

Edit strings.txt Add the CUSTOM_EAT_01, CUSTOM_EAT_DESC_01, ATTRIB_MATTEREATER_01 and ATTRIB_MATTEREATER_DESC_01 entries and compile the file with FFEdit.
FFX add-on for FFvsTTR at ffx.freedomforceforever.com

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 15322
    • The Greylands
Re: Assimilator into Matter Eating and Other Sundries
« Reply #10 on: July 15, 2019, 02:31:22 AM »
Awesome, thanks so much, Epi, and thanks for your patience, man!
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out my DC voicepacks at my yahoo group.
https://groups.yahoo.com/neo/groups/bentongrey
https://groups.yahoo.com/neo/groups/bentongrey2

Offline Epimethee

  • Patron god of afterthought
  • Hero Member
  • Posts: 2802
  • Currently in suspended animation
    • FFX add-on for FFvsTTR
Re: Assimilator into Matter Eating and Other Sundries
« Reply #11 on: July 15, 2019, 12:17:16 PM »
No trouble, Benton! I hope it does work; if not, let me know—we’ll find a way.
« Last Edit: July 15, 2019, 12:19:03 PM by Epimethee »
FFX add-on for FFvsTTR at ffx.freedomforceforever.com