[GUIDE]How to make mods for MySummerCar?

NOTE: This is a work in progress please let me know if anything is wrong, something feels like its missing or you have any questions.
NOTE: Some of the code/snippets have been written on the fly and has not been tested. Some may be faulty but please notify if they are and I will correct it!
NOTE: If you have any questions, need help or perhaps are thinking about something NOT covered in this thread PLEASE POST YOUR "OFF TOPIC" QUESTION IN THIS THREAD:
http://www.racedepartment.com/threads/how-too-start-programming-mods-for-my-summer-car.146394/

Skip to actual guide!
Scoll down to the headline "So where should I start?" and begin there!

What will I cover?
I will cover where to start in order to start making mods.
I will provide some very helpful snippets of code.
I will provide useful links and a FAQ.

Why are you doing this?
When I got introduced to the game and my friend showed me the mods I thought it would be fun trying to make one myself but that was not as easy as I thought.
(I NEVER inteded to ever release the mod I created either... but it became too good lol)
With a bit if research I managed to find MSCLoader Wiki and that got me started and setup.
Once everything was setup and working I started by creating a mod-project using the template provided by @piotrulos (The creator of the MSCLoader and forever a legend) and here is where I ended up stuck.
If I wanted to make some changes to an object in the game... How would I proceed?
If I wanted to make some changes to information in-game... How would I proceed?
This is where I ended up researching further and how I ended up finding the new thread created just 30 minutes earlier.
This thread is where I ended up being active in for a while when I was getting around and learning the process of making mods. (This is my first time ever...)
You can find this thread here: http://www.racedepartment.com/threads/how-too-start-programming-mods-for-my-summer-car.146394/

... and this is why I'm creating this guide, simple as that :)

(This part bellow is optional)
My initial instinct was to create a plugin that would make a list of all gameobjects in the current scene (World)... that way I knew what I could work with..
MySummerCar SceneObjects SourceCode: https://pastebin.com/pVqttvzH
MySummerCar Scene Objects list: https://pastebin.com/tkXq5mYd (Version: Dec 2017, this has changed!)

This was however, very, unnecessary since @zamp has created, litteraly, the ultimate developer toolkit for modding!

Also, after this I started PM conversations with @kunedo who has been very helpful with Ideas... hes just a really friendly and amazing guy all around helping etc. Thanks, really!

So where should I start?
First
, you will need an IDE; Visual Studio.
You can find it here: https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15

Secondly, you should start with finding the MSCLoader Wiki and start setting up your environment. Read through and learn how to use the MSCLoader:
You can find MSCLoader Wiki here:
https://github.com/piotrulos/MSCModLoader/wiki

NOTE: You may download either x86 or x64 bit version of Unity and reading both for player and developer is very useful.

Third, start by downloading and "installing" the "Developer Toolkit" so you can easily find and quickly modify gameobjects in the world.
Saves a lot of time not having to make changes, build and restart the game every time you try a new set of code for example in placing or re-placing gameobject in the world.
You can find Developer Toolkit here:
http://www.racedepartment.com/downloads/plugin-developer-toolkit.17214/

NOTE: Some Objects/Components also needs referenses to Assembly-CSharp.dll file.
("Steam\steamapps\common\My Summer Car\mysummercar_Data\Managed\Assembly-CSharp.dll")
Drivetrain, for example, does need this reference to work properly.
Thanks to @tommojphillips for finding this!

How can I make changes in-game?
This is fairly easy and basic kowledge. MySummerCar is created using Unity® software and that opens up a whole lot of methods, classes and libraries we can use.
Transforms, for example, is used to store an objects position, rotation, scale and parenting state.
MySummerCar is also using an asset called PlayMaker which makes it a whole lot harder at the same time. Depending on your goal ofcourse.

