Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Quick Reply
Search this Thread
Pettifogging Legalist!
retired moderator
Original Poster
#1 Old 6th Oct 2014 at 12:38 AM Last edited by plasticbox : 6th Oct 2014 at 6:07 AM.
Default XML - Gardening for children; two questions
I would like to make it so that children can garden, too - at least do those things for which a decent animation already exists (e.g. harvesting -- they could use the "swipe to inventory" for that, and for weeding maybe one of the play-with-toy ones).

Making e.g. Harvesting available for kids is pretty simple (I just added the ages explicitely in
S4_Gardening_Harvest_E882D22F_00000000_0000000000003465 -- not sure whether that is the right way since I can't find where kids are excluded by default, but for testing it looks like it's good enough), but I'm still stumped on two things:

1. the kid I tested with was able to harvest plantain but not mushroom -- I cannot find anything that would make a distinction w/r/t which plants can be harvested -- Found; it was Gardening_Harvest (which is for tall plants) vs. Gardening_Harvest_Low (for the not so tall ones);

2. I don't know how to make it so that one (and only one) age group will use a different animation than everybody else -- is this possible at all? Or would I need to make this a new (children-only) super interaction instead?


Edit: Ok, so I tried the latter -- a new super interaction -- and that does not work at all =/ (as in, with this the interaction doesn't show up for kids any more, which it does when overriding the regular one with the added ages). I may have messed up something to do with the new instance, but cannot find what that is:

The name is pbox:Gardening_Harvest_Children
Instance 0xC0A3306C2705F2FF is the fnv64 of that + high bit
s="13880991717555303167" = C0A3306C2705F2FF as decimal

???

Am I missing a step? Do I need to .. somehow explicitely make the game aware that this now exists?


Edit: Apparently, yes. This is working now but only when I tell every plant object about it separately. Very collision prone =/

I wonder whether there's a less clunky approach for this?

E: I also asked here.


Nonworking package attached, would appreciate if someone could take a look.


Full quote of the original below for your convenience.


Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Advertisement
Inventor
#2 Old 6th Oct 2014 at 8:28 PM
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. I haven't tried this yet. (My first attempts to do what SimGuruModSquad suggested for same-sex pregnancy with better control of who gets pregnant failed, so I'm not even at the point where that becomes an issue.)
Pettifogging Legalist!
retired moderator
Original Poster
#3 Old 6th Oct 2014 at 8:36 PM Last edited by plasticbox : 6th Oct 2014 at 8:52 PM.
Ugh, looks like I should get used to the thought I'll have to take up scripting now too. Anyone have an extra 24 hours in the day for me? =P

From what I can see, there might still be a possibility to tune this in a little more elegantly within this part

Code:
  <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 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Inventor
#4 Old 6th Oct 2014 at 9:09 PM
98C6 is an animation instance of class type AnimationElement:

Code:
<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>


You can do an override either in the AnimationElement itself or in the animation_ref (according to the tdesc), though I'm not sure how the manifest stuff works. Do you know any interactions that already use overrides? Maybe painting or playing piano? I haven't played kids yet, so I don't really know of examples that could be checked for how it's done there.
Pettifogging Legalist!
retired moderator
Original Poster
#5 Old 6th Oct 2014 at 9:18 PM Last edited by plasticbox : 6th Oct 2014 at 9:36 PM.
Awesome, thank you. Your search fu clearly beats mine! =D

I wasn't even aware that this is also XML .. will look into it now. Yeah, checking out the pianos is also a good idea =)

Thanks!


Edit: well the piano doesn't give much insight -- there are separate interactions for children and everybody else, and the piano knows about this. But I'm going to look at the animation stuff now, maybe that leads .. somewhere.

It still wouldn't be a solution for how to make existing objects aware of new interactions. The way I understand it, in their CC guide they got around this because that introduces a custom object, instead of adding to a vanilla one.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Inventor
#6 Old 6th Oct 2014 at 9:25 PM
If you see a comment with a name after a decimal number like <!--Gardening_Harvest-->, it's because the extractor has found an xml for that instance, so those should always be among the files that were extracted from the combined tuning.
Pettifogging Legalist!
retired moderator
Original Poster
#7 Old 6th Oct 2014 at 9:37 PM Last edited by plasticbox : 6th Oct 2014 at 11:32 PM.
Yeah. Now in hindsight, it's obvious for me too =) (I was searching in all the packages with S4PE -- of course to no avail, since that only sees the giant tuning blob)

