- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Jazz Script issues
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Jazz Script issues
Replies: 5 (Who?), Viewed: 573 times.
#1
14th Dec 2020 at 12:36 AM
Posts: 1,491
Thanks: 4228 in 39 Posts
Jazz Script issues
So in my Enhanced Witches mod Dueling between Adults and Children cause stretching. So I tried to fix it by editing the Jazz Script to add a new parameter.Actors:Age is the parameter. Adult_Adult, Adult_Child, Child_Adult are the 3 values that this parameter can have. And I copied and renamed the adult and child dueling animations so the child animations had a ...._child_x and adult ones had ..._adult_x etc. These animations I thought will not stretch because the adult side only has the adult version and the child side only has the child version so I thought no stretching will happen. But it's still happening. I don't know if the parameter is working and the new animations are being used or not.
Code:
if (Actor.SimDescription.Child && Target.SimDescription.Child) { base.SetParameter("Actors:Age", "Adult_Adult"); } else if (Actor.SimDescription.TeenOrAbove && Target.SimDescription.TeenOrAbove) { base.SetParameter("Actors:Age", "Adult_Adult"); } else if (Actor.SimDescription.TeenOrAbove && Target.SimDescription.Child) { base.SetParameter("Actors:Age", "Adult_Child"); } else if (Actor.SimDescription.Child && Target.SimDescription.TeenOrAbove) { base.SetParameter("Actors:Age", "Child_Adult"); }
And this is what I added in the script of the mod. I thought this would work but it's not.
I'm not sure why @Lyralei you know about Jazz Scripts a lot more so do you know what I need to do?
Advertisement
#2
14th Dec 2020 at 12:13 PM
Posts: 3,856
Thanks: 8479 in 67 Posts
Jazz scripts are a bit interesting to get used to, because the mistake you made I did exactly the same thing :p
So, just to get it out of the way and inform others on how setParameters() actually work, when thinking about parameters (and how we handle the info given from our C# script > Jazz) has the following road to travel. I'll use the treehouse as an example:
If we look at the original code for 'SetParameter' we see the following:
(inside the jazz script for treehouse: )
Anyways! back to your question x:Age is also a derived parameter from our C# 'data' so to speak. There's a reason why you usually don't see EA specifying age in their 'setParameters()' and that's because it's already been given to the Jazz script. So I'd assume you can even do something like:
So, just to get it out of the way and inform others on how setParameters() actually work, when thinking about parameters (and how we handle the info given from our C# script > Jazz) has the following road to travel. I'll use the treehouse as an example:
Code:
We've got one SetParameter that returns 'true' and the other 'false' public void SetParametersForPart(UsableParts part) { switch (part) { case UsableParts.BalconyA: base.mCurrentStateMachine.SetParameter("isMirrored", true); break; case UsableParts.BalconyB: base.mCurrentStateMachine.SetParameter("isMirrored", false); break; } }
If we look at the original code for 'SetParameter' we see the following:
Code:
What it does is, it converts our boolean to the actual words 'No' and 'yes'. But why? Well:public void SetParameter(string paramName, bool paramValue) { if (paramValue) { SetParameter(paramName, YesOrNo.yes); } else { SetParameter(paramName, YesOrNo.no); } }
(inside the jazz script for treehouse: )
Code:
Yes, being of course, the default setting for it. But it will change since our script might have communicated that it's a 'No'. So in the case of this:Parameter "IsMirrored" = "yes"
Code:
It basically says 'Did the C# script return a 'yes' then do that animation, if it's no, then do the other.' So, with Jazz scripts always remember the C# script communicates to the Jazz script. Not the other way around Select on Parameter "IsMirrored" { Value "no" { Play "a2o_treehouse_balconySit_start_treehouse" for "treehouse" { Track Mask "TreehouseDoorMask" } Play "a2o_treehouse_balconySit_start_x" for "x" } Value "yes" { Play "a2o_treehouse_balconySit_start_treehouse" for "treehouse" { Track Mask "TreehouseDoorMask" } Play "a2o_treehouse_balconySit_start_mirror" for "x" } }
Anyways! back to your question x:Age is also a derived parameter from our C# 'data' so to speak. There's a reason why you usually don't see EA specifying age in their 'setParameters()' and that's because it's already been given to the Jazz script. So I'd assume you can even do something like:
Code:
That way you don't have to derive it the way you're doing it right now Alternatively, you could also do the following:State "MagicStuffs" { Transitions to "Exit" Select on Parameter "x:Age" { Value "adult" { //Blah blah } Value "elder" { // Blah blah } Value "young_adult" { //Blah Blah } Value "child" { //Blah blah } } Select on Parameter "y:Age" { Value "adult" { //Blah blah } Value "elder" { // Blah blah } Value "young_adult" { //Blah Blah } Value "child" { //Blah blah } } }
Code:
And then just do, instead of "Adult_Adult" you use the notations I showed above ("adult", "elder" etc).
base.SetParameter("Actors:Age", Actor.SimDescription.TeenOrAbove);
#3
14th Dec 2020 at 3:42 PM
Posts: 1,491
Thanks: 4228 in 39 Posts
@Lyralei Thank you so much It seems like creating a true or false boolean will be easier. IsChild yes or no. Doing it with x:age or y:age will make the jazz script really really long.
Can you help me do it correctly?
Can you help me do it correctly?
#4
14th Dec 2020 at 10:08 PM
Posts: 3,856
Thanks: 8479 in 67 Posts
Quote: Originally posted by PuddingFace
@Lyralei Thank you so much It seems like creating a true or false boolean will be easier. IsChild yes or no. Doing it with x:age or y:age will make the jazz script really really long. Can you help me do it correctly? |
Technically, just by doing the following should already do the trick:
[*]
Code:
Not too sure if you need the whole "Elder, young adult, etc" stuff. I don't think so? but it's worth testing! But for the Jazz this is really all you need. Else I don't think there is really a smaller way of doing it :/
[*]State "MagicStuffs"[*]{[*] Transitions to "Exit"[*] Select on Parameter "x:Age"[*] {[*] Value "adult"[*] {[*] //Blah blah[*] }[*] Value "child"[*] {[*] //Blah blah[*] }[*] }[*] Select on Parameter "y:Age"[*] {[*] Value "adult"[*] {[*] //Blah blah[*] }[*] Value "child"[*] {[*] //Blah blah[*] }[*] }[*]
#5
14th Dec 2020 at 11:45 PM
Posts: 1,491
Thanks: 4228 in 39 Posts
For now I am going to do x:IsChild y:IsChild boolean. I think it will be easier.
#6
16th Dec 2020 at 11:20 PM
Posts: 1,491
Thanks: 4228 in 39 Posts
Who Posted
|