Loading a character via mod (1 Viewer)

Churchill

Potential Patron
Joined
Jun 21, 2014
The basic goal I have is to make a "character reload" feature as part of my mod but I'm having difficulty discerning where that action is going on. In the decompiled SDT core I found the characterMenu object and I also see in Loader where there are hooks into various aspects... but I've not figured out where the interaction with the menu is versus where the actual loading occurs.

Anyone familiar enough with the object model to point me in the right direction?
 

stuntcock

Content Creator
Joined
Jun 5, 2012
Churchill said:
The basic goal I have is to make a "character reload" feature as part of my mod but I'm having difficulty discerning where that action is going on. In the decompiled SDT core I found the characterMenu object and I also see in Loader where there are hooks into various aspects... but I've not figured out where the interaction with the menu is versus where the actual loading occurs.

Anyone familiar enough with the object model to point me in the right direction?
Writing ActionScript which ties into the SDT UI can be a bit tricky. There are a few functions which don't cooperate with proxies (such as the big "Reset" button). The simple answer to your request is
Code:
g.inGameMenu.characterMenu.triggerSelect(g.inGameMenu.characterMenu.lastSelectedID);
but this answer may be too simple. It's similar to the "Revert to Saved" feature that you can find in office software - it will discard any changes (to costume, personality, resistance, etc) which have occured during the current game session. If the user has spent ten minutes assembling a custom character then they'll be very upset if you abruptly wipe away all of their work.

It may be useful to elaborate here -- why are you trying to reload the character and/or what do you hope to accomplish? How often do you envision this behaviour occuring, and in what context (e.g. once-per-character during the initialization of your mod, or every five minutes during gameplay)? Would it be triggered by user action or is it a fault-recovery behaviour invoked by the mod itself?

Alternatively - if you're trying to Reload simply because the character is dirty, then there's already a hotkey to remove all strands from the scene. If the character's position and anatomy has become screwy then loading an Animtools file will usually fix it.

If your mod is actually fiddling with character definitions at runtime (e.g. editing them into a new posture, saving them, loading each "posture variant" at the appropriate moment, etc) then you'll need to wait for feedback from someone who's more familiar with the stuff. I haven't even figured out how to get Character folders working on my end :'(
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
what does this 'character reload' specifically do?

load charcode?
load mods?
load loader character folder?
clear strands and reset initial resistance and reset dialog?
 

Churchill

Potential Patron
Joined
Jun 21, 2014
Good questions, the lot of it. The quick-ish answer:
load charcode? Yes
load mods? Hai
load loader character folder? Yissss
clear strands and reset initial resistance and reset dialog? Si, senior

Let's say after ten minutes of alteration I have mussed something up and want to reset but I cannot (ever) be bothered with the mouse. I press F5 and kablam, it is as though none of it ever happened.

Why not just use the mouse? See above.
I cannot (ever) be bothered with the mouse

But also because sometimes alterations require resetting because hair/costume/whatever mods don't unload due to that specific parameter in the settings file I can't recall the name of offhand.

Why not just alter the settings file or have a settings file per character? See below.
Haha just kidding I got nothing.

Seriously, though, the reason would be for a reliable one-size-fits-all-comfy-pajamasuit reload of the character. So, for specifics, the F5 would first reset (ala-peanut-butter-sammiches) using loader.resetCharClicked() and then load the character again as though just clicked from the menu... thus coloring within the lines of the aforementioned quote (not that one the one above that, the one about the mouse... we don't get along but don't tell it).

So possibly...
Code:
var lastCharacterID:uint = g.inGameMenu.characterMenu.lastSelectedID;
loader.resetCharClicked();
g.inGameMenu.characterMenu.triggerSelect(lastCharacterID);

Not sure if the lastCharacterID is necessary, maybe the reset won't reset which character was loaded last? I'll will play with it and see.

Thanks, as always, for your input and kind assistance. I'm still listening if further discussion ensues. n_n
 

Faceless

Content Creator
Joined
Jun 12, 2011
The loader does natively iterate through character folders, so all you'd need to do is set up your mod in a folder (which you should be doing anyway), and then hit whatever key you've mapped to 'Next character' followed by 'Previous character'.
 

Churchill

Potential Patron
Joined
Jun 21, 2014
Faceless said:
The loader does natively iterate through character folders, so all you'd need to do is set up your mod in a folder (which you should be doing anyway), and then hit whatever key you've mapped to 'Next character' followed by 'Previous character'.
Definitely designing my mod to be sourced from a directory nestled under the «root»/Mods directory. For my preference it is currently in the $INIT$ directory.

The loader functionality to cycle through custom characters isn't exactly what I'm looking for in this particular instance. Basically I'm looking for a "refresh" button that clears out changes and loads the character again.

Initial attempts with just g.inGameMenu.characterMenu.triggerSelect(«character_id») haven't panned out. I may not be referencing the character ID correctly because it traces back as 1. I'm fairly sure if I can nail the character ID then I can get the thing working.

Turns out that the character ID is being referenced correctly but apparently since I nest characters under sub-folders it isn't targeting the right source of information.

My directory hierarchy goes a bit like...
«root»ModsGenre ACharacter 1
Character 2
Character 3
Genre BCharacter 4
Character 5
Genre CCharacter 6
Character 7
Character 8

If I drill down on Genre A and click the second character, the character ID traces back as 2.
If I drill down on Genre C and click the second character, the character ID ALSO traces back as 2.

Sooooooooooooo... seems like I need to target the last selected MENU ITEM and not simply the last selected ID... if that's even possible ;)
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
just glanced at loader code
might be able to get away with:

l.loadCharString(mycData); //not even sure if this is accessible


where mycData is the l.cData that is grabbed in the initl(l)

try not to blow out the stack along the way
 

Users who are viewing this thread

Top


Are you 18 or older?

This website requires you to be 18 years of age or older. Please verify your age to view the content, or click Exit to leave.