nebul.amnesia
Newbie
- Jan 6, 2025
- 34
- 83
- 79
Man you are one step ahead of everyone here. It may be just a concept but it's one that works.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
And as real example I provide gif, with ellen changing to some random image.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); }
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.
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 ?