Forum Announcement, Click Here to Read More From EA_Cade.

XML: custom super_interaction and _super_affordances in overrides

pboxpbox Posts: 630 Member
edited March 5 in Nominated Threads
I'm trying to make it so that children can garden (at least do those things for which I can recycle existing animations like Generic_PickUp for harvesting); the way I got this to work, so far, is by

1. making a custom super_interaction that references the kid-friendly animation and is for children only;
2. telling each and every plant object about it (i.e. overriding them all with a version that has my super interaction(s) added to the _super_affordances list).

This strikes me as a little clunky and very collision-prone, because of all those overrides .. is there a more efficient way to do this? Is it possible to e.g. override just Gardening_Harvest with a version that makes it so that one (and only one) age group will use a different animation? How would I go about that? The generic SuperInteraction tdesc talks at length about TunableAnimationOverrides but only along the lines of "complex and seldom used" things that don't seem to have anything to do with the age or other properties of the actor ..

Also, what is AffordanceList_Gardening? I'm not sure how those snippets relate to the rest of the world =/ (I only see that referenced once, in another snippet about .. painting?)


Enlightenment much appreciated! @SimGuruModSquad maybe?


Edit: while I'm fiddling with plants, does anyone know which of the effects is responsible for the sparklies? If it turns out I have to override the plants anyway, I'd like to turn off those as well -- if I'm not mistaken they're referenced here.
Stuff for TS2 · TS3 · TS4
Post edited by EA_Cade on