Also, edit re. pianos above!


But regarding the AnimationElement, I guess the first paragraph in the tdesc sums it up: "<Instance description="When tuned and called, return an element that will request the animation corresponding to a particular series of ASM states. Do not use this in tunings directly, use the TunableAnimationReference which will provide the tunable factory as well as the ability to override parameters in asm calling. Example: INSTANCE_TUNABLES = {'my_animation': TunableAnimationReference()} ... self.do(self.affordance.my_animations(self))" class="AnimationElement" module="interactions.utils.animation" path="Animations\Descriptions" instance_subclasses_only="False" use_guid_for_reference="True" instance_type="animation">"

ASM calling? As in A(mumblemumble) State Machine?


One example for such an override would be in Gardening_Harvest_Low_E882D22F_00000000_0000000000012FC1:

Code:
  <V t="one_shot" n="basic_content">
    <U n="one_shot">
      <U n="animation_ref">
        <T n="factory">39110<!--Gardening_Harvest-->
        </T>
        <U n="overrides">
          <L n="params">
            <U>
              <T n="name">PlantHeight</T>
              <V n="value" t="string">
                <T n="string">Low</T>
              </V>
            </U>
          </L>
        </U>
      </U>
    </U>
  </V>


(as in: it uses the regular Gardening_Harvest one and overrides the PlantHeight parameter with "Low")

but in order to do this, one would have to know which parameters exist (how?) and also I see no way to use conditionals here.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Pettifogging Legalist!
retired moderator
Original Poster
#8 Old 6th Oct 2014 at 11:32 PM Last edited by plasticbox : 7th Oct 2014 at 7:20 AM.
Quote: Originally posted by velocitygrass
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.


@velocitygrass I believe the solution to this may be in the source of EnableDebugCheats -- it is very nicely commented (I feel like I understand what it does even though I don't speak a word of Python =)

That adds shift-click interactions to pretty much everything, not one (or a few) specific objects but for people who have looked into scripting already it may be quite obvious how to get only the objects one wants.


Edit: Which clearly does not include me =P I still feel very unenlightened, just in case that wasn't obvious ..


Edit: OK, so after Shimrod thankfully made me aware of JAZZ tuning I got the kindergarden thing to work now using yet another approach (see here). But that only works (for now) because I am not changing anything *but* the animation (so I don't need a full-fledged custom interaction, can just override the regular one and let the gardening skill drop on the floor for kids .. I don't care about their skilling so much, I just want to enslave enrich their little lives after all).

I wonder how it works that the SwipeToInventory animation (which is what I'm using for child harvesting now) has no age differentiation at all but still looks good for children? o.O


Edit: Test package in Feedback: http://www.modthesims.info/showthread.php?t=537749

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Inventor
#9 Old 7th Oct 2014 at 7:20 PM
From what I can see, the EnableDebugCheats mod doesn't add new interactions, it only changes the script so that it doesn't prevent the existing debug interactions from being available.

The JAZZ tuning sounds like a perfect way to achieve what you wanted. I looked at other JAZZ files and it seems EA also copy and pastes for the other ages when differentiating (e.g. in the computer use JAZZ), so there doesn't seem to be a simple way to use it. I did find the the ParameterSelector "x:trait_Evil" (and a few other specific traits), which is used with the choices true/false, so I have to wonder if that can be used for other things (buffs/moods/specific ages...), but I couldn't find a reference to the parameterselector in the python code/tunings that might give a list of all valid values.

One note about your test package: For the final version EA recommends to remove all linebreaks and extra whitespace from tuning files for performance reasons. (Maybe you were going to do this anyway; just wanted to mention it.)
Pettifogging Legalist!
retired moderator
Original Poster
#10 Old 7th Oct 2014 at 7:44 PM
Quote: Originally posted by velocitygrass
From what I can see, the EnableDebugCheats mod doesn't add new interactions, it only changes the script so that it doesn't prevent the existing debug interactions from being available.


Yeah after poking the source files for a bit it also looked less promising to me than it initially did =) still, there seems to be some way to refer to objects by instance (at least that was my interpretation) but I haven't looked at that more closely.


Quote: Originally posted by velocitygrass
The JAZZ tuning sounds like a perfect way to achieve what you wanted. I looked at other JAZZ files and it seems EA also copy and pastes for the other ages when differentiating (e.g. in the computer use JAZZ), so there doesn't seem to be a simple way to use it. I did find the the ParameterSelector "x:trait_Evil" (and a few other specific traits), which is used with the choices true/false, so I have to wonder if that can be used for other things (buffs/moods/specific ages...), but I couldn't find a reference to the parameterselector in the python code/tunings that might give a list of all valid values.


To me it looks like the valid parameters for each file are those listed at the top -- in the gardening jazz, for example:
Quote: Originally posted by S4_02D5DF13_00000000_E91E77F2DFC4248A%%+JAZZ.jazz
<Parameter name="x:age" template="age" type="enum" labels="baby,unsupported_age,child,teen,youngadult,adult,elder" default="adult" />
<Parameter name="x:sex" template="sex" type="enum" labels="male,female" default="male" />
<Parameter name="x:mood" template="mood" type="enum" labels="happy,confident,angry,sad,bored,embarrassed,uncomfortable,playful,tense,focused,energized,flirty,fine,inspired,dazed" default="fine" />
<Parameter name="plant:IsAlienPlant" type="bool" default="false" />
<Parameter name="plant:PlantHeight" type="enum" labels="High,Medium,Low" default="Medium" />


One can probably introdude new parameters here, too, and then use them in the actual selectors further below. Didn't play with that yet, since the age parameter was already there. But for gardening it might make sense to at least check for the LovesOutdoors trait and make sims use a Happy animation when they have it. Oh, and I should look into making a HatesOurdoors trait (that's not in the game yet, or did I miss it?), maybe there is an "annoyed pick up" somewhere that I can use for that =P


