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!
Inventor
Original Poster
#1 Old 15th Jan 2015 at 3:43 PM Last edited by Arsil : 16th Jan 2015 at 9:52 AM.
Default Rakable Zen Garden, first prototype
Hi.

I finally seem to have overcome the issues with the jazz script (thank you again JunJayMdM),
so I'd like to introduce you the prototype for a Rakable Zen Garden Mod. What is it? I cloned
a rug and modified the mesh so its shape and size is exactly 1x1 tile. I used the puddle cleaning
animations (copied one to remove the sound effect) and cloned/re-meshed/re-mapped the
cleaningMop prop to create a wooden rake prop.

How it works? When you click on the rug the interaction "Rake" pops up (name is not yet localized)
and sims will rake it and gain some fun. If a sim tries to autonomously rake "the wannabe zen
garden" a variable is checked to see it someone has raked it in the last 3 hours (duration is
not yet XML tunable) in order to prevent sims raking all the time.

I just noticed that the prop has no sun shadow, since this is mostly an outdoor activity maybe
it should have it (I don't remember if it has it when indoors, I think it does since the prop has
its own LITE resource).

Now, I'm struggling with the textures/presets/complates, I can't use tools that facilitates their
handling (Texture Tweaker and TSRW come to mind) and editing the "manually" with S3PE is not easy (plus I don't think I fully understand how they work).
EDIT: if the last word in a line is a auto-link, then the "carriage return" doesn't work. Funny.

What I would really like to do is that when you select the "rake" interaction you can pick
from a list with images what pattern draw on the sand. I'd like to use the textures of the
terrain paint tool for the un-raked sand and extract other patterns from the raked one:
- horizontal waves
- vertical waves
- concentric circles (1 full circle, half circle for each side of the tile, 1/4 circle for each angle of the tile).
In this way you can build a zen garden using a matrix of "rugs" and choosing the pattern
for each tile you can draw various bigger patterns. Like with some floor tiles.
Was that explanation clear? I doubt it, see screenshot for reference.


Bottom line: I'd like help for 2 things:
- figure out how to change the texture (or preset) of an object with the code
- someone who checks the object (the rug, the rake prop is all right), removing the unused
textures and XMLs for complates/materials, and create or help me create the various sand
textures with composable patterns (I think the UV mapping of the rug/garden must be redone
better so adjacent rugTiles will match perfectly). I like how the rake prop works: it has no TXTC,
no Materials block in the OBJD and no XML complate, the one and only texture is referred by
the MODL itself. So simple! [EDIT: because a prop is not supposed to be used as a normal object].
But this can't work for the garden/rug, in order to change the texture or preset I think it needs at
least a XML complate with variables instead of values and the Materials block of the OBJD must
contain the values for the various textures/pattern drawable in the sand.

If that is ask too much, then the plan B is to just get help to fix the texture I'm using right now
because that doesn't look very much like sand (I think the problem is that the object still has a
RGB mask so the color overlaps the texture or something like that). Probably object's creators
don't look this section of the forum much, but this seemed the more fitting place to ask this.

Any feedback is welcome, but keep in mind that this is not supposed to be a final product.
In the zip you'll find 2 packages because I'm still keeping separated the rake prop from the
rug/garden so it's less confusing having only the resources of the object I'm working on.

EDIT
In the middle of the room there's a garden without flowers.
It's formed by raked white sand and stones: the sand is the
symbol of the ocean, the stones of the mountains and the
sacred marine animals.
Screenshots
Attached files:
File Type: zip  ArsilZenGardenPackages.zip (1.24 MB, 30 downloads) - View custom content
Advertisement
Instructor
#2 Old 16th Jan 2015 at 1:37 AM
Oh, so what do you plan to have raking do? It does look great! (for I cannot mesh, cannot understand JAZZ, can edit footprints of objects, can do textures...)

You once said I was a better modder than you. Now I highly doubt it!

Great job! (BTW this isn't quite the right place, but just want to ask: how is your low dining table going on? I'm anxious for that!)
Inventor
Original Poster
#3 Old 16th Jan 2015 at 8:20 AM Last edited by Arsil : 16th Jan 2015 at 10:44 AM.
Thanks for the encouragement.

The raking just raises the fun motive, but that's mostly to encourage sims to do that autonomously,
I'm more interested in the [virtually] relaxing and "artistic" sides of that activity, well, artistic only if
I can manage to make it work like a jigsaw puzzle (for lack of a better definition).

OT: About the low dinner table, I had big issues with the custom posture and the eating animations.
I put aside the project, but one day I hope to complete it or integrate it with the Japanese Culture Trait.
Maybe I'll upload what I've done so far so if someone else want to work on it they can do it.

---

I tried to fix the texture to make it look like sand but failed again.