First, if you would like to make changes to example the car, Satsuma for example...
We need to create a variable/reference name:
Code:
GameObject satsuma; // Making a variable
Right now the reference is empty and we need to give it a reference to the object in the game..
Give it a reference/value:
Code:
satsuma = GameObject.Find("SATSUMA(557kg, 248)"); // Giving our variable a reference/value
Now the reference is set and we can access for example the transforms of the object to move or make changes. We can also activate/deactivate the object in the world. Now that we know how to access an object... How can I make changes to the information in the game?
This part is a bit tricky.. You need to find out which GameObject in the scene is "hosting" the component which makes these changes in order to change them... Unless they are maintained by a singleton instance. If they are maintained by singleton and are instanced they can, globally, be read or changed without the need of the "hosting" object.

Making changes to a component/variable:
Code:
satsumaDriveTrain = GameObject.Find("SATSUMA(557kg, 248)").GetComponent<Drivetrain>();
This means that you are getting the component "DriveTrain" on the Object "SATSUMA(557kg, 248)" and you may make changes or read values/variables from that component.

If it is a singleton variable or information you are looking for you may use a foreach method to get what you want to find:
Making a foreach for PlayMaker FSM:
Code:
// FloatVariables can be BoolVariables, StringVariables, GameObjectVariables, ObjectVariables, MaterialVariables and IntVariables
foreach (var flt in PlayMakerGlobals.Instance.Variables.FloatVariables)
{
    switch (flt.Name)
    {
        case "PlayerCurrentVehicle": // This is not a float
            _carCurrent = flt.Value.ToString();
            break;
        case "PlayerFatigue":
            _fatigue = flt;
            break;
        case "PlayerThirst":
            _thirst = flt;
            break;
        case "PlayerHunger":
            _hunger = flt;
            break;
        case "PlayerStress":
            _stress = flt;
            break;
    }
}

How do I detect if a player is in vehicle/car/"drive mode"?
Taking a look back to our code earlier we can use the PlayMaker FSM here and check if player is in any vehicle.
Code:
if (FsmVariables.GlobalVariables.FindFsmString("PlayerCurrentVehicle").Value != "")
{
    //Player is in drive mode
}

How do I use custom assets?
Code:
//Define objects
AssetBundle assets;
GameObject turbo;

//Onload.. We load, initialize and give references.
assets = LoadAssets.LoadBundle(this, "turbo.unity3d"); // Load this asset
turbo = assets.LoadAsset("turbo_prefab.prefab") as GameObject; //get specific prefab
assets.Unload(false); //Unload once all prefabs has been gathered to clean memory

//Placement
turbo = GameObject.Instantiate(turbo); //Instantiate object in the world
// OPTIONAL: turbo.transform.SetParent(GameObject.Find("satsu").transform, false); // We can set it as child object

//We set pos, rot & scale | Be aware, there are localPosition and Position. Choose relative to the use.
turbo.transform.localPosition = new Vector3(0.3f, 0.16f, 1.02f);
turbo.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
turbo.transform.localScale = new Vector3(0.0005f, 0.0005f, 0.0005f);

(I cant find the player!)
How do I find player?
@piotrulos stated in an early comment/reply that:
In 0.4 OnLoad will be called after game is fully loaded.
When OnLoad is called you can simply use this code:
Code:
GameObject player = GameObject.Find("PLAYER"); // Simple as this

OLD TUTORIAL; MSCLoader <= 0.3.5;
Finding the player is a bit tricky compared to finding another object in the world since it is "spawing" rather late.
Once OnLoad has finished running in your mod it has most likely not spawned yet and will result in a nullreference exception.
How do we make this work?
There are multiple options but I'm going to show you two:
Code:
//First option is the Coroutine method:

void Something()
{
   //Start coroutine
  StartCoroutine(setup());
}

IEnumerator setup()
{
   yield return new WaitForSeconds(15f); // Wait for something 15 sec
   ModConsole.Print("Success!");
}

Code:
//Second option is the update method:

public override void Update()
{
    //Loops untill player has spawned. May cause some lagg...
    if((GameObject)player == null)
        player = GameObject.Find("PLAYER");

    //Wrap other codes inside this container
    if(player != null)
    {
    //Run mod...
    }
}