Comments

  • pboxpbox Posts: 630 Member
    See also the mts thread about this:
    This seems to be the same issue as for interactions. I can't say that I 100% understand how the tunables are read from the specific resource, but I agree that overriding the tuning cannot be the solution (since we really don't want something like interactions on objects including sims to be working under the Highlander principle).

    I hope there's a way to simply add to the _super_affordances of a script object (or whatever else is necessary) through a Python script. That way each modder can add what they need without interfering with other mods.
    pbox wrote:
    From what I can see, there might still be a possibility to tune this in a little more elegantly within this part (in Gardening_Harvest_E882D22F_00000000_0000000000003465)
    <V t="one_shot" n="basic_content">
        <U n="one_shot">
          <U n="animation_ref">
            <T n="factory">39110<!--Gardening_Harvest-->
            </T>
          </U>
        </U>
      </V>
    

    .. by either somehow adding an age test in here, or overriding that 39110 resource so that it gives kids a different animation. But I wasn't able to find that resource anywhere, so far, and the similar ones I've seen are resources that S4PE doesn't know how to interpret at this point =/

    Have you seen anything with instance 98C6 anywhere? (=39110)
    Stuff for TS2 · TS3 · TS4
  • pboxpbox Posts: 630 Member
    edited October 2014
    Looks like my approach may have been made of suck and fail XD

    velocitygrass pointed me at that resource (Gardening_Harvest_EE17C6AD_00000000_00000000000098C6), so I'm hopefully on the right (or less wrong) track now.
    <?xml version="1.0" encoding="UTF-8"?>
    <I c="AnimationElement" i="animation" m="interactions.utils.animation" n="Gardening_Harvest" s="39110">
      <T p="InGame\StateMachines\Gardening.statemachine" n="asm_key">02d5df13:00000000:e91e77f2dfc4248a</T>
      <L n="begin_states">
        <T>Harvest</T>
      </L>
      <L n="end_states">
        <T>exit</T>
      </L>
      <T n="target_name">plant</T>
    </I>
    

    Edit: Hrm. Well maybe, but according to AnimationElement.tdesc I'm also back at square one with those "complex and seldom used" things which scream EXPERTS ONLY at me =P .. I guess the manifest stuff is mostly there to account for handedness and posture, not to run entirely different animations.

    Also, wouldn't solve the issue of how to add new interactions to vanilla objects.
    Post edited by pbox on
    Stuff for TS2 · TS3 · TS4
  • Shimrod101Shimrod101 Posts: 304 Member
    That State Machine you list above is a Jazz file, this one here: "asm_key">02d5df13:00000000:e91e77f2dfc4248a.
    You can find that resource both in the SimulationFullBuild file and the ClientFullbuild0 file. Lift it out with Export to file and read it in an external program, an XML Editor or Notepad++ or whatever. If none of your programs will do it, Note Tab Lite will certainly do it, as it opens everything.

    In there you will find the Posture Manifest or whatever it is you mention above, the "handedness" and all the other stuff.

    The way I would probably go about attempting to place some animations on the child when they don't have any in vanilla game is to make a copy of this Jazz file, as opposed to typing in "Child" all over the place in the current file.
    So I have the copy, which needs it's own Instance ID # to make it independent of the original, and presumably you can identify the new Jazz file in your modded XML by that asm_key, which lists your new file.

    In the Jazz file itself, your new copy, all you need to do, I think, is replace all the actual Clip names themselves, for example clip=a2o_gardening_graft_low_x, with an appropriate c2o clip which is child-to-object, instead of a2o which is an adult-to-object Clip file. Simple.

    There may be some other stuff which actually needs alteration in a new Jazz copy file which is intended for Child only, but this info can be gleaned and tested out by reading through one of the other Jazz files which are made for Child, like playing with the Monkey Bars would maybe be a good one to look at, as the Adults are locked out from the Monkey Bars IIRC?, so it's possible this Jazz file is written only for Child, and can be used for comparison purposes.
  • pboxpbox Posts: 630 Member
    Yeah but even if I had a shiny new child animation for some interaction, I still need to tell the plants about it ( = include it in their _super_affordances list) in order to actually make that available in game. That or squeeze a conditional in somewhere that will automagically use the child one for children and the adult one for everybody else. Or something like that?

    I'm currently trying to make heads and/or tails of what clown did in their EnableDebugCheats (since that is an example for new interactions on objects that comes with (commented!) source) and the decompiled source files ..
    Stuff for TS2 · TS3 · TS4
  • pboxpbox Posts: 630 Member
    edited October 2014
    Progress! =D

    Thanks @Shimrod101 for pointing me in the direction of JAZZ files .. I wasn't even aware those are plain XML too! (Nobody ever tells me anything! XD)

    And they have selectors, which is cool. And leads to new questions of course: is there a way to select multiple parameters at once? Or do I have to repeat everything for every-age-but-kids over and over again?

    Anyhow, what I did now is override just the gardening interactions (to include kids), and the Gardening jazz (with an additional age selector that for now just C+Ps the SwipeToInventory thing), which already makes a lot more sense to me than overriding all the plants. Since I do not change anything else about the interactions (for now), this is kind of working (for now), jazz-internal clunkiness notwithstanding. =)

    \o/


    Still the interesting question remains: how to make existing objects aware of custom interactions?


    Edit, more questions for @SimGuruModSquad (if they haven't torn their hair out yet =P):

    - How unrecommended is it exactly to have children accumulate adult skills and vice versa? If I do end up overriding the interaction, I could just as well have it increase both adult gardening and child motor skill ..
    - How come that the GenericSwipe jazz has no age differentiation at all (for all I can see) but still looks OK on all both ages?


    Also, test package now uploaded here.
    Post edited by pbox on
    Stuff for TS2 · TS3 · TS4
  • SimGuruEugiSimGuruEugi Posts: 503 SimGuru
    pbox wrote: »
    - How unrecommended is it exactly to have children accumulate adult skills and vice versa? If I do end up overriding the interaction, I could just as well have it increase both adult gardening and child motor skill ..

    Skills have tuning for allowed ages. Attempting to award a child skill to an adult (or vice versa) might simply not do anything.
    pbox wrote: »
    - How come that the GenericSwipe jazz has no age differentiation at all (for all I can see) but still looks OK on all both ages?

    The animation system auto-replaces clip names with the appropriate age prefix. So a clip a_GenericSwipe would be replaced by c_GenericSwipe when animating for a child Sim.
  • pboxpbox Posts: 630 Member
    The animation system auto-replaces clip names with the appropriate age prefix. So a clip a_GenericSwipe would be replaced by c_GenericSwipe when animating for a child Sim.

    Ah that's good to know, thanks!

    Stuff for TS2 · TS3 · TS4
  • pboxpbox Posts: 630 Member
    On the question of
    pbox wrote: »
    how to make existing objects aware of custom interactions?
    , the approach that has been posted here (adding on to the _super_affordances list by way of scripting; scumbumbo) might provide a solution for that. Haven't done anything with it yet, but to me this looks promising =).

    Stuff for TS2 · TS3 · TS4

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file
Return to top