Coder Social home page Coder Social logo

dariowouters / ts-fmod-plugin Goto Github PK

View Code? Open in Web Editor NEW
42.0 9.0 12.0 2.14 MB

A telemetry plugin for ATS/ETS2 to use FMOD sound mods (to a limited extent) for example in TruckersMP

License: MIT License

C 20.55% C++ 79.45%
ats american-truck-simulator ets2 euro-truck-simulator-2 truckersmp

ts-fmod-plugin's People

Contributors

dariowouters avatar pupplestar77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ts-fmod-plugin's Issues

ets2 1.47 fix

when the game is loading the engine already starts i cant find a fix for this maybe you can help i always use your plugin

t.i.a.

new game ver.

Is there an easy way to make this add-on compatible with the new game version? So can you briefly explain how it's done?

Events don't work

So, I was using a sound mod with ts fmod plugin, but I had to reinstall the game, I placed the plugins and the ts fmod archives just in the same way as they were before, turns out that now the sound mod doesn't work and when I check the in-game console the following errors display
plugin error

Implement navigation_sound_event feature

Euro Truck Simulator 2 (ETS2) has navigation voice sounds in numerous languages. However, there are still unsupported countries and languages, and there are also many low-quality voice instructions. In the Multi-mode(TruckerMP), Eurotruck mode is not available. Therefore, I implemented the navigation_sound_event feature using the provided code.
I am not good with English, C++, and reverse engineering, but I have tried my best and put in a lot of effort.
This feature allows receiving navigation event sounds. Before proceeding with a pull request, I want to confirm if it is needed and desired by the project maintainers.

The new classes added are:

class sound_event_t
{
    class sound_player* sound_player; //0x0000
    char pad_0008[0x28];              //0x0008
    uint32_t is_playing;              //0x0030  1:playing, 4:stop? maybe?
    uint32_t something;               //0x0034
    class gl* glsl;                   //0x0038
    char pad_003c[0x18];              //0x0040
    class gl* glsl2;                  //0x0060
    char* sound_event_name_with_file; //0x0060
    char pad_0068[0x50];              //0x0068

public:
    uint32_t get_is_playing() const {
        return is_playing;
    }
    const char* const get_sound_event_name_with_file_name() const {
        return sound_event_name_with_file;
    }
};


class navigation_sound_event
{
    uint32_t pad_0000;                  //0x0000
    uint32_t pad_0004;                  //0x0004
    char *event_name;                   //0x0008
    uint32_t pad_0010;                  //0x0010
    uint32_t pad_0014;                  //0x0014
    class navigation* navi_instance;    //0x0018
    sound_event_t *sound_event;          //0x0020

public:
    sound_event_t *get_sound_event() const{
        return sound_event;
    }
    char* get_event_name() const {
        return event_name;
    }
};

To utilize the feature, you can use the following code snippet:

navigation_sound_event** ev = (unk_interior_parent->get_navigation_sound_events());
            for (short i = 0; i < unk_interior_parent->get_navigation_sound_events_count(); i++)
            {
                auto snd = ev + i;
                auto  now = (*snd)->get_sound_event()->get_is_playing();
                if (now == 1)
                {
                    if (played.size() < i)
                    {
                        played.resize(i + 1);
                    }
                    if (now != played[i])
                    {
                        fmod_manager_instance->set_event_state((*snd)->get_event_name(), true, true);
                        {
                            std::stringstream ss;
                            ss << "[ts-fmod-plugin] PlaySound : " << (*snd)->get_event_name();
                            scs_log(0, ss.str().c_str());
                        }
                    }
                }
                if (played.size() < i)
                {
                    played.resize(i + 1);
                }
                played[i] = now;

            }

ATS v1.49 Crashes on startup/sdk reload

Hi.
Game crashes after editing "selected.bank.txt" and doing a sdk reload on console, or simply after loading the profile once .txt is edited (it crashes on loading screen).

On thing i noticed on "game.log.txt" (under the same release, v1.49) is that ETS2 says this:

00:00:26.605 : [ts-fmod-plugin V1.49] Searching for memory offsets... If this is one of the last messages in the log after a crash, try disabling this plugin after choosing profile.
00:00:26.616 : [ts-fmod-plugin] Found base_ctrl @ 1d079a0 and unk_interior @1d07998
00:00:26.718 : [ts-fmod-plugin] Found output device[0] Altavoces (Realtek(R) Audio)
00:00:26.718 : [ts-fmod-plugin] Found output device[1] Realtek Digital Output (Realtek(R) Audio)
00:00:26.718 : [ts-fmod-plugin] Found output device[2] VoiceMeeter Aux Input (VB-Audio VoiceMeeter AUX VAIO)
00:00:26.719 : [ts-fmod-plugin] Found output device[3] 1 - LG IPS FULLHD (AMD High Definition Audio Device)
00:00:26.719 : [ts-fmod-plugin] Found output device[4] VoiceMeeter Input (VB-Audio VoiceMeeter VAIO)
00:00:26.719 : [ts-fmod-plugin] Selecting default output device (0)
00:00:26.888 : [ts-fmod-plugin] Using sound bank[0]: 'rckps_v8op'
00:00:26.888 : [ts-fmod-plugin] Loading the events and busses for 'rckps_v8op'
00:00:26.909 : [ts-fmod-plugin] Loading event 'engine/engine'
00:00:26.909 : [ts-fmod-plugin] Loading event 'engine/exhaust'
00:00:26.909 : [ts-fmod-plugin] Loading event 'engine/start_bad'
00:00:26.909 : [ts-fmod-plugin] Loading event 'engine/turbo'
00:00:26.909 : [ts-fmod-plugin] Did not find any navigation event. You will not have navigation voices.
00:00:26.926 : [ts-fmod-plugin] Plugin loaded