**Threading removed**

Good luck and have fun!

Annoyances (and tips) of building mods:

When you are making mods you'll be, eventually, annoyed by three (major) things...
1: As a developer you need to manually copy the mod to the mod folder every time you makes changes/build the mod.
But that can be fixed by using this piece of code:
Code:
copy /Y "$(TargetDir)$(TargetName).dll" "C:\Users\YOURUSERNAME\Documents\MySummerCar\Mods"
It's basicly a "batch"/CMD command to copy the mod dll file to the location of your MSC mod folder.
How do I do that?
aaf95f2caf42619f48dcaefb508a5bb6.png

A: Right-click -> Properties
B: Find the tab "Build Events"
C: Find "Post-Build Event Command line" textarea and modify/copy the code above for everything you want to move with the build on each seperate lines.
D: Save.
E: Build and Enjoy!

2: You will need to restart the game a lot in order to test out the mod and check it out. (There, currently, isn't a way around this atm)
3: Bad reviews.
You may get bad reviews from users who doesn't "install" the mod correct, haven't bought the actual game and is playing on pirate copies etc.
My advice.. Brush it off and don't bother. If you enjoy creating, create and if you get a bad review or someone is being mean, ignore them and continue with your work.

My experiences and mods:
My experience has been great, No dubt. BUT lately i must admit that my interests have turned and I have been forced to focus on diffrent things. Work as an example has been very hectic.
I caught a break now and I wanted to help out the community :)

MySummerMultiMod: http://www.racedepartment.com/downloads/mysummermultimod.19405/

Useful links:
MSCLoader Wiki : https://github.com/piotrulos/MSCModLoader/wiki
PlayMakerFSM : All PlayMaker FSM
@zamp : https://github.com/zamp/MSC-Mods
@Roman266 : https://github.com/GishaSeven/Plugins-for-MSC-ModLoader
@tommojphillips : 2 Links below.
ModAPI: https://github.com/tommojphillips/ModAPI/wiki
Demo: https://github.com/tommojphillips/AttachObjectDemo

Special thanks to everyone who has provided information or helped with some outdated information!

Good nite everyone :sleep:
 
Last edited:
Can I get an opinion on the best way to replace Teimo's hat? At the moment I'm replacing his hat model with an alien head in the game files, but doing it that way I can't figure out how to get the textures in as well, so it looks awful. If I were gonna try and take the plunge and try to learn how to make this a mod, would there be a way to get the textures running as well?

For reference :
at the moment he's just got a flat blue looking head. If anyone has an idea on how I could get the textures going too, lemme know!
I currently don't have Unity or anything installed (fresh install) so I can only give you directions.
Look in to this: How-to-create-and-use-Asset-Bundles
If you were to create Barbo's head in unity (textures and all) and then export as AssetBundle it may be what you are looking for (In theory it should work BUT... I have never done it with textures.. I see no reason why it shouldnt work though!.).
Next step would be to find the head you are looking for and do whatever you want with it. Instantiate the new one in! :ninja:

Step1: Create AssetBundle
Step2: Create a mod which replace the head.
Step3: Publish =)
 
Nice tutorial, thanks!

But I can't import asset bundles. Once I try it, I get this famous error:
Error: Mod MyMod throw an error!
Details: Object reference not set to an instance of an object in Void OnLoad()

I'm not really sure what it means.

Mod source code

Structure of my ccassets.unity3d (taken from manifest):
Assets:
- Assets/ccobject.fbx
- Assets/ccobject.prefab

To create bundles I used this tutorial from the MSCLoader Github Wiki.
I had to change on line in the script for creating asset bundles (for the menu item) from
BuildPipeline.BuildAssetBundles("AssetBundles");
to
BuildPipeline.BuildAssetBundles("AssetBundles", BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows);
Otherwise the Unity Editor throw an error.

I hope my description is detailed enough and you can help me.
Thank you!