For changing the texture/preset with code, I'm still in deep seas but I've found something.
I haven't verified yet if this can help me (maybe has nothing to do with what I want to do).
- GameObject.SetMaterial (but I think it's not the same concept as the Materials of the OBJD)
- ObjectDesigner.SetPattern(...)
Of course I could swap the mesh like modular objects do (example: sleeping bag), but that
seems overkill and I'll keep it as last card.

EDIT:
I can't help but wonder who is in charge of deleting the prop used in the animations.
Is it deleted automatically when the state machine reaches the "Exit" state?
In the cleaningMop jazz, in the "Exit" state, the animation o_xevt_701 is played.
Now, this is a dummy/fake/empty clip used only to trigger the generic event 701.
I guess this is used so that you can "catch" that event with a callback or something
like that, or it can have something to do with deleting the prop? Because I removed
that in my jazz script and if every time sims rake the garden a rake object is created
and never deleted that is a serious problem. I'll try to figure this out but if someone
already knows how it works please let me know.
EDIT2
It seems like the event 701 has nothing to do with props, since jazz scripts that make
use of props do not necessarily use the o_xevt_701 clip. So I'm left with two theories:
- the prop has something to do with the "jig" (whatever that is) [I think I can exclude this thanks to counter-examples]
- the prop is deleted automatically when exiting from the state machine (or more likely when the state machine is disposed)
EDIT3
In the class StateMachineClient there's a method named "SetPropActor", maybe it's called
when in a jazz script there's the statement "Create Prop [instanceID] as "[actorName]""
and in the "Dispose" method all actors are deleted, so that must be it.
Inspector Arsil solved the case and saved the day.
Inventor
Original Poster
#4 Old 16th Jan 2015 at 10:58 AM Last edited by Arsil : 16th Jan 2015 at 3:08 PM.
Maybe one of these:
ObjectDesigner.SetPresetInfo(ObjectGuid scriptHandle, string presetXml)
ObjectDesigner.UpdateTexture(uint paramHash)
and one of the many ObjectDesigner.GetDesignPreset* to create the list from which to pick a sand pattern

I'll try it with another object until I fix the zen garden "rug" presets/complates/whatever.

EDIT
The only example in the code seems this from the class "Helm", but it's a bit difficult to understand
for me and unfortunately the value of the variable "text" is read from a file so I don't know what it is.
Inventor
Original Poster
#5 Old 17th Jan 2015 at 11:23 AM Last edited by Arsil : 17th Jan 2015 at 4:39 PM.
About the texture issue, I decided to use brute force (at least as temporary solution).
This wont allow to choose a pattern to draw in the sand, but I'm not making any
progress in that front too. I'm getting weary and I'll use it like it is now.

I removed all references to the TXTC and other resources from the MODL and just
referenced a single bloody texture. Now I can't get the texture colour to match that
of the terrain painted sand, the one of the object looks purple-ish and only when I
highlight it then it gets very close to that of the terrain paint (see screen shot).
I guess this has something to do with the way the light modifies the colour.
Is there a way to fix it? Or it is a direct consequence of using only 1 texture
(with no specular, multiplier and such)?

And if the object (the rug, the zen garden) is indoors then its colour looks different
again, maybe for the different kind of illumination/light it gets.


I did it, I can change the overlay texture with the interaction.
Inventor
Original Poster
#6 Old 17th Jan 2015 at 11:02 PM Last edited by Arsil : 2nd Jun 2016 at 8:35 AM.
Second prototype officially uploaded HERE

ISSUES
* I can't get the texture colour of the object to match that of the terrain painted sand, the one of the
object looks purple-ish and only when I highlight it then it gets very close to that of the terrain paint
(I consider this an issue because I would like to use the zen garden together with the sandy terrain).
* The textures for the sand-patterns kinda suck, I tried my best but it's not my cup of tea.

MINOR ISSUES
* rug/garden is recolorable in CAST (it should not). EDIT: actually you can't modify it, but it
shouldn't even be CASTable. Guess I have to remove the RGB mask or something like that,
not an operation I'm confident with.
* rugs are overlappable between them (I removed the option from the FTPT, don't know why
EDIT: maybe that option works only if generic intersection with other objects is disabled, but
I prefer to leave that freedom, so it can't be helped)
* the rake projects no shadow (but props in animations usually don't)
* maybe I should disable the interaction if there's snow on the ground (I think you can do that
with an ITUN setting), but what if the zen garden is built indoors? Probably there's a simple
and unambiguous way to determine if an object is indoors or outdoors.
EDIT: Ehm, if the
object is indoors then it can not be covered by snow, can it? :D
The interaction should be disabled if the ground (and so the garden) is covered in snow,
EDIT2: but does the ITUN "knows" if the zen garden is outdoors or indoors? Will it disable
the interaction if the garden is inside but the snow is covering the ground outside???

I don't have Seasons so a confirmation would be nice.

HINDSIGHT EDIT: I should have used material states for this mod.
Instructor
#7 Old 18th Jan 2015 at 2:27 AM
So, the sand textures are contained in the pacakge, right? Maybe try using image editing softwares to change the hue. The texture in the file certainly does not look purpleish, right? My suggestion (possibly wrong) is to change the hue to purple actually. The sand is yellow, and it appears purple. What if you reverse it? Purple sand, perhaps this gives yellow ingame sand.
Back to top