Free Download SimplePlanes v 1.8.308 Hack MOD APK (full version) For android mobiles, Samsung HTC Nexus LG Sony Nokia Tablets and More.
SimplePlanes 1.8.308Apk for Android
Offline
Note: This game requires at least 512MB of RAM and a 1GHz CPU.
Free direct download last version SimplePlanes from RexDl. Bring all of the imaginative aircraft you’ve had in your head to life.
Snap parts together to build your airplane’s body. Place engines to add thrust. Design the wings and then strap yourself into the pilot’s seat and see how it flies.
AIRPLANE DESIGNER
You have the tools you’ll need to bring almost any airplane to life. Use the flexible wing tool to change the shape of the wings and build almost anything.
Next-generation fighters, WW2 warbirds, civilian aircraft, and everything in between, some people have even made dragons, trains, and space stations.
DYNAMIC FLIGHT MODEL
Flight simulation at its finest. Every little change you make in the designer impacts how the airplane flies. Weight distribution, thrust, lift, and drag are all calculated before creating the final flight model.
REALTIME DAMAGE
Parts can break off in spectacular fashion while flying due to over-stress or by hitting something. The fun won’t stop there though. You can keep on flying even with a missing wing if you’ve got the skills.
SANDBOX MODE
Test your airplane with no restrictions. So, you’ve had a rough landing and the left engine was knocked off? After watching the engine fly off into the sunset you may decide to go ahead and slap the throttle to full…give it another go with only one engine.
CHALLENGES
Climb into the cockpit of one of your custom aircraft and see how it does in the challenges. The challenges will keep you entertained for hours. Land on aircraft carriers, dodge surface-to-air missiles, race through courses, and so much more.
AIRPLANE PAINTER
Use pre-built themes, or paint every part of your bird to make it just the way you want. Share your favorite stylings with all of your friends.
CROSS-PLATFORM AIRPLANE SHARING
There are no in-app purchases to get access to the airplanes people have shared; they are all available to download for free from http://www.SimplePlanes.com. You can use them even if they were made on another platform.
CONTROLLER SUPPORT
SimplePlanes supports USB gamepads/joysticks, and provides in-game input mapping for each control surface, as well as throttle, brakes, landing gear, pausing, cameras, etc.
EDUCATIONAL
Tutorials will help players learn the basics of real airplane design and the considerations that need to be taken when airplanes are made.
WHAT’S NEW
* Fixed issue where bodies would sometimes go to sleep when detached (like bombs).
* Fixed bug causing tail rotors to not be able to attach to some objects in the designer.
* Fixed issue causing propeller engines to have a different center of thrust location in v1.8.
Setup:
- “APK” install it on your device.
- Enter the game.
Getting Started
SimplePlanes Tools
- SimplePlanes Mod Tools - A Unity package needed for creating SimplePlanes mods in Unity 2018.3.6. For Steam users, an up-to-date copy of the mod tools unity package can be found in the game's installation directory under the ModTools folder.
Third Party Tools
Unity 2018 - Its free and you can get 2018.3.6 here
- Note: Mods may need to be created in a specific version for them to work for SimplePlanes. Newer versions of Unity could potentially break compatibility with SimplePlanes modding. The current version has been tested with Unity 2018.3.6. It may work with newer/older versions, but this is the one which has been verified to be compatible for SimplePlanes modding.
Visual Studio 2018 Community Edition - Optional but recommended. Its free and you can get it here: https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx
Tutorials and Examples
Example Mods
Smoke Trails - An example mod that adds a smoke trail part to the game.
Combat Challenges - An example mod that adds several combat based levels to the game.
Video Tutorials
NOTE: The following video tutorials are outdated. Many of the concepts covered are still valid, but some of the information is now outdated and invalid.
Getting Started - A basic tutorial on how to get started with modding SimplePlanes.
Custom Map - A tutorial that covers the basics of creating a custom map.
Custom Challenge - A tutorial that covers the basics of creating a custom challenge.
Custom Skybox - A tutorial that shows how to change the default skybox using a 'Map Plugin' object.
Dev Console - A tutorial that covers the basics of the developer's console.
Custom Parts - Part 1 - A tutorial that covers the basics of creating custom parts by tweaking an existing part.
Custom Parts - Part 2 - A tutorial that shows how to implement a custom behaviour for a part. This tutorial shows how to create a part that leaves trails behind it as it flies through the air. NOTE: This tutorial was recorded before implementing a floating origin in SimplePlanes. Due to the floating origin, the existing trail renderer no longer behaves as desired when the origin repositions. The concepts covered here are still valid though.
Custom Parts - Part 3 - This tutorial builds off of the custom trail emitter part created in the previous tutorial and enhances it. This covers the basics of modifiable designer properties and wiring up an input controller.
Custom Parts - Part 4 - A tutorial that covers the basics of creating a custom part with a custom mesh.
Loading Mods in Game
Before starting SimplePlanes, place your mod files in the SimplePlanes mod folder.
For PC users: '%USERPROFILE%AppDataLocalLowJundrooSimplePlanesMods'
For Android users: 'Android/data/com.jundroo.SimplePlanes/files/Mods/'
Alternatively, if SimplePlanes is has been associated with the '.spmod' or '.spmod-android' file extension (should always be the case for android), simply opening up the '.spmod' or '.spmod-android' file should automatically deploy the mod to the correct directory and start up the game.
When SimplePlanes is started, it will scan the mods folder for any mods that it may contain. These mods must be enabled before the can be used. Scrolling down to near the bottom of the main menu, there should be a mods section containing a list of discovered mods. Selecting a mod here will popup an info dialog with the option to enable the mod. Once a mod has been enabled, custom maps and challenges included in the mod should immediately appear in the menu above. The game should remember which mods are enabled between play sessions. A mod can be disabled the same way it is enabled, however the game will need to be restarted before the mod is fully unloaded. Whenever a mod changes (such as due to an update or rebuild of the mod), the mod will have to be manually re-enabled.
Steam Workshop
If you have a mod project and are ready to upload the mod to the Steam Workshop, here is how:
- Fill out the 'Steam Workshop Info' section in the mod builder window for your mod. Most fields should be fairly self explanatory. Hover over the field labels for additional tooltip info.
- Click the 'Save Mod - Steam Workshop' button. This will prompt you where to save the mod. On Windows, this should default to the mod directory for SimplePlanes (%userprofile%appdatalocallowJundrooSimplePlanesMods). Save the mod here.
- Open SimplePlanes via Steam.
- There should be a 'Mods' button on the main menu. Clicking this will take you to the mods page. From here there should be a list of mods on the left.
- Select your mod by clicking on the button with the mod's name on the left.
- Click on the 'Enable' button below the mod description.
- If the mod is successfully enabled it should have a green indicator on the mod's button on the left and no errors should show up in the mod description area. If a red indicator and/or errors appear, you will need to fix these before uploading to the Steam Workshop.
- Once enabled, a couple new options should show up in the bottom left. Before any of your mods can be publicly listed in the workshop, you will need to accept Steam's subscriber agreement. Clicking on the subscriber agreement text will open the in-game browser overlay to the agreement, where you can then accept. This only needs to be done once.
- There should now be a 'Publish to Steam' button that can be clicked. Doing so will pop up a progress window. If all goes well, the mod should upload to the Steam Workshop and you should see a success message.
- After a successful upload, clicking the 'OK' button will open the in-game browser overlay to your workshop item where you can further tweak various things like screenshots, descriptions, etc.
- Updating a mod already on the workshop should follow the exact same process. As long as the name of the mod doesn't change, the existing item should be updated.
The Basics of Creating Mods
Mods must be created using Unity. Create a new Unity project. Make sure the 'Scripting Runtime Version' is set to '.NET 4.x Equivalent' and the 'API Compatibility Level' is set to '.NET 4.x' for both Standalone and Android platforms. Import the SimplePlanes mod tools asset package, and you are ready to go.
The mod tools window adds a new menu item to Unity's menu bar. Under the SimplePlanes menu item, you can find the mod builder window. Using this custom editor window, you can start creating a mod.
Saving Scene Objects
Selecting an object in the hierarchy and clicking the 'Save Selected Scene Objects' button will save that object to be included in the mod. If changes are made to the object afterwards, the object must be re-saved for changes to apply to the mod.
Saved scene objects can be loaded via the ResourceLoader in the modding API similar to loading a prefab from scripts. When a game object is saved, the entire hierarchy of that object and its child objects is saved along with it.
There are a few special components defined in the API that, if attached to a game object being saved, will be handled in a special way by the mod tools.
- Map - Saving an object with the 'Map' component will flag that object as a map in the game (for use in sandbox mode and/or custom challenges). Any child objects of the map game object that have a 'MapStartLocation' component will flag the game object as a starting location in sandbox mode, allowing players to see the location in their locations dialog.
- PersistentObject - An object with a 'PersistentObject' component will be instantiated instantiated once when the mod is first loaded and will remain active until the game is closed.
- Designer Plugin - An object with a 'DesignerPlugin' component will be loaded every time the designer is entered and destroyed every time the designer is exited.
- Map Plugin - An object with a 'MapPlugin' component will be loaded every time a map is loaded and destroyed when the map is left.
- Part - Saving an object with a 'Part' component will flag that object as a custom part. See the custom part section for more information about creating custom parts for the game.
Saving Assets
Selecting assets in the project and clicking the 'Save Selected Assets' button will include the selected assets in the mod. These should show up in the mod builder window under the assets collection. Assets that show up here should be loadable via the ResourceLoader in the modding API.
When a game object is saved, all of the assets that it depends on should be saved as assets in the mod as well. It is worth noting that removing assets from the asset list will not necessarily exclude them from the mod if a game object included in the mod is still dependent on them. The ResourceLoader however will only be able to load assets that are listed in the asset collection of the mod builder window.
Prefabs are not able to be directly saved as assets. They are handled a bit strangely. More details can be found in the 'Quirks and Implementation Details' section below.
Saving Mods
To save a mod, just click the appropriate 'Save Mod' button in the mod builder window. A mod can be saved for PCs as well as Android devices, however they must be saved separately and are not cross-compatible. If you want to create a mod that runs on both sets of devices, you need to save the mod twice, once for PC and once for Android.
Custom Parts
Custom parts can be created by attaching the 'Part' component to a game object and then saving that game object with the mod tools. When a part is first created, the inspector window gives the option of creating a brand new part from scratch or cloning an existing part. Cloning an existing part is typically a good place to start. For the part component and other related components, hovering over the property labels in the inspector window will generally provide tooltips that may provide additional information.
Attach Points
Parts need one or more attach points to be able to attach to other parts. Attach points can be added by clicking the 'Add Attach Point' button at the bottom of the part component in the inspector window. Attach points are represented as child game objects of the part game object and they have a 'Part Attach Point' component. The attach point component provides a handful of properties that allow you to tweak exactly how the attach point is handled by the game.
The local position of the attach point game object determines where the part can attach to another part. Up on the local y-axis determines the outward face of the attach point. Be careful that the attach points are not located inside a collider of the part, otherwise the designer will not allow the player to use that attach point due to intersections with other parts.
Part Prefab Link
The 'Part Prefab Link' component is a special component that, when added to a part, tells the mod tools that the part will be using an existing part prefab already in the game. When a part with this component is saved, all child game objects of that part will be ignored (except attach points). If the part does not contain this component, the part game object along with all of its child game objects will be saved as a prefab that represents the part.
Part Modifiers
A part can have any number of part modifiers. Part modifiers provide configuration data and behaviours to the various parts. To add part modifiers to a part, select the desired modifier from the dropdown list at the bottom of the part component in the inspector and click then click the 'Add' button next to it. Custom part modifiers can be created the same way, just select the '-- Create New --' option from the dropdown.
Part Modifier Reference
If a part modifier that already exists in the game is added to a part, the mod tools will add a 'Part Modifier Reference' component to the part. This reference component will contain a set of name/value pairs representing the configuration of the modifier. The values can be changed. Examples of existing values in the game can be found in the tooltip for each name label.
Custom Part Modifier
Custom part modifier scripts can be created. These allow you to create custom behaviours for your parts. Using the mod tools to create a custom part modifier will create a new part modfier script, another monobehaviour script used by the mod tools in the editor only, and optionally a 3rd script the contains a monobehaviour to be attached to a game object in the part. Como instalar o idm.
The part modifier behaviour script (inheriting from Jundroo.SimplePlanes.ModTools.Parts.PartModifierBehaviour) is fairly simple. The base class provides access to a few things, but the actual implementation of the script depends entirely on what you want the custom modifier to do. This is a MonoBehaviour so it will receive all the normal Unity events like Awake, Update, FixedUpdate, etc.
The part modifier script (inheriting from Jundroo.SimplePlanes.ModTools.Parts.PartModifier) provides the configuration data for the modifier. Public fields added to this class should show up in the inspector. This class also contains an initialize method. If created by the mod tools and a behaviour script was created as well, the default implementation of the initialize method attaches the behaviour script to the root game object of the part. If the behaviour should be attached to a different game object or other initialization needs to occur, it can be done here.
The public fields of the part modifier can also be configured to be modified by the user in the designer. A few basic attributes have been provided in the Jundroo.SimplePlanes.ModTools.Parts.Attributes namespace. The DesignerPropertySpinner attribute provides a spinner control that allows the user to step through a range of values. The DesignerPropertySlider attribute provides a slider with a configurable range of values. The DesignerPropertyToggleButton allows the user to click a button to cycle through a range of values. This can be used for cycling through a list of strings as well as for boolean or enumerations values. The PartModifierDesignerHeader attribute can be added to the part modifier class to provide a user friendly name for the heading in the UI panel that contains the configurable properties. There are a few virtual methods on the part modifier base class that can help in working with some of these attributes.
Part Collider Configuration
For parts with one or more custom meshes, you will probably need one or more colliders. If the part has more than one collider, the 'Part Collider Configuration' component will need to be added to the game object with the primary collider and the 'Is Primary Collider' checkbox will need to be checked. The 'primary' collider should be the largest and most important collider for the part. It determines things such as whether or not the part is in water. There may be only one primary collider per part. The collider configuaration script may be added to any number of game objects for a part, as long as each object has a collider component. In addition to specifying the primary collider, the script also allows you to change the way the collider is handled by the game such as whether or not the collider should be considered when determining aerodynamic drag, part intersections, and what to mirror with the mirror tool.
Part Mesh Configuration
The 'Part Mesh Configuration' component can be added to any and all game objects of a part as long as those game objects contain a mesh renderer. This component allows you to modify a few aspects of how the game handles the mesh. If the mesh contains sub-meshes, this script allows you to specify which sub-mesh should be associated with the Primary, Trim 1, and Trim 2, colors. The script also allows you to specify the material type for each sub-mesh. The default material type is what the game uses for all of its default parts, allowing colors to be customized by the user. 'Custom With Original Colors' will keep the material set in the mod, allowing you to have textured parts. 'Custom With Theme Colors' will keep the material set in the mod, but the game will set the color value on the material's shader based on the colors selected by the user.
The Modding API
The SimplePlanes mod tools Unity package contains two assemblies that make up the modding API: 'Jundroo.ModTools' and 'Jundroo.SimplePlanes.ModTools'. There are additional assemblies that make up the rest of the mod tools, including assemblies for extending the editor, but your scripts should not need to know about these. The primary API through which scripts will interact with SimplePlanes is defined in the 'Jundroo.SimplePlanes.ModTools' assembly and namespace.
Custom Levels
Custom levels can be created by creating a script inheriting from the Jundroo.SimplePlanes.ModTools.Level class. In SimplePlanes, a 'Map' is the physical aspect of a level (i.e. the objects in the scene). A 'Level' is the game logic aspect that typically includes the win/lose logic. A level requires a map, but a map can be used in sandbox mode without a level.
When scripts are updated the mod tools will scan the project's scripts for levels and automatically include them in the mod. Levels included in the mod should show up in the mod builder window under the levels collection.
When creating a level script, there are a few pieces of information that must be passed to the base class constructor. The level name and description are what the user sees when selecting levels. The map name is a string that must exactly match the name of a map. The map can be included in your mod, or it can point to the default map used in SimplePlanes. For the default map, use the following constant: 'Jundroo.SimplePlanes.ModTools.MapNames.Default'.
The level base class provides many useful methods and overridable properties/methods. Calling the 'ShowMessage' method will display a temporary message to the player. Most levels will want to call 'EndLevel' at some point when the player either passes or fails the level. Overriding 'StartLocation' allows you to specify where the player should start in the level. Overriding 'TimerEnabled' and returning 'true' will allow you to make use of the level timer used in many of the built-in challenges. There are several other timer related properties that may be useful in time-based levels. Overriding 'FormatScore' allows you to display a custom score message to the user when the level is passed or failed. There are also overrides for some basic Unity events like 'Start', 'Awake', 'Update', and 'Fixed Update'. Not everything was mentioned here. Feel free to explore the level class via intellisense and have fun.
Proximity Loaded Objects
One way to expand the sandbox world in which players fly is through the use of proximity loaded objects. If you have a new object, such as a terrain that you want to add to sandbox mode, there are some hooks in the modding API that will help manage when it gets loaded and unloaded based on its distance from the player. A game object can be added to the scene that contains a component inheriting from 'Jundroo.SimplePlanes.ModTools.ProximityLoadedModObjectBase'. The properties on this object can be tweaked to specify the object that is loaded and how close the player must be before the object is loaded. The position of the associated game object determines where the object is loaded. An easy way to get these objects in to the scene is via child objects of a map plugin object. Overriding properties and methods on the 'ProximityLoadedModObjectBase' script can provide more possibilities with better control over what is being loaded and various helpful callbacks related to the loading/unloading of the object.
Service Providers
A 'Service Provider' in SimplePlanes is a class that provides mod scripts access to interfaces used to interact with various aspects of SimplePlanes. Mods that consist entirely of game objects and no scripts will not need a service provider. Most mods with custom scripts however will likely find themselves needing access to services provided by a service provider.
A service provider can be created by making a class that inherits from 'Jundroo.SimplePlanes.ModTools.SimplePlanesModServiceProvider'. Alternatively, the mod tools can create a service provider script for your project by using the SimplePlanes menu in the Unity editor and selecting 'Assets' and then 'Service Provider Script'. The script that the mod tools generate is simply named 'ServiceProvider' and provides provides access to the class via its static 'Instance' property.
The information below gives a brief overview of some of the services provided by a service provider. The list does not cover every feature of every service. Currently the best way to get information on everything that is available in the API is to just start exploring it in Visual Studio via intellisense or the object browser.
DevConsole
The dev console service provides the means to interact with the Developer Console in the game (described in its own section below). If using the service provider generated by the mod tools, access this service like so:
The dev console service can be used to register custom commands with the developer console (many overloads of 'RegisterCommand' are provided). Ideally commands should point to static methods or lambdas with no captured variables to prevent memory leaks. If you do find yourself registering non-static commands, be sure to call 'UnregisterCommand' when the object is destroyed or goes out of scope. The following example shows how to register a command that outputs the current map name to the log.
The dev console allows mods to register custom argument parsers for command argument types that are not currently handled (or to override existing parsers). The built-in argument parsers have a priority of 10. The lower the priority, the earlier they run. If a parser with a priority of 5 successfully parses an argument, the parser of priority 10 is never called. If the 5 priority parser fails, then the 10 priority parser gets to make an attempt. Here is an example of a custom parser for a Vector2 that only checks for a string value of 'zero':
Here is how to register the custom argument parser above:
EnvironmentManager
The environment manager service provides the means to interact with various aspects of the game world environment, such as the time of day and weather. If using the service provider generated by the mod tools, access this service like so:
GameCamera
The game camera service provides the means to interact with the cameras in the game. If using the service provider generated by the mod tools, access this service like so:
GameState
The game state service provides information and events related to the current game state. If using the service provider generated by the mod tools, access this service like so:
There are many events that can be hooked in to when the state of the game changes (entered/exited levels, maps, and designer, pause state changes, view changes, etc). These events can be hooked in to just like normal events in C#. Under the hood, these are implemented as weak events to prevent memory leaks, it is still good however to unsubscribe from events when no longer needed. The GameState service also provides the means to pause the game via scripts.
GameWorld
The game world service provides the means to interact with the game world. If using the service provider generated by the mod tools, access this service like so:
The following example shows how to show a temporary message to the player in the same style that the game uses for its other messages (such as toggling landing gear).
The game scales down the defined mass of aircraft parts at runtime so that the physics engine can work with smaller values. For instance, if a part is defined as weighing 1000 pounds and the mass scale is 0.01, the rigid body's mass would actually be 10 pounds. This scale factor can be obtained by the mass scale property of the game world service provider.
The water level (on the y-axis) in the game can be obtained or set via the property below. Setting this to null will remove the water. When the water is removed, 0.0 on the y-axis will still be considered sea level when determining altitude and air pressure.
The game makes use of a floating origin. The 'Floating Origin' section goes in to more details. The current floating origin offset can be obtained via the following property:
PlayerAircraft
The player aircraft service provides the means to interact with the player's aircraft as well as the aircraft controls. If using the service provider generated by the mod tools, access this service like so:
There are events that can allow a script to receive notification when and aircraft is damaged or when a part enters the water (doesn't necessarily have to be attached to the plane). Many values like air speed, altitude, fuel, velocity, and cockpit position/rotation can be read or manually set.
Want to give the player a little speed boost?
The 'Controls' property allows scripts to read and even set the current values of the various aircraft controls (which activation groups are enabled, is the landing gear down, what is the current VTOL and throttle setting, etc). It also provides methods for enabling and disabling default controls.
ResourceLoader
The resource loader service is an important service that provides the ability to dynamically load game objects and resources that have been included in your mod. If using the service provider generated by the mod tools, access this service like so:
When loading assets from your mod, the asset type and its full path must be specified. He is an example of how to load a material that has been included in the mod.
When loading game objects, only the name of the game object must be specified (as a mod cannot contain saved game objects of duplicate names). Game objects are loaded as prefabs, custom scripts are programmatically restored and unserialized, and then the object is cloned and returned to you. It is probably not a lightning fast process, so might be something to keep in mind.
UserInterface
Simpleplanes Mod Tools
The user interface service provides the means to interact with the player's user interface. If using the service provider generated by the mod tools, access this service like so:
The 'EventSystem' property provides access to the scene's EventSystem. This may be handy if you are creating a custom user interface using Unity's UI system. Also useful when it comes to creating custom UIs, this service provides the ability to show or hide certain elements of the built in UI. Want a custom VTOL slider? Just hide the built-in one, then create your own and feed its values back to the game via the 'PlayerAircraft' service's 'Controls' property.
Service Provider Mocks
Sometimes it can be handy to test some aspects of a mod by running it directly in Unity. The SimplePlanes code will not be available so testing will be limited however. Code that interacts with the mod API will not actually be doing anything and could throw errors. To prevent the throwing of errors and to allow users to implement custom test code when interacting with the API in the Unity editor, there are a collection of basic mock objects in the API. When using a service provider that was created via the SimplePlanes menu in Unity, these mock objects are automatically registered with the service provider.
Most of these mocks do absolutely nothing (which is typically better than throwing tons of errors). If you need custom code that executes when a particular service provider method is called or property is set, you can create your own mock. To create a custom mock, just inherit from the appropriate service provider interface (or existing mock) and then be sure to register the mock with the service provider using the 'RegisterService' method. A good place to do this would be in an overridden 'RegisterMockServices' method on the service provider.
Reflection
Much of the SimplePlanes codebase is not exposed in the mod API. While this can really limit what you can accomplish in some mods, luckily it can be easily worked around via reflection. Through reflection code, many scripts and variables can be accessed and changed. A reflection tools Unity package is available on GitHub that has some utility methods for working with reflection in SimplePlanes as well as a handful of proxy classes that expose additional aspects of the SimplePlanes codebase that are not available via the mod API. Take a look at some of the Example Mods for examples of how to take advantage of these reflection tools.
The Developer Console
Hitting the ` key will open up the developer console. The developer console will show all calls made to the various Debug.Log methods. It will not start tracking log statements however until it is opened at least once during the game session. Clicking on the text of a log entry should open a details panel below with additional details on the log entry and/or any truncated text of the log message if it was too long.
The input field of the console provides the ability to execute commands. The up/down arrows allow you to cycle through recent commands. There are only a few built in commands (so far).
- ClearLog - Clears any messages currently in the log.
- Help - Provides help information for the dev console (make sure to click the entry for details).
- Pause - Pauses the game
- Unpause - Unpauses the game
The console also provides the ability for mods to register custom commands. The DevConsole service in the mod API contains methods for registering and unregistering commands. Make sure to unregister your commands when appropriate to avoid memory leaks!
When invoking commands with command line arguments, the arguments must follow the command and be separated with spaces. If the argument includes spaces, it should be wrapped in quotes. Not all argument types are supported by the dev console (most of the basics should be covered though). If a command requires an argument type that is not currently supported, the DevConsole service in the mod API allows for the registration of custom argument parsers.
The other major feature of the dev console is allowing users to explore the game object hierarchy and interact with those game objects and components. The following list of commands provide an auto-complete popup dialog that allows users to find game objects and components in the scene as well as invoke methods, on those objects and get or set fields and properties.
- / - A single forward slash shows the list of root game objects. When appended to the end of a command string selecting a game object or component, it will show a list of immediate child game objects of the selected object.
- // - A double forward slash shows the list of all game objects in the scene. When appended to the end of a command string selecting a game object or component, it will show a list of all child game objects of the selected object.
- > - A single greater than sign will show a list of components on the root game objects. When appended to the end of a command string selecting a game object, it will show a list of components attached to that game object.
- >> - A double greater than sign will show a list of all components in the scene. When appended to the end of a command string selecting a game object, it will show a list of all components attached to any child game object of the selected object.
- . - A single period after a command string selecting a game object or component will show a list of all public methods, properties, and fields on that object.
- . - A double period after a command string selecting a game object or component will show a list of all public and private methods, properties, and fields on that object.
Methods on game objects and components can be invoked using the commands above using the same approach for passing arguments to commands that was discussed above. Selecting a field or property and submitting the command will return the value of that member (using the ToString() method to display it in the console). Selecting a field or property and passing an argument of the appropriate type will set that member to the specified value.
Floating Origin
The game uses a floating origin system. This helps avoid floating point precision issues when the player travels too far away from the origin of the game world. Whenever the player moves too far away from the origin (0,0,0), the whole game world is shifted back to reposition the player at the origin. This should appear seamless to the player. The current offset from the true origin is tracked in the GameWorld service provider via the 'FloatingOriginOffset' property.
When the world is repositioned, only game objects at the root of the hierarchy are moved. When the parent objects are repositioned, they should automatically reposition child objects as well since they are positioned relative to their parents. If a mod requires an object at the root of the hierarchy that should not be moved (such as UI components), the game can be told to ignore these objects when repositioning the world if they have the 'Jundroo.SimplePlanes.ModTools.IgnoreFloatingOrigin' component attached to them.
Layers and Tags
Layers and tags are set up per Unity project and will not transfer in a mod. When using the mod tools to start creating a mod, they will automatically update (and overwrite) the layers and tags for the project with those that SimplePlanes uses. There are 3 layers and 20 tags that are reserved for mod use only. The physics settings layer collision matrix can be seen here. Some layer information can also be obtained in the mod API in the 'Jundroo.SimplePlanes.ModTools.Layers' class.
Quirks and Implementation Details
The modding system in SimplePlanes makes heavy use of the Unity's Asset Bundle feature. The file that gets generated when creating a mod is just a normal uncompressed Unity asset bundle. The asset bundle contains a mod's assets, exported game objects (as prefabs), and the assemblies for the mod. Hopefully, for most modders, the details of how all this works with SimplePlanes will not matter. For those of you working on more complicated mods, running in to issues, or just curious how things are working, here are some details and quirks regarding the implementation of the modding system.
Unity project assemblies are renamed when being included in a mod. The modding system refers to Unity project assemblies as the assemblies that Unity generates for all the scripts included in a project (things like 'Assembly-CSharp.dll', 'Assembly-CSharp-firstpass.dll', 'Assembly-UnityScript.dll', and 'Assembly-UnityScript-firstpass.dll'). Assemblies must be uniquely named in order to be loaded, thus, the name of the mod is prepended to the generated assemblies (i.e. 'MyMod-Assembly-CSharp.dll').
When a game object is saved from a scene using the SimplePlanes mod tools, what is actually happening is a temporary prefab is created out of the game object. This is the prefab that is later included in the mod when it is saved. These temporary prefabs are included in the project in the '/Assets/ModAssets/' directory. An important step in this process is any scripts attached to an exported object or its child objects that are defined in a Unity project assembly are detached from the objects and serialized. When the object is later loaded in the game, these scripts are re-attached and their serializable properties should be restored. It is also worth noting that when loading saved objects, the object returned is a cloned copy of the prefab.
Prefabs are handled.. strangely. with the modding system. The mod tools will not allow a prefab to be saved as an asset in a mod. Game objects that have scripts pointing to prefabs should work, but what is happening behind the scenes might seem a little odd and could be a potential source of trouble. Any prefab asset that is considered a dependency (by Unity) of any exported game object will be included in the exported game object's hierarchy. If exported objects link to prefabs, the root object being exported will have a deactivated game object named '__mod-prefabs__'. Underneath this object will be all the prefab dependencies. These are the objects that are linked to in place of the original links to prefabs. If a script were to instantiate a linked prefab, what would actually happen is one of these 'prefab' objects included in the scene would be cloned.
Simple Planes Mods Download
Limitations and Workarounds
Using Unity's GUI system to link to a game object and invoke a method on a custom script will not work. Linking to a game object and invoking a command on a built in unity component or a component defined in another assembly should work however. An easy (but not ideal) workaround would be to link to a game object and point to GameObject.SendMessage() with the parameter being the name of the method in your custom script that you want to call (if multiple scripts on this game object have a function with the same name, they will also be called). The other workaround would be to define your custom scripts in an external assembly and then include that assembly in your Unity project.
Unity's animator will not update properties on custom scripts (animating properties on built in Unity components should still work though). Unfortunately, there is no great workaround for this. If the custom script is defined in an external assembly, the animator should be able to animate it.
Links to components defined in project scripts and those defined in external assemblies included in the project (and vice-versa) will lose their connections.
Known Issues
- Including external assemblies in your Unity mod projects may work, but no guarantees as this is mostly untested. There is certainly no code as of yet to ensure the proper loading order based on references between dependencies.
Upgrading Older Mods to Unity 2018.3
Here are a few things to know when upgrading older mods from the Unity 5.3.6 days to Unity 2018.3 (SimplePlanes Update 1.8.1.0).
Simpleplanes Xml Mod Download
- Before importing the new mods tools, make sure to set the 'Scripting Runtime Version' to '.NET 4.x Equivalent' and the 'API Compatibility Level' to '.NET 4.x' for both Standalone and Android platforms.
- If you want to build mods for Windows and/or Mac, you need both the Windows and Mac (Mono) Unity components installed with your Unity installation.
- Windows/Mac mods now include separate asset bundles for both platforms in a single mod file. You will likely noticed larger mod file sizes than before.
- A new 'Debug' build option is available which builds the mod only for Unity's current target platform with the DEBUG symbol defined (should be a faster build than the other build options).
- A bunch of classes received interfaces which have been added to the mod tools. You may be able to get away with using less reflection code by taking advantage of these interfaces. These live in the 'Jundroo.SimplePlanes.ModTools.Interfaces' namespace.
- If you are using the Reflection Tools, you probably need to make a few tweaks for them to function correctly. Take a look at the 2018.3 upgrade commit on github. Specifically, the changes to ProxyBaseType.cs and Field.cs.