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!
Virtual gardener
staff: administrator
Original Poster
#1 Old 30th May 2019 at 3:29 PM
Default Technical thread: Ouroboros - A scripted storytelling world
What is this?

A good portion of us modders, as well as simmers, play the sims for its strong storytelling core. I mean just take a peek on tumblr, stories everywhere! If not, legacies with some form of storytelling. It's just a big factor of the game and we all love it for that! This love even goes back to the good old PSP sims 2 game and the Sims console games (Bustin' out being one of them). But what about making a world where you don't have to include a save file to have some form of storytelling in it? Can we make an already set-up EAish world? What about adding quests or just dialogs in general when talking to specific sims? If not making a dev tools for script modders? Already excited? Great! :D

How would this work?

EA has a loooot of world functions in the script files that communicates with the game engine. Which means, we can easily ask the game engine "Hey what world is this? Which world file does it use? What kind of sims live here?" Etc. This is a super big project in itself. First we need to test the script itself, actually, make sure it works. Then a world, then sims. I hope in the far future to have a simple program that sets everything up by just dumping in your .world file and easily types everything out with some great user experience but right now I don't have enough knowledge about how worlds work to get this really working with a program.

In the end it's supposed to be as helpful for script modders as well as world builders And having our first world that has this all set and working!

What do I have?

Currently, I've been messing around with these EA functions a lot and finally got a simple version of this script to work (Thanks to Battery for getting to figure out why it wasn't loading at first) The script currently outputs the following information:
  • The Current World
  • The Current world type
  • The World file name
  • The World Name key

When I tested it, this was outputting the following for Sunset Valley:
  • Current World: Sunset valley
  • Current world type: Base
  • World file name: Sunset Valley.world
  • World Name Key: World/Pleasant_Valley/WorldDescription: Name

And for a custom world, which I used the lovely Cronor world to test it:
  • Current World: Cronor.world
  • Current world type: Base
  • World file name: Cronor.world
  • World Name Key: Cronor

Obviously, from here we can easily use the world's data to say "Only run this script if it's this world". Which was step 1. Secondly is to see if we can output the sim's SimDescription table to get the Sim ID/Key (Which Nraas is able to, and I know that function exists). I know, this sounds all super complicated, but trust me After that we can specify what sim says what and when and where, etc. If not steal the WA's quest system

What is a Ouroboros?

Welllll:
Quote:
1. A symbol in the form of a snake biting its own tail, used especially in ancient Egypt and in Hermetic philosophy as an emblem of eternity.
2. The beginning and the end of something.


Now that that's out of the way, I wanted to have something that is sort of a modern old town, or say the events between Sunset valley and Pleasantview. (Fun fact, Sunset valley was supposedly going to be called pleasant valley). So specific people would come and go, but generally a world that's nature-y pleasing and just a small town in general, with some interesting characters and premade ones and what not. If you've got some ideas to feel free to write them down in this thread!

How will this benefit World builders?

Without much effort, if everything goes well, they can easily create their own stories and add sims to their worlds without playing the world and then save it, and then uploading that save file. Instead, They would be able to assign dialogues to each sim, if not, specific quests in order to make the world interesting and just generally making the world more liveable. Maybe even making something strangeville like!

How will this benefit Script modder?

The hassle right now is that if we were to debug a super big mod, we need to write our own, if not crossing our fingers that it works. Especially if someone would want to make a mod for a specific world this would be super helpful! I'll later add a visual studio project for the people among us that would like to manually be able to create sim dialogues or adding events, or other crazy weird stuff, etc.

So what about me?

Currently, I got most of it covered but if you want to give suggestions/feedback/etc. Let me know!
Advertisement
Space Pony
#2 Old 30th May 2019 at 5:10 PM
That sounds brilliant,
playing sims 3 can get repetetive at times adding quests/dialoges would be a "gamechanger" pun intended.

Quote:
What about adding quests or just dialogs in general when talking to specific sims?

