DeadCore mods/addons - proof of concept (hopefully)
8 years ago
New South Wales, Australia

My current dodgy way of doing things (it works, but it can probably be a lot better) is as follows:

1: I created a Visual Studio Class Library Project that includes references to the default Assembly-CSharp.dll and the UnityEngine.dll and made a static class with Update and FixedUpdate methods

2: Using .NET Reflector and Reflexil I loaded the Assembly-CSharp.dll and injected a reference to my DeadCore class library and also injected method calls into the Android scripts Update and FixedUpdate methods to call the corresponding static methods in my class library (This can also be done for whatever other method you might need from DeadCore, for example GameManager's LevelFinished method, although it's probably not needed for that since you can add a method call to the LevelFinished event), this can be a bit tricky because if you try and replace all with code with Reflexil then you can't access any other methods or member data from other classes in the dll, so I inject them as raw opcode instructions, which is pretty simple (Go to Tools -> Reflexil v1.6 -> Select the method you want to inject -> Right click in the instructions area -> Create New -> opcode = call, operand type = method reference, operand = whatever the method in your class library is -> and then place it just above the return statement and if there are any instructions above that look like '-> (33) ret' then edit them and change the operand to be your instruction that you inserted.

Once you've inserted instructions they won't immediately show up in the code window as you'll have to select the Assembly-CSharp library and save it with Reflexil and then reload it.

3: Made my own custom classes and objects with Visual Studio through calls from the static class in Visual Studio.

4: Copy both dll files into the Managed folder of DeadCore and viola, if everything was injected correctly and you maintained the stack of the methods you injected instructions into and the class library compiled then it should work as intended.

This is my current code for accomplishing this which should hopefully show how it all works, there is no doubt in my mind that a better way exists to do this, but this is where my experimenting has taken me so far.

Feel free to add me on Steam (standalone27) if you have any more questions that I might be able to help with, or if you come up with a better way.

France

That's pretty nice, I'll try to play with that. I'll add you on steam once I get home, maybe we can do something great together :)

New South Wales, Australia

Just finished banging together this to see if it would work, and my god it does, the source looks like a load of horse manure, but it works :3

Vermont, USA

Wow, Standalone is a god. Multiplayer looks funny, though. But I can see all of this being useful when it comes to running the game, including removal of the frustratingly loud, unskippable title cards! Great work

Oyun istatistikleri
Takipçiler
70
Oyunlar
495
Oyuncular
49
En Son Konular
Yayınlanma tarihi 6 years ago
41 yanıt
Yayınlanma tarihi 6 years ago
2 yanıt
Yayınlanma tarihi 7 years ago
1 yanıt
Yayınlanma tarihi 8 years ago
23 yanıt
Yayınlanma tarihi 3 years ago
1 yanıt
Yayınlanma tarihi 6 years ago
2 yanıt