Edit - PROBLEM SOLVED:
I used the wrong Unity Version (not 5.0.0).
 
Last edited:
Now I'm able to import asset bundles successfully. Yay! :thumbsup:

But my next step is to add the feature that I can display a text and trigger a function when I look at my object (it's a collider, isn't it?).
I didn't find anything about it on the internet, could you maybe explain it to me? ;)

Would be very helpful
Thanks!!
 
Now I'm able to import asset bundles successfully. Yay! :thumbsup:

But my next step is to add the feature that I can display a text and trigger a function when I look at my object (it's a collider, isn't it?).
I didn't find anything about it on the internet, could you maybe explain it to me? ;)

Would be very helpful
Thanks!!

Me, personally, have done very little work in this specific area but Im working on a project that got me in to it recently. I've made this code and stripped it down so you can use it in your project. It's commented and should answer your questions.

Code:
    private RaycastHit vision; // This will be the object we're looking at.
    private float maxDistance = 4.0f; // The max distance of the raycast. Experiment with this.

    private void Update()
    {
       // We send the ray out from our MAIN camera position and forward. We receive the "hit" object as vision and set the raycast max length to be maxDistance.
        if(Physics.Raycast(Camera.main.transform.position, Camera.main.transform.forward, out vision, maxDistance))
        {
            if(vision.collider.tag == "testing") // We check if we are looking at an object with tag "testing".
                Debug.Log(vision.collider.name); //Print name of the object
        }
    }

Now, keep in mind that I'm unsure if this code needs some tweaking or if it works instantly. You may need to change "Camera.main" to another since I'm unsure how it works in MySummerCar. It should work though.
Another thing.. You can also change the way it looks for your item by changing "vision.collider.tag" to "vision.collider.name" in order to search for your specific item diffrently by name, switching out tag.

Glad you found a solution to your problem! (Previous post!)

Let me know how it works! Good luck =)
 
Last edited:
Code located at "Making changes to a component/variable:" example has an error;
Code:
satsumaDriveTrain = GameObject.Find("SATSUMA(557kg, 248)").GetComponent<Drivetrain>();
[B]
the object, "Drivetrain" is not available until you add a reference to the *.dll file, "Steam\steamapps\common\My Summer Car\mysummercar_Data\Managed\Assembly-CSharp.dll". Just thought that this should be stated if not already.[/B]
 
Last edited:
@msc.trash

What are you trying to do?

Code:
public void makePartPickable(GameObject gameObject)
{
    // Written, 14.08.2018
    this.part.layer = LayerMask.NameToLayer("Parts");
    this.part.tag = "PART";
}
NOTE: the gameObject's ".Name" property must be in the format of, "[ObjectName](xxxxx)" (x5) where '[ObjectName]' is the game object's name.
I.E
Code:
// Creating truck engine game object.
this.truckEngine = LoadAssets.LoadOBJ(mod, @"truck_engine.obj", true, true);
// Setting game object, truck engine 's name to the correct format name.
this.truckEngine.name = "Truck Engine(xxxxx)";
Now when you look at your gameobject, it will display the name of it.

This might help you too: this is my modAPI and demo that attempts to easily create gameobjects that can attach to the satsuma or anything really,

ModAPI: https://github.com/tommojphillips/ModAPI/wiki
Demo: https://github.com/tommojphillips/AttachObjectDemo
 
Last edited:
Code located at "Making changes to a component/variable:" example has an error;
Code:
satsumaDriveTrain = GameObject.Find("SATSUMA(557kg, 248)").GetComponent<Drivetrain>();
[B]
the object, "Drivetrain" is not available until you add a reference to the *.dll file, "Steam\steamapps\common\My Summer Car\mysummercar_Data\Managed\Assembly-CSharp.dll". Just thought that this should be stated if not already.[/B]
It was not stated in the code, good find! I assumed it would be listed on the Wiki of MSCLoader which I was linking to. (MSC Wiki) (It was not so I did an update. I also added your mod and demo on the bottom of the "article")

