When I've tried to build a mod recently, any custom scripts I've added do not get saved as an Asset. No matter what I do, the ModTools always fail to recognize that the script is anything useful. What am I doing wrong?
When I've tried to build a mod recently, any custom scripts I've added do not get saved as an Asset. No matter what I do, the ModTools always fail to recognize that the script is anything useful. What am I doing wrong?
@HellFireKoder Thankee, my fellow! Just be sure to to tell me about it. Although I'll probably hear it anyways
@KingHandspider Unfortunately I can't think of anything else, and I don't have a Mac of my own to test with.
I will note this down with a link, and hopefully one of the other devs with a Mac can check it out after SR2 development has settled down a bit.
Sorry for the inconvenience.
@HellFireKoder I reckon that as a Dev, you're understandably pretty occupied with the SR2 release, but is there anything final you might suggest?
@HellFireKoder | macOS 10.12.6 (16G1314). Also, did remember to enable the mod.
@KingHandspider yeah, it adds 2m/s to airspeed when I press 9...
I assume you enabled the mod in the mods menu... hmm... what version of macOS are you running?
@Gestour , This is a mostly unrelated thing, but for your GPWS mod, how did you determine the pitch and bank angle of the aircraft? I figure it was from using ...PlayerAircraft.MainCockpitRotation, but is that in local space or world?
@HellFireKoder Nope. Doesn't show anything in assemblies, either.
It adds 2m/s to the airspeed when you press 9, right?
@KingHandspider Thanks! It shows the assembly in the assemblies for me, and building it results in a perfectly functional mod with the script acting as I would expect... The script doesn't work in the sandbox for you?
@HellFireKoder Alright, I sent an email with a link to a Google Drive file, since it won't let me attach a .zip for security reasons
@KingHandspider would you mind sending me your project folder zipped up, so I can take a look? Or an separate/dedicated demonstration project folder, as long as it clearly has the same issue.
You can send it to william@jundroo.com
@HellFireKoder @Gestour This is the basic summary of whats happening.
- Open Unity 5.3.6f1
- Open a project with nothing but the untouched ModTools in the Assets
- Create a new .cs script with a generic name, like AutopilotBehavior.cs
- Add it to a Game Object
- Select the G.O., then open the mod builder dialogue, and click "Save Selected Game Objects"
- Click "Save Mod - PC"
Nothing appears under the "Assemblies" dropdown menu.
@HellFireKoder And I have built the mod properly. I noticed this issue after I loaded the mod into the game.
@HellFireKoder I extracted the .zip using a different program, and it now produces the .unitypackage correctly. However, upon building the mod, and loading it into the game correctly, none of the scripts I've added function, or show any evidence of even existing.
I have examined the log, to no avail.
@KingHandspider after you extract the zip, there is a Unity package inside, which should be imported into Unity using the "Import Package" context menu.
What program are you using to unzip it?
Also, I'm not sure if it's there on Mac, however on PC Steam installation, within the installation folder there is a "ModTools" folder which contains the unity package.
You shouldn't need any tag on the game object, or a using directive just to compile your own scripts into the mod...
If the Unity package doesn't change anything, I just want to confirm that you've actually tried running the mod and the scripts, and they indeed fail? If not, perhaps it's just not showing the assembly in the mod builder for some weird reason that you don't need to worry about...? However if it does fail, it's possible the error message(s) in-game (or your outputlog after trying to load the mod/scripts) would be helpful.
@HellFireKoder @Gestour Is there a certain "using" directive I should have? Maybe the GameObject needs to be given a certain tag?
@HellFireKoder Update: nothing worked
@HellFireKoder I downloaded it from the Modding Wiki subreddit. I've tried extracting the .zip, but all of the assets are still encoded/not present. I did however take the ModTools from one of the example mods, and it seems to work.
However, it doesn't solve my original problem of the scripts not compiling into a .dll
@KingHandspider where did you get the version you are using?
What about just extracting the zip file?
@HellFireKoder Ah. I think it might be something to do with the version of ModTools I'm using, but I can't use the version from the Subreddit, because it downloads as a .zip file, and when I change the extension to import it, it says that all files are already in my project. Which they're not.
@KingHandspider that's probably not it, then...
@HellFireKoder I've been using 5.3.6, not 5.3.6f1. I will try that now and report the results
Also if this is what it was the entire time I shall be very cross
@KingHandspider You should not have to use Unity's build player menu... Are you using Unity 5.3.6f1?
Could I see a screenshot of your mod builder window, and the project window in the folder with your scripts?
I really would have to see your project to know what's going on.
The scripts in my Mods are attached to gameObjects or plugins, and they never show up in the Assets list as scripts.
@Gestour @HellFireKoder Is this when I build the player? I didn't think I had to do that for mods. When I click "Save Mod - PC", it just says "Mod Saved etc"
@KingHandspider What does it say in the console after you try to build?