I still don't consider this a perfect solution btw -- I'd much prefer being able to use custom interactions instead! (Which could then either refer to a custom kindergardening jazz or point at different existing ones, and also add child skills instead of adult ones). That would be much more flexible and less collision prone. But like you, I'm still stuck with the question how I to explain that to the plants .. I'm hoping TPTB can give us a pointer on that.


Quote: Originally posted by velocitygrass
One note about your test package: For the final version EA recommends to remove all linebreaks and extra whitespace from tuning files for performance reasons. (Maybe you were going to do this anyway; just wanted to mention it.)

Yeah I know =) (but thanks for the reminder) -- I'm guilty of having left the whitespace in all my tuning mods so far, because I wanted them to be human readable .. I am assuming others also look at how existing mods work, and it just makes it so much easier to be able to read the XML in S4PE directly (rather than having to export and format). But with this one, since the JAZZ file is so large, might be a good idea to actually conform to that standard for once =P

Maybe it would be better to upload the packages optmised, and in addition the (formatted) text files for those who want to look at them.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Mad Poster
#11 Old 7th Oct 2014 at 8:54 PM
Quote: Originally posted by plasticbox
Yeah I know =) (but thanks for the reminder) -- I'm guilty of having left the whitespace in all my tuning mods so far, because I wanted them to be human readable .. I am assuming others also look at how existing mods work, and it just makes it so much easier to be able to read the XML in S4PE directly (rather than having to export and format). But with this one, since the JAZZ file is so large, might be a good idea to actually conform to that standard for once =P

Maybe it would be better to upload the packages optmised, and in addition the (formatted) text files for those who want to look at them.


I have come to the conclusion that this business from ModSquad about removing all the white space in an XML tuning mod because this will "marginally" load faster, should be ignored. We should be doing as we did in Sims 3; we used the individual XML or ITUN exactly as they had it in the GamaplayData file, exactly as they formatted each of those. We should format ours in this game as we find them from the Extractor tool, showing the nesting with all the 'white space' still there. The "margin" that ModSquad is talking about, Ooooh! Ooooh! We can get XML stuff to load faster!, this is 1% or less. This is their "marginally", although this is only my opinion, I cannot prove that the margin of difference is this slight.

About the Jazz files; this removal of white space does not apply to them! And this is true FACT, not my opinion! Each individual JAZZ file is an individual asset, just like a GEOM or OBJD or whatever, they are not "tuning" files, they are Scripts, a Jazz Script is the proper name or description for them, they are scripting files which happen to be written this time around in XML, instead of the scripting language which was used for them in Sims3.