When i read about that i was reminded of the work i did a few month back on my utility mod to add a multiple choice menu. So if i ever get that work done i could foward you the code if you are interested (but setting up multiple choice dialogs could be a lot of work)

I added a picture of the early dialog to illustrate better what i mean(obviously work in progress still default graphics etc)


Im also interested which approch you take with the quests etc going for procedural generation or import via xml i got so many questions but i dont want to bother you too much since you got your work cut out for you it seems :P

Good luck with your Project Lyralei !
Screenshots
Mad Poster
#3 Old 30th May 2019 at 7:07 PM
This sounds interesting.....it might interest me personally since I've been interested in custom text boxes and stuff.....whether it'd be possible to put a bit of text into a file in S3PE and have it come up in-game as a notification with a Sim's face next to it.

insert signature here
( Join my dumb Discord server if you're into the whole procrastination thing. But like, maybe tomorrow. )
Space Pony
#4 Old 31st May 2019 at 4:58 PM
This is a very cool idea. If the script is relying on specific sims in a world, though, you'd probably have to protect them from death and/or story progression somehow.

If you're looking for World Adventures-style quests, NRaas Careers uses an extensible framework for adding custom opportunities that could be copied and reworked to simulate quests, dialog options, scripted events, etc.

I'm finishing up a mod for the Business creator theme right now, but when that's done I'd be willing to help you out with scripting or writing/storytelling if you'd like.

"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt

If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Virtual gardener
staff: administrator
Original Poster
#5 Old 31st May 2019 at 10:43 PM
Thank you guys for the ideas and suggestions! I've been slowly making the debugging script more individually world-friendly (If that makes any sense?) Next step is making it more dynamic from a user experience kind of way.

On the other hand, is there anything that you'd want to see/would find useful when it comes to getting just general information from a world?

Quote: Originally posted by Battery
That sounds brilliant,
playing sims 3 can get repetetive at times adding quests/dialoges would be a "gamechanger" pun intended.
When i read about that i was reminded of the work i did a few month back on my utility mod to add a multiple choice menu. So if i ever get that work done i could foward you the code if you are interested (but setting up multiple choice dialogs could be a lot of work)
I added a picture of the early dialog to illustrate better what i mean(obviously work in progress still default graphics etc)
Im also interested which approch you take with the quests etc going for procedural generation or import via xml i got so many questions but i dont want to bother you too much since you got your work cut out for you it seems :P
Good luck with your Project Lyralei !


Nice! I didn't think of that but it shouldn't be too difficult. I know that EA uses CSS for their UI so might be worth checking that out. Else it's a great start to get more acknowledge to using the UI code.

Regarding the age and death thing, that's a good one. I know there are flags that you can apply to a sim to have them not die but probably need to make some sort of plan before starting to script this bit of the project.

Also, I'll try coming back to figuring out what to do on the helping area Right now it's pretty minor stuff that I started on, but I'm sure that at some point it will get a bit overloaded. I do appreciate the want to help though!
Virtual gardener
staff: administrator
Original Poster
#6 Old 9th Jun 2019 at 3:35 PM Last edited by Lyralei : 9th Oct 2021 at 12:15 PM.
I noticed something quite helpful actually. Existing worlds have XMLs (This is, all worlds except for Sunset Valley, which are non-cas created sims as well, whereas non-sunset valley sims are cas-created.) If we open AppaloosaPlains.world for example, and you search for specifically these TGI keys within S3PE: 0x0333406C-0x00000000-0xE51DF1C5C044A949

You'll find yourself an XML file. For the sake of explaining, I cut down the information.

Code:
<?xml version="1.0"?>

// The Character import actually refers to the CharacterImportOnGameLoad/CharacterImportCommands scripts
<CharacterImport>
// Then we have the relationship reference:
// Interestingly this piece of XML doesn't have a reference. But I did include 3 others to see how they're linked. The <SpreadSheetUniqueID> tag refers to our sim, the i.e <Sim_4> refers to the relationship they both have
// Reference of dead sims
// Reference of Towniesims
// Again bad parsing...? <Data> </Data>
</CharacterImport>


Now that you've gone through the notes, if so yay! I did notice that worlds don't have any sims data. I just hope that the UNKOWN types don't happen to hold those :P

Now a few things I found about what it ABSOLUTELY needs to have when you'd create your own is:
  • The TGI has to be exactly this: 0x0333406C-0x00000000-0xE51DF1C5C044A949 (All EA worlds all have this exact TGI key)
  • Names like this: "Gameplay/Excel/EP06_World/Household:Batez" In a custom XML we can easily just call it 'Batez'. Custom worlds also just use the regular names so this is completely okay.
  • To get the SimDescriptionId (Which is a weird number like 3141542499305254288), you can get this by using Nraas as well. You need DebugEnabled for this and once you click on a sim>debugEnabler>Object>Who am I? You'll see this exact hash, also on custom sims.
  • EA's worlds are constantly being updated by the game. So if you open "C:\Program Files (x86)\Electronic Arts\The Sims 3 Showtime\GameData\Shared\NonPackaged\Worlds" For example and you have a save there, you will see your sim in a Snap, but also in the XML file. However, Custom worlds are weirdly never updated.

Now, on gameload, the CharacterImportOnGameLoad is being triggered. I'm wondering now if having a save file, getting the correct SimDescID key and all would make it read a Custom XML since Custom worlds aren't exactly being updated by default, but we still don't know if the game just literally ignores them whatsoever either.
Virtual gardener
staff: administrator
Original Poster
#7 Old 10th Jun 2019 at 5:56 PM
I noticed that EA left quite a bunch of their "Export" helpers. Now, the script Sims3.Gameplay.WorldBuilderUtil.CharacterImportCommands.ExportVisibleSimsToFile() Sort of does what I want it to do. Which is a big yay! Because the game ended up creating an XML file inside Documents/The sims 3 and exported this:

Code:
<?xml version="1.0" encoding="utf-8"?>
<CharacterExport>
  <Sim>
    <Name>Lilly Bachelor</Name>
    <Age>YoungAdult</Age>
    <SimDescriptionID>4916805570223393520</SimDescriptionID>
    <Traits>
      <Trait>SociallyAwkward</Trait>
      <Trait>CommitmentIssues</Trait>
      <Trait>Mooch</Trait>
      <Trait>EasilyImpressed</Trait>
    </Traits>
    <Skills>
      <Skill>
        <Name>Photography</Name>
        <Level>0</Level>
      </Skill>
    </Skills>
    <Career>
      <Job>
      </Job>
      <School>
      </School>
    </Career>
    <Buffs>
      <Buff>SqueakyClean</Buff>
    </Buffs>
    <Pregnant>False</Pregnant>
    <Relationships>
    </Relationships>
  </Sim>
  <Household>
    <Name>Gameplay/Excel/EP05_World/Households:HouseholdNameNotSpecified</Name>
    <ID>1</ID>
    <Funds>200</Funds>
    <Description>Â*</Description>
  </Household>
  <Household>
    <Name>Bachelor</Name>
    <ID>6</ID>
    <Funds>660</Funds>
    <Description></Description>
  </Household>
  <Household>
    <Name>De Luca</Name>
    <ID>7</ID>
    <Funds>20000</Funds>
    <Description></Description>
  </Household>
</CharacterExport>


Now, looking at the 'CharacterExport' XML stuff, it does seem a bit different the way it states things. For example, traits have 'sub tags' whereas the 'CharacterImport' stuff seems to have just one line. So that's another mystery to solve.

For the ones wondering why I'm on a big hunt figuring out which function to use rather than creating it myself (Which I will be honest, would have made things faster), one thing that I got taught at least is "Don't rewrite code that's already there".
Back to top