nebul.amnesia

Newbie
Jan 6, 2025
33
80
79
Hello there again, Ive seen, that you want to inject textures. So I looked into it and its simpler than you think.

Ellens textures are stored in Player_Ani, and for modding inconviently in private fields named SPR_xx_index. Where xx is attack/naked/etc a and index number. So for example SPR_Naked_1 is array with sprites for naked Ellen animation.

And for example if we want to change that, i wrote example code that will on capslock replace ellens naked idle textures to some image x.png
Code:
 if (Input.GetKey(KeyCode.CapsLock))
    {
        GameObject player = GameObject.Find("Player");
        Texture2D newT = new Texture2D(1920, 1080);
        var b = File.ReadAllBytes("x.png");
        newT.LoadImage(b);

        Player_Ani ani = player.GetComponentInChildren<Player_Ani>();
   
       
        FieldInfo f = typeof(Player_Ani).GetField("Spr_Naked_1", BindingFlags.NonPublic | BindingFlags.Instance);
        var sprites = f.GetValue(ani) as Sprite[];
        for (int i = 0; i < sprites.Length; i++)
        {
        var spr = sprites[i];
         Sprite newSprite = Sprite.Create(
             newT,
             new Rect(0, 0, newT.width, newT.height),
             new Vector2(0.5f,0.5f),
             spr.pixelsPerUnit,
             0,
             SpriteMeshType.Tight,
             spr.border
         );

       
         sprites[i] = newSprite;
        }

        f.SetValue(ani, sprites);
   
}
And as real example I provide gif, with ellen changing to some random image.

View attachment 5621955
As you can see, i really changed ellens idle texture to pipe(that was first image i found) at runtime. But Id recommend writing something better, because this has to process the image on cpu and causes lag on change, you can even see it on the gif. So load all textures on game start and then just swap, but as concept works.
There are multiple sprites on Ellen but I change them all because I am lazy to just target the head or body sprite.
Man you are one step ahead of everyone here. It may be just a concept but it's one that works.
Also the factory must grow


I believe someone had made a TextureReplacer BepInEx plugin and even made a version of that plugin that specifically works best with AQE and from the looks of it, it was not only efficient but practical to use with an option to switch between texture sets.

Now, I'm only a web developer, I don't know C/C++ or whatever is used to make script mods but maybe you could look into that ?
 

kwanlier

Active Member
Oct 26, 2019
597
1,095
379
Hello there again, Ive seen, that you want to inject textures. So I looked into it and its simpler than you think.

Ellens textures are stored in Player_Ani, and for modding inconviently in private fields named SPR_xx_index. Where xx is attack/naked/etc a and index number. So for example SPR_Naked_1 is array with sprites for naked Ellen animation.

And for example if we want to change that, i wrote example code that will on capslock replace ellens naked idle textures to some image x.png
Code:
 if (Input.GetKey(KeyCode.CapsLock))
    {
        GameObject player = GameObject.Find("Player");
        Texture2D newT = new Texture2D(1920, 1080);
        var b = File.ReadAllBytes("x.png");
        newT.LoadImage(b);

        Player_Ani ani = player.GetComponentInChildren<Player_Ani>();
    
        
        FieldInfo f = typeof(Player_Ani).GetField("Spr_Naked_1", BindingFlags.NonPublic | BindingFlags.Instance);
        var sprites = f.GetValue(ani) as Sprite[];
        for (int i = 0; i < sprites.Length; i++)
        {
        var spr = sprites[i];
         Sprite newSprite = Sprite.Create(
             newT,
             new Rect(0, 0, newT.width, newT.height),
             new Vector2(0.5f,0.5f),
             spr.pixelsPerUnit,
             0,
             SpriteMeshType.Tight,
             spr.border
         );

        
         sprites[i] = newSprite;
        }

        f.SetValue(ani, sprites);
    
 }
And as real example I provide gif, with ellen changing to some random image.

View attachment 5621955
As you can see, i really changed ellens idle texture to pipe(that was first image i found) at runtime. But Id recommend writing something better, because this has to process the image on cpu and causes lag on change, you can even see it on the gif. So load all textures on game start and then just swap, but as concept works.
There are multiple sprites on Ellen but I change them all because I am lazy to just target the head or body sprite.
This is...quite a discovery if you ask me
So...
1. Where do we have to put the modded sprite sheet(s) in order to make this script work?
2. Is it possible to make a multiple variants of 1 sprite sheet? (think of something like, multiple costumes)
3. Where does this code go?
 

FinFenni

Newbie
Dec 16, 2024
31
15
44
This is...quite a discovery if you ask me
So...
1. Where do we have to put the modded sprite sheet(s) in order to make this script work?
2. Is it possible to make a multiple variants of 1 sprite sheet? (think of something like, multiple costumes)
3. Where does this code go?
What do you think? what could this discovery make possible? Excuse me as i'm not an expert on these, i'm more of a writer than a model-maker haha!
 

nebul.amnesia

Newbie
Jan 6, 2025
33
80
79
What do you think? what could this discovery make possible? Excuse me as i'm not an expert on these, i'm more of a writer than a model-maker haha!
I think it just means you were able to mod the game in a non-destructive manner, a.k.a a way that doesn't involve tampering with the game files.
 

kwanlier

Active Member
Oct 26, 2019
597
1,095
379
What do you think? what could this discovery make possible? Excuse me as i'm not an expert on these, i'm more of a writer than a model-maker haha!
You see...in KMod, we actually had a plan to do more of art stuff, however due to lack of experience, mostly me, we only managed to do the art stuff on the in-game menu babydoll (mostly because of different between how the in-game menu babydoll load and how sprite load).

If we know how to quote on quote "switch" character's sprite sheet around, not only we get to switch Ellen's outfit around, we may even get PREGNANT ELLEN too though the editing of the in-game menu babydoll is limited to the existing area of the image, which will make pregnant Ellen look weird.
 

nebul.amnesia

Newbie
Jan 6, 2025
33
80
79
You see...in KMod, we actually had a plan to do more of art stuff, however due to lack of experience, mostly me, we only managed to do the art stuff on the in-game menu babydoll (mostly because of different between how the in-game menu babydoll load and how sprite load).

If we know how to quote on quote "switch" character's sprite sheet around, not only we get to switch Ellen's outfit around, we may even get PREGNANT ELLEN too though the editing of the in-game menu babydoll is limited to the existing area of the image, which will make pregnant Ellen look weird.
Hope this doesn't come out as harsh but what is KMod ? I only ever heard of BonedMod and HornyEve
 
4.50 star(s) 129 Votes