|
Post by spaar on Feb 24, 2015 19:13:09 GMT
Ok, so what would you guys propose as a "format" for loading mods ? I'm currently just loading every *.dll file in a "Mods" directory as an Assembly. Then I search for a class named "Mod" inside a namespace named "meta" and treat it as a component which I attach to a GameObject. Oh, and I also read a name for the mod. Not exactly an elegant system though, I did it mostly because it was quick & easy to get started with. I've been thinking of using attributes instead. Have a "Mod" attribute and load every class you find that has that attribute. However, I'm certainly no .NET/C# expert, so maybe that's actually a really bad idea. If so, please tell me Any thoughts on that ? Or other ideas ? Hope this will help getting an actual mod loader going
|
|
|
Post by ITR on Feb 25, 2015 10:39:41 GMT
Can somebody point me to the path of the files I need to decompile?
Steam version, if that matters.
|
|
|
Post by zodium on Feb 25, 2015 10:41:30 GMT
According to Zeblote, the important files are:
besiege\Besiege_Data\Managed\Assembly-CSharp.dll besiege\Besiege_Data\Managed\Assembly-UnityScript.dll
|
|
|
Post by ITR on Feb 25, 2015 11:04:01 GMT
Does the speed percentage slider use Time.timeScale and Time.deltaTime?
|
|
|
Post by zodium on Feb 25, 2015 11:13:30 GMT
Sounds interesting, start a thread on it?
|
|
|
Post by ITR on Feb 25, 2015 11:57:56 GMT
Probably would take 1 minute to test, I just can't right now because I'm at school. Time is unity's built in thingy, where Time.deltaTime gives you the amount of time since last frame (as a float), making it possible to have something last n seconds rather than n frames. Time.deltaTime get's automatically multiplied with the time between each frame, so if Time.deltaTime = 0.5, then something like:
float a = 0; while(a<1){ a+= Time.deltaTime; }
Would take 2 seconds instead of 1.
|
|
|
Post by Zeblote on Feb 25, 2015 12:28:37 GMT
|
|
|
Post by spaar on Feb 25, 2015 12:28:55 GMT
I'd imagine it uses Time.timeScale and not deltaTime. But I can quickly test it. Edit: Damn it, Zeblote beat me to an answer
|
|
|
Post by zodium on Feb 25, 2015 12:34:15 GMT
Why not read the docs what those properties do? Uh, just in case you forgot what the OP currently looks like: This thread is still a WIP and a stub. More information will come shortly.IntroductionThis thread is the place for discussing Besiege modding. It's a perfect place to ask questions, discuss and showcase anything related to modding. Eventually, this thread will contain information on how to install mods, creating mods and FAQ for modding questions. Installing modsSoon! Creating mods
Soon!
Frequently Asked Questions
Ask questions and the most common ones will arrive here! No offense to VL intended.
|
|
|
Post by ITR on Feb 25, 2015 12:42:10 GMT
I know what they do, I'm just wondering if that's what Besiege uses. It wouldn't make sense to use anything else, but they could.
|
|
|
Post by spaar on Feb 25, 2015 12:43:16 GMT
Besiege is indeed using Time.timeScale for the time slider. Just tested it to make sure.
|
|
|
Post by ITR on Feb 25, 2015 12:44:54 GMT
Besiege is indeed using Time.timeScale for the time slider. Just tested it to make sure. Thanks :3 Can't wait until I get home and get to try it out
|
|
|
Post by Zeblote on Feb 25, 2015 14:16:01 GMT
Why not read the docs what those properties do? Uh, just in case you forgot what the OP currently looks like: Actually I think I misread his post, I thought it said "or" not "and".
|
|
|
Post by zodium on Feb 25, 2015 14:40:29 GMT
Oh, that makes sense.
How do you change C# code? I want to remove the ammo limit on cannons (Artillery.Fire in Assembly-CSharp), but when I try to use 'Replace all with code' on Fire() or the instruction that sets hasFired to true (#40), I get a window with some comments and little code. If I paste my patched code in and compile, I get an error about an 'assembly with the same identity.' What gives?
|
|
|
Post by Zeblote on Feb 25, 2015 14:44:47 GMT
Oh, that makes sense. How do you change C# code? I want to remove the ammo limit on cannons (Artillery.Fire in Assembly-CSharp), but when I try to use 'Replace all with code' on Fire() or the instruction that sets hasFired to true (#40), I get a window with some comments and little code. If I paste my patched code in and compile, I get an error about an 'assembly with the same identity.' What gives? Rename mscorlib.dll to something else, compile the code, then change it back. That should prevent the identity error, see www.telerik.com/forums/reflexil-replace-all-with-code-fail-cs1703#5CDcJK_KZkiy_E33eL6ZAg for explanation However for simple/small edits it is much faster to just edit the il codes.
|
|