Note: ETS2 works fine, that's after selecting a .bank

...while on the ATS "game.log.txt" says:

00:03:14.009 : [ts-fmod-plugin V1.46] Searching for economy offset... If this is one of the last messages in the log after a crash, try disabling this plugin.
00:03:14.031 : [ts-fmod-plugin] Found economy offset &1d04528
00:03:14.144 : [ts-fmod-plugin] Found output device[0] Altavoces (Realtek(R) Audio)
00:03:14.144 : [ts-fmod-plugin] Found output device[1] Realtek Digital Output (Realtek(R) Audio)
00:03:14.145 : [ts-fmod-plugin] Found output device[2] VoiceMeeter Aux Input (VB-Audio VoiceMeeter AUX VAIO)
00:03:14.145 : [ts-fmod-plugin] Found output device[3] 1 - LG IPS FULLHD (AMD High Definition Audio Device)
00:03:14.145 : [ts-fmod-plugin] Found output device[4] VoiceMeeter Input (VB-Audio VoiceMeeter VAIO)
00:03:14.145 : [ts-fmod-plugin] Selecting default output device (0)
00:03:14.267 : [ts-fmod-plugin] Using sound bank[0]: '903_v8'
00:03:14.267 : [ts-fmod-plugin] Loading the events and busses for '903_v8'
00:03:14.284 : [ts-fmod-plugin] Setting sound level for 'master' to 0.5
00:03:14.284 : [ts-fmod-plugin] Setting sound level for 'engine' to 0.5
00:03:14.284 : [ts-fmod-plugin] Setting sound level for 'exhaust' to 0.5
00:03:14.284 : [ts-fmod-plugin] Setting sound level for 'turbo' to 0.5
00:03:14.284 : [ts-fmod-plugin] Setting sound level for 'interior' to 1
00:03:14.284 : [ts-fmod-plugin] Setting sound level for 'exterior_when_windows_closed' to 0.75
00:03:14.284 : [ts-fmod-plugin] Plugin loaded

If i'm missing something or need anything for further debug, please let me know.
Have a nice day/night!

SCS Update 1.45

This has ceased to work on both ATS and ETS 2 with Open Beta 1.45.*
I am not saying this in a whining fashion but just to let you know if you don't already and I will patiently await the update for 1.45.*

Many Thanks

1.46 ATS

ATS 1.46 Has dropped and sound pack don't work again due to update.

Thanks

This isn't an issue, more a request for info / help

Hi there, love this plugin, the game is so much better with it, my request for info / help is this:

I have an air brake sound mod that I use, can this be added to this plugin?

I have tried to see if it works myself but have had no joy, any help on this would be much appreciated.

Thanks in advance

Карта ATS

Нет возможности сделать карту ATS - выдает ошибку при создании
Операция прервана (Исключение из HRESULT: 0x80004004 (E_ABORT))

ATS 1.48 UPDATE

Just letting you know ATS has been updated to 1.48, The mod no longer works it crashers the game due to incompatibility.
Thank so much.

Support future game versions

Hello,

I can see that it is challenging to predict future game versions and in the same time keep plugin working for the largest number of game binary versions.

To do it effectively, you could first verify what you need, if it fails, then inform user that different plugin version is needed, if it succeeds let it load.
To make it happen, you could use __try and __except keywords.
https://stackoverflow.com/a/7049836

int FilterException(int code, PEXCEPTION_POINTERS ex) {
    return EXCEPTION_EXECUTE_HANDLER;
}

void SomeCheckingOfNeededGameStuff()
{
  // check if game_ctrl_u object is really game_ctrl
  // check if game_actor_u object is really game_actor
  // etc
  // if anything goes bad and throws exception, it will be catched in __except block.
}

bool ShouldPluginBeRunning()
{
    __try {
        SomeCheckingOfNeededGameStuff();
        return true; // all went fine
    }
    __except(FilterException(GetExceptionCode(), GetExceptionInformation())) {
        return false;
    }
}

Real code might be different, and I am not sure if you can return false just like that from __except block. But I think it should be all possible.

Thank you for understanding.

ntdll error.

When I use sdk reload twice(not in the same time)

I'm having this error:

image

.NET is installed.
Runtimes are installed.

Write game events from external source.

Hello.

I need a small help.

I want create a custom fines (etc: Driving time exceeded). Your plugin can write datas to ETS2/ATS or just read it?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.