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!
Test Subject
Original Poster
#1 Old 28th Nov 2022 at 6:38 AM
Default How to show Sims4 swf (GFX) files based on Python script
Here's how to display GFX files, which are swf files in Sims4.
I'm Japanese and I'm not good at English, so this article may have bad English.
First, sims4 GFX is made from swf.
It is better to analyze using JPEXS Free Flash Decompiler.
And the Sims4 GFX file probably contains a library, so we analyze it.
you can see that the widget load from [CommunicationManager.SendUIMessage("ShowExitToMainMenuDialog");]
If you parse this, you can see that SendUIMessage sends a message Show[Dialog name].
And python script has the same role as SendUIMessage.

from distributor.ops import SendUIMessage
from distributor.system import Distributor
op = SendUIMessage("ShowCustomMenu")
Distributor.instance().add_op_with_no_owner(op)


So if you want to display the GameCredits dialog,

op = SendUIMessage("ShowGameCredits")
Distributor.instance().add_op_with_no_owner(op)

You should be able to show the dialog by running this.

And here's how to create a dialog.
It's easy, GFX resource instances become widget names, so you change the instance in FNV64,it done.

https://i.imgur.com/BJCkbaW.png:Example of name

Then I will show you how to modify widgetlist.xml. Note that these require overrides.

widgetlist.xml instance is DE3FB8F4E5C1A9E5

<widget name="Achievements" telemetryName="ACHM" onDemandLoad="true">
<layerProps layer="ALWAYS_ON_TOP">
<isModal>true</isModal>
</layerProps>
<position vPerc="0.5" hPerc="0.5"/>
<origin vPerc="0.5" hPerc="0.5"/>
</widget>

Here is the XML for the top item of widgets.
Change the name in this to the name of the GFX created earlier.
These are setting the widgetname of Show[widgetname].

https://i.imgur.com/WVqt3HL.png←How works

And when you go down, there is gameState, so add <widget name="Your widget name"/> to the gamestate where the widget is loaded.
Don't add gamestates where you don't need them. It will cause bugs.
With this, you should be able to create your own original UI!


https://i.imgur.com/K0bBgs2.png
EscapeMenu display test
Back to top