Also, thanks for sharing some code and giving some information above!

Updating the code!
 
Last edited:
I don't want to display the yellow text to pick the object, but I want to display this white, centered text to trigger a function (e.g. ignition).

I already understood that this can be done with Raycasting.
But there are a lot of problems, when I try to do it.
  • There are many Colliders overlapping in my view, so I can't detect my own object.
  • How to define a collider correctly? In my 3d software, do I need an extra object for each Collider, which is invisible later in the game, or can I use visible parts of my existing object seperated from the rest of my model. What are the correct names for these meshes? Do I have to change something in the properties of my prefab file in the Unity Editor?
My object is a child of the stock steering wheel. Maybe you can help me with examples, so I can understand it. Thanks!

Side-issue: How can I easily check wether the steering wheel is installed / bolted, so that the uninstalled steering wheel won't trigger the text?

Thank you very much!
 
@msc.trash

Can you already attach this child object of the stock steering wheel?

Setting the global FSM variable to either true or false will show/hide the GUI Hand Symbol.
Code:
// Show gui
PlayMakerGlobals.Instance.Variables.FindFsmBool("GUIinteraction").Value = true;
// Hide gui
PlayMakerGlobals.Instance.Variables.FindFsmBool("GUIinteraction").Value = false;
I have not explored how to display text to the interaction gui (Hand)
but i assume it would be something to do with this string variable.
Code:
PlayMakerGlobals.Instance.Variables.FindFsmString("GUIsubtitle").Value = "Testing subtile";

ALL KNOWN PLAYMAKER VARIABLES:
https://github.com/piotrulos/MSCModLoader/wiki/All-known-playmaker-Variables-and-Events
 
Unfortunately it doesn't work.

I will explain my situation more detailed:

I have a GameObject "ccpanel", it is an imported prefab file from an asset bundle.
This "ccpanel" has got three childs (different objects in the model file, I'm using Blender).
YQKg2I4.png

(Sorry that I didn't change the names yet ;))

The "ccpanel" GameObject is sucessfully attached and aligned to the stock steering wheel.

I named the Layer of "Cube" with this command (OnLoad() funtion):
Code:
ccpanel.transform.GetChild(0).gameObject.layer = LayerMask.NameToLayer("cclayer");

I tried to detect, if the player is looking at, using this way (Update() function):
Code:
foreach(RaycastHit hit in Physics.RaycastAll(Camera.main.transform.position, Camera.main.transform.forward, maxDistance, ccpanel.transform.GetChild(0).gameObject.layer))
{
    [...] //print name of object to console
}

It is working if I remove the layer part from foreach ("ccpanel.transform.GetChild(0).gameObject.layer"). Then my console spams various things, but also not my own object when I'm looking at.

And yes, Child(0) is the "Cube" object and that's the object I want to have.

Maybe you can help me with this information.
Thank you!
 
I have created an example mod.
Detects if the player is looking at the truck engine:
Code:
using MSCLoader;
using UnityEngine;

namespace DetectPlayerLookingAtObjectExample
{
    public class DetectPlayerLookingAtObjectExample : Mod
    {
        public override string ID => "DetectPlayerLookingAtObjectExample"; //Your mod ID (unique)
        public override string Name => "Detect Player Looking At Object Example"; //You mod name
        public override string Author => "tommojphillips"; //Your Username
        public override string Version => "1.0"; //Version
        public override bool UseAssetsFolder => true;

        private float maxDistance = 5;
        private GameObject truckEngine;
        private Texture2D engineTexture;

        public override void OnLoad()
        {
            // Written, 23.09.2018
            // Called once, when mod is loading after game is fully loaded

            // Creating Game Object.
            this.truckEngine = LoadAssets.LoadOBJ(this, @"truck_engine.obj", true, true);
            // Loading and assigning the texture for the object.
            this.engineTexture = LoadAssets.LoadTexture(this, "Truck_Engine_Texture.png");
            this.truckEngine.GetComponent<Renderer>().material.mainTexture = this.engineTexture;
            // Naming the object. NOTE, name must follow naming convention of <ObjectName>(xxxxx) where <ObjectName> is the game objects name.
            this.truckEngine.name = "Truck Engine(xxxxx)";
            // Spawning the game object to home.
            this.truckEngine.transform.position = new Vector3(-20.7f, 10, 10.9f); // Home Location (Outside Garage)
            this.truckEngine.transform.rotation = new Quaternion(0, 90, 90, 0); // The Rotation.
            // Allowing the object to be picked up.
            this.truckEngine.tag = "PART";
            // Sending object to it's own layer.
            this.truckEngine.layer = LayerMask.NameToLayer(this.truckEngine.name);
        }    

        public override void Update()
        {
            // Written, 23.09.2018
            // Update is called once per frame

            RaycastHit hitInfo;
            bool hasHit = (Physics.Raycast(
                Camera.main.ScreenPointToRay(Input.mousePosition), // Where the camera is facing.
                out hitInfo, // The hit info.
                this.maxDistance, // The distance to search in.
                1 << this.truckEngine.layer)// The layer to search in.
                && hitInfo.transform.gameObject == this.truckEngine); // checking if raycast hit said gameobject

            if (hasHit)
            {
                ModConsole.Print("has detected: " + hitInfo.transform.gameObject.name); // Prints the game object's name to the console when the player is looking at it. Expecting 'Truck Engine(xxxxx)'.
            }
        }
    }
}
Download Example mod & assets: https://github.com/tommojphillips/DetectPlayerLookingAtObjectExample
 
Last edited:
@msc.trash Found out how to show/hide the gui interaction text & hand:
Code:
// Enables / Disables the GUI hand.
PlayMakerGlobals.Instance.Variables.FindFsmBool("GUIuse").Value = true;
// Sets the text for the gui interaction. Set the value to "" to make the text disappear. "Douh"
PlayMakerGlobals.Instance.Variables.FindFsmString("GUIinteraction").Value = "Testing 123";
I have also updated the example mod source code on github.
 
Hey guys, im new into modding and i was trying to import some of my models into the game and replace default car parts, as an example, i have some subwoofers that i made for other game and i wanted to replace the subwoofer from msc, using UABE i did replace the sub but the textures were all ****ed up, is there a way to replace the subwoofer using modloader and use the textures that i made?
upload_2018-12-4_22-14-52.png

upload_2018-12-4_22-12-52.png
 

Attachments

  • upload_2018-12-4_21-46-40.png
    upload_2018-12-4_21-46-40.png
    333.5 KB · Views: 588
it will be cool of they make a program for no-experience in programming for people that wants to make mods too tbh i want to make a big mod but i dont even know how to program in unity or c# kinda i can with 3d modding or some sorta video tutorial something like that
 
HI can u help how i can fix it?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using MSCLoader;
using HutongGames.PlayMaker;


namespace SIX_GEARS_by_KETTLSON
{
public class SIX_GEARS_by_KETTLSON : Mod
{
public override string ID => "SIX_GEARS_by_KETTLSON";
public override string Name => "SIX GEARS by KETTLSON";
public override string Author => "Kettlson";
public override string Version => "1.0a";

public override bool LoadInMenu => false;
public override bool UseAssetsFolder => false;

Drivetrain _satsumaDriveTrain;

GameObject _satsuma;
GameObject player;

public Drivetrain.Transmissions lastDrivetype;
public int driveType = 1;
public float[] oldRatio;
public float[] newRatio = new float[]
{
-4.093f,
0f,
3.424f,
2.141f,
1.318f,
1f,
0.90f,
0.85f,
};

int rememberGear = 0;
bool autoTransEnabled;

public override void OnLoad()
{
try
{
_satsuma = GameObject.Find("SATSUMA(557kg, 248)");
player = GameObject.Find("PLAYER");

AssetBundle ab;

if (_satsuma != null)
{
_satsumaDriveTrain = _satsuma.GetComponent<Drivetrain>();
if (_satsumaDriveTrain != null)
{
defaultRPM = _satsumaDriveTrain.maxRPM;
defaultShiftUpRPM = _satsumaDriveTrain.shiftUpRPM;
defaultShiftDownRPM = _satsumaDriveTrain.shiftDownRPM;
oldRatio = _satsumaDriveTrain.gearRatios;
enableBoost = true;

engineFixerMod.OptimizeEngineFixer();
}
}

ModConsole.Print(Name + ": Mod loaded!");


}
catch (Exception e)
{
ModConsole.Error("Asset load and setup failed. Message: " + e);
return;
}

}
public override void Update()
{
if (_satsumaDriveTrain.gearRatios != newRatio)
{
_satsumaDriveTrain.gearRatios = newRatio;
_satsumaDriveTrain.maxRPM = 8400f;
}
rememberGear = _satsumaDriveTrain.gear;
}
}
}


that is saying i can't found Drivetrain
 
HI can u help how i can fix it?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using MSCLoader;
using HutongGames.PlayMaker;


namespace SIX_GEARS_by_KETTLSON
{
public class SIX_GEARS_by_KETTLSON : Mod
{
public override string ID => "SIX_GEARS_by_KETTLSON";
public override string Name => "SIX GEARS by KETTLSON";
public override string Author => "Kettlson";
public override string Version => "1.0a";

public override bool LoadInMenu => false;
public override bool UseAssetsFolder => false;

Drivetrain _satsumaDriveTrain;

GameObject _satsuma;
GameObject player;

public Drivetrain.Transmissions lastDrivetype;
public int driveType = 1;
public float[] oldRatio;
public float[] newRatio = new float[]
{
-4.093f,
0f,
3.424f,
2.141f,
1.318f,
1f,
0.90f,
0.85f,
};

int rememberGear = 0;
bool autoTransEnabled;

public override void OnLoad()
{
try
{
_satsuma = GameObject.Find("SATSUMA(557kg, 248)");
player = GameObject.Find("PLAYER");

AssetBundle ab;

if (_satsuma != null)
{
_satsumaDriveTrain = _satsuma.GetComponent<Drivetrain>();
if (_satsumaDriveTrain != null)
{
defaultRPM = _satsumaDriveTrain.maxRPM;
defaultShiftUpRPM = _satsumaDriveTrain.shiftUpRPM;
defaultShiftDownRPM = _satsumaDriveTrain.shiftDownRPM;
oldRatio = _satsumaDriveTrain.gearRatios;
enableBoost = true;

engineFixerMod.OptimizeEngineFixer();
}
}

ModConsole.Print(Name + ": Mod loaded!");


}
catch (Exception e)
{
ModConsole.Error("Asset load and setup failed. Message: " + e);
return;
}

}
public override void Update()
{
if (_satsumaDriveTrain.gearRatios != newRatio)
{
_satsumaDriveTrain.gearRatios = newRatio;
_satsumaDriveTrain.maxRPM = 8400f;
}
rememberGear = _satsumaDriveTrain.gear;
}
}
}


that is saying i can't found Drivetrain

I see that you found my sourcecode. Please don't forget to credit me :rolleyes:

Also, If you had read the actual tutorial/guide you would see this message:
NOTE: Some Objects/Components also needs referenses to Assembly-CSharp.dll file.
("Steam\steamapps\common\My Summer Car\mysummercar_Data\Managed\Assembly-CSharp.dll")
Drivetrain, for example, does need this reference to work properly.

In other words. "You ARE missing a directive or an assembly reference" ;)
 
Last edited:

Latest News

What's needed for simracing in 2024?

  • More games, period

  • Better graphics/visuals

  • Advanced physics and handling

  • More cars and tracks

  • AI improvements

  • AI engineering

  • Cross-platform play

  • New game Modes

  • Other, post your idea


Results are only viewable after voting.
Back
Top