MedievalMods and Sims3mods: Dive Cave Reset Fix, Resort Revamp, Industrial Oven Revamp, Will O' Wisp fix, UI Sounds Disabled, No Cars, Gnome Family Planner, Townies Out on the Town, No Martial Arts Clothes, Fast Skilling, etc. http://simsasylum.com/tfm/
Pettifogging Legalist!
retired moderator
Original Poster
#12 Old 7th Oct 2014 at 9:17 PM
Quote: Originally posted by Shimrod101
We should be doing as we did in Sims 3; we used the individual XML or ITUN exactly as they had it in the GamaplayData file [..] We should format ours in this game as we find them from the Extractor tool


Those are two different things though. In the actual game file there is no whitespace .. velocity only offers the formatting option out of user friendlyness.

Of course you're free to optimise or not, whichever way you prefer =) but I like optimisation, personally.
Screenshots

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Inventor
#13 Old 7th Oct 2014 at 9:21 PM
Ah, I missed those at the top. You're right, that seems to include the parameters used in the particular file, though I still wonder how the game knows that the template "trait_Evil" refers to having the evil trait and what else is supported. There are other traits, so traits might indeed be supported (not just those already used, but all), but I'm not as sure about e.g. buffs or other info like careers that is not currently used in any JAZZ files. I've looked a bit further and there's the TunableParameterMapping, which is where _anim_override params from tunings end up, but they also don't give an immediately apparent list of available values.

I'm not entirely sure if the recommendation is also for JAZZ files or just for tunings. (The JAZZ files also don't have the abbreviated tag names; maybe performances isn't as much an issue with them?) And yes maybe a different download with the resources in readable form would be helpful (analogous to making available source code for tools).
Pettifogging Legalist!
retired moderator
Original Poster
#14 Old 7th Oct 2014 at 9:42 PM Last edited by plasticbox : 7th Oct 2014 at 10:01 PM.
Quote: Originally posted by velocitygrass
Ah, I missed those at the top. You're right, that seems to include the parameters used in the particular file, though I still wonder how the game knows that the template "trait_Evil" refers to having the evil trait and what else is supported. There are other traits, so traits might indeed be supported (not just those already used, but all), but I'm not as sure about e.g. buffs or other info like careers that is not currently used in any JAZZ files. I've looked a bit further and there's the TunableParameterMapping, which is where _anim_override params from tunings end up, but they also don't give an immediately apparent list of available values.


Maybe that is what template="carryState" etc refers to .. as in, there's a template somewhere that explains how to interpret those values? Interestingly, <Parameter name="plant:PlantHeight" type="enum" labels="High,Medium,Low" default="Medium" /> does not list a template ..

Would be interesting to know, so that we know how to refer to custom traits etc =)

What was TunableParameterMapping again?


Edit: Wait -- does the jazz even need to know what "Evil" actually means? All that happens here is that it says "if this string is the label, do that" .. like for mood for example,

<ParameterSelector parameter="x:mood">
<Choice value="happy">
(blah)
<Controller target="x" controller="@ClipController(clip=a2o_gardening_fertilize_whistle_x, loop_count=#1)" (etc)

it just selects an animation that has happiness already built in, so to speak. It doesn't need to know what "happy" is.

Is my interpretation. What do you think?


Edit2: on second third thought, I guess you were asking for HOW this knows what the actor's current mood is .. I don't see that passed explicitely either. Only that one can override it in the XML tuning (like the PlantHeight:Low thing, which will then take precedence over the actual plant in game). Magic!

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Mad Poster
#15 Old 8th Oct 2014 at 8:58 AM
Quote: Originally posted by plasticbox
Those are two different things though. In the actual game file there is no whitespace .. velocity only offers the formatting option out of user friendlyness.
Of course you're free to optimise or not, whichever way you prefer =) but I like optimisation, personally.


Yes of course, I already know this.

And the JAZZ files select the animation Clips to be used, they do not know anything about anything else; if a specific Clip written in there makes the sim appear to be happy, the JAZZ file doesn't know this. They work the same way as in Sims3.

MedievalMods and Sims3mods: Dive Cave Reset Fix, Resort Revamp, Industrial Oven Revamp, Will O' Wisp fix, UI Sounds Disabled, No Cars, Gnome Family Planner, Townies Out on the Town, No Martial Arts Clothes, Fast Skilling, etc. http://simsasylum.com/tfm/
Back to top