Barzakh

Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • in reply to: Mafia 3 Modding (Mega Thread) #162943

    Barzakh
    Participant

    For those where version 1.1 of the Script Hook is crashing, can you please try out the 1.2 release candidate? You can download it here https://mega.nz/#!c9diTBBQ!vhjXV1uMWLd6g2kYG1YblNeKUQdTr6f_xugUIS1sdaA and give me feedback if it works for you now? Thanks!

    • This reply was modified 2 years, 5 months ago by  Barzakh.
    1 user thanked author for this post.
    in reply to: Mafia 3 Modding (Mega Thread) #162940

    Barzakh
    Participant
    162939 wrote:

    First of all: Thank you for your hard work on this! Sadly this version crashes the game when I run it. The previous version worked like a charm. Here’s the ScriptHook log: M3ScriptHook::M3ScriptHook PluginSystem::LoadPlugins PluginSystem::LoadPlugins loaded plugin ExampleDLLPlugin.dll M3ScriptHook::StartThreads LuaStateManager::StartThread M3ScriptHook::mainThread LuaFunctions::LuaFunctions LuaFunctions::LuaFunctions Game is not ready, script engine not initialized, retry LuaFunctions::LoadPointers m_pMainGameScriptMachine (7ff6f19b41b8) lua_pcall2 (7ff6efef3100) lua_tostring (7ff6ec5bb2d0) lua_isstring (7ff6ef00e7f5) lua_isstring (7ff6ef00e7f5) luaL_loadbuffer (7ff6eff51b93) plua_loadBuffer (7ff6efefd370) lua_newthread (7ff6efef2d30) lua_pushcclosure (7ff6efef51d0) lua_setfield (7ff6ec5bb090) LuaStateManager::StateChanged LuaFunctions::Setup

    Alright this is my log
    m_pMainGameScriptMachine (7ff7ef0e41b8)
    lua_pcall2 (7ff7ed623100)
    lua_tostring (7ff7e9ceb2d0)
    lua_isstring (7ff7ec73e7f5)
    lua_isstring (7ff7ec73e7f5)
    luaL_loadbuffer (7ff7ed681b93)
    plua_loadBuffer (7ff7ed62d370)
    lua_newthread (7ff7ed622d30)
    lua_pushcclosure (7ff7ed6251d0)
    lua_setfield (7ff7e9ceb090)
    LuaStateManager::StateChanged
    LuaFunctions::Setup
    LuaFunctions::Setup::<lambda_b200b67e7317fa8bad38b3b12cc28be3>::operator ()
    LuaFunctions::Setup::<lambda_c766ceade28b194d58c2921e491dccd0>::operator ()
    LuaFunctions::Setup::<lambda_50df289ee3f51bfa67048f7e179908b0>::operator ()

     
    The reason why it crash must be lua_pushcclosure or lua_setfield, I’ll try to get a fix out as soon as possible. Thanks for sharing your information!

    in reply to: Mafia 3 Modding (Mega Thread) #162930

    Barzakh
    Participant
    162921 wrote:

    Can we use scripthook to do things like increase pedestrian count and traffic density?

    Yes there should be a way todo so.
    Here’s the game.traffic class http://hastebin.com/sedasiditu.hs
    You should be able to control the density with one of these functions
    If not, you probably need to modify the game config file directly

    in reply to: Mafia 3 Modding (Mega Thread) #162923

    Barzakh
    Participant

    First of all, the source was not ripped off, the only class structures that are taken over are those from LuaFunctions, LuaStateManager and the PluginSystem. All content was reversed by myself, even the hooking module etc. was replaced. If you take a look at my source code you will see that it’s pretty much different etc.
    Second of all, I have no problem with giving credits and copying license infos as seen here https://github.com/MartinJK/Mafia3ScriptHook/blob/master/shared/include/hooking/hooking.h#L50 .
    There was no intention to violate the rights of his source code.
    Unfortunately, his source code did not have any license info (the google code side does, but I’ve downloaded it somewhere else). Thats probably why I’ve forgot to add him.
    I’ll add his credits, again, there was no intention to violate it.
     
    Writing me a ‘normal’ note about that would be probably asking too much? (Good Job, ripping etc.)

    • This reply was modified 2 years, 5 months ago by  Barzakh.
    in reply to: Mafia 3 Modding (Mega Thread) #162914

    Barzakh
    Participant

    New version of ScriptHook is out now, featuring stuff like setTimeout (delayBuffer), key bindings, logs etc.
    See all here: https://mafiamods.com/mods/mafia-3-scripthook/ (Please read carefully through it if you want to develop scripts)
     
    PS 😀

    • This reply was modified 2 years, 5 months ago by  Barzakh.
    2 users thanked author for this post.
    in reply to: Mafia 3 Modding (Mega Thread) #162891

    Barzakh
    Participant

    A complete function and string dump of Mafia3’s LUA and a dump of all functions is available here:
    https://mega.nz/#F!VscigCQQ!yl3PBpGpZ075v6K5x6PICA
     
    All lua ‘game’ classes (idk if they are called classes in Lua :D)

    game.ats
    game.audio
    game.battle
    game.cameramanager
    game.capture
    game.database
    game.datastore
    game.delayed
    game.detector
    game.director
    game.entitywrapper
    game.game
    game.garage
    game.gfx
    game.hud
    game.navigation
    game.perchars
    game.physics
    game.pipcamera
    game.police
    game.racemanager
    game.radio
    game.safehouse
    game.savesystem
    game.sds
    game.servicevalidation
    game.shotmgr
    game.skipscriptscene
    game.sniperservice
    game.squealer
    game.streaming
    game.streammap
    game.tail
    game.traffic
    game.videocapture
    game.ats
    game.audio
    game.battle
    game.cameramanager
    game.capture
    game.database
    game.datastore
    game.delayed
    game.detector
    game.director
    game.entitywrapper
    game.game
    game.garage
    game.gfx
    game.hud
    game.navigation
    game.perchars
    game.physics
    game.pipcamera
    game.police
    game.racemanager
    game.radio
    game.safehouse
    game.savesystem
    game.sds
    game.servicevalidation
    game.shotmgr
    game.skipscriptscene
    game.sniperservice
    game.squealer
    game.streaming
    game.streammap
    game.tail
    game.traffic
    game.videocapture
    • This reply was modified 2 years, 5 months ago by  Barzakh.
    4 users thanked author for this post.
    in reply to: Mafia 3 Modding (Mega Thread) #162814

    Barzakh
    Participant

    Alright guys, here are some functions (Once I wrote a script you get them prettyfied ;))
    Until then, please compare the variables (like game.game – if they are correct) and take / guess the parameters from here http://mafiascene.net/thread-850.html
     
    game.game http://hastebin.com/jizoxekoti.hs
    game.hud http://hastebin.com/uwizoyipub.css
    game.traffic http://hastebin.com/sedasiditu.hs
    game.battle  http://hastebin.com/ifeyiwufew.hs
     
    Unknown yet, only class reversed:
    human http://hastebin.com/upeyukotev.css
    player http://hastebin.com/yuwexotomu.hs (you can access it with game.game:GetActivePlayer() )
    car (vehicle) http://hastebin.com/iroxorijes.hs (when you are in a car, you can access it with game.game:GetActivePlayer():GetOwner() )
    boat (vehicle) http://hastebin.com/ifuwoqidoj.hs  (when you are in a car, you can access it with game.game:GetActivePlayer():GetOwner() )
     
    garage http://hastebin.com/ukohaluxap.hs
    radio http://hastebin.com/iroxoruwah.hs
    gameaudioak http://hastebin.com/uxeyunefac.hs
    sds http://hastebin.com/aguqekorin.hs
    mapstream http://hastebin.com/nocebanura.hs
    savegame http://hastebin.com/uhayebaxaz.hs
    nagivation http://hastebin.com/hutepilehi.hs
    pipcamera http://hastebin.com/mubixatevu.hs
    gamedirector http://hastebin.com/bipixerega.hs
    gui http://hastebin.com/wemegulato.hs
    race http://hastebin.com/uxuyetezow.hs
    relationship http://hastebin.com/ivokohivuf.hs
    wingman http://hastebin.com/vapidojoyi.hs
    gamecam and mafiacam http://hastebin.com/yozafehaca.hs
    cutscene http://hastebin.com/wenugujoye.hs
    videocapture http://hastebin.com/icuyifiqiz.hs
    door http://hastebin.com/ohizuzivis.hs
    entity (wrapper)  http://hastebin.com/cuhiyipifo.hs
     
    Little insight how many functions register these variables (like game.game, game.hud etc.)

    • This reply was modified 2 years, 5 months ago by  Barzakh.
    • This reply was modified 2 years, 5 months ago by  Barzakh.
    • This reply was modified 2 years, 5 months ago by  Barzakh.
    • This reply was modified 2 years, 5 months ago by  Barzakh.
    • This reply was modified 2 years, 5 months ago by  Barzakh.
    8 users thanked author for this post.
    in reply to: Mafia 3 Modding (Mega Thread) #162792

    Barzakh
    Participant

    Alright, first version of the scripthook is out now. (I’ll upload it here once I’ve finished some cleanups (adding icons to executable, writing tutorial, list of commands etc.))
    https://github.com/MartinJK/Mafia3ScriptHook
     
    The Scripthook supports loading of library (.dll) and script (.lua) files. So you can either write your plugins with C++ (calling game functions directly) or simply use lua, or either use both.
    The library part of the Scripthook features all needed memory functionality (searching for patterns (writing them into a cache file so search is next time faster etc.)) including LUA (you get the lua_State ptr once the plugin start routine is called)
    Example can be seen here: https://github.com/MartinJK/Mafia3ScriptHook/blob/master/ExampleDLLPlugin/src/main.cpp
     
    The files need to be placed in the following directories:
    MAFIA III FOLDER/scripts/*.lua
    MAFIA III FOLDER/plugins/*.dll
     
    In order to allow quick development, you can reload the LUA scripts via F1 key press. Reload for .dll will be added soon
     
    Oh and by the way, I’ve uploaded the Mafia 3 font files (extracted from the Launcher) for you guys, you can download it at https://mega.nz/#!l8NDVCKA (nearly 60MB because of chinese and japanese fonts)

    • This reply was modified 2 years, 5 months ago by  Barzakh.
    5 users thanked author for this post.
    in reply to: Mafia 3 Modding (Mega Thread) #162787

    Barzakh
    Participant

    Sooo… This is the first look in the Script Hook for Mafia 3, first version should be out on sunday 😉 This version is thread safe and works with the Game Main Script Thread / Machine. Also I’ll add a list with available commands and parameters (all game sciprting functions, as far as possible).. D3D11 hook and maybe developer console coming later on

    https://www.youtube.com/embed/0kepM10jcWA
    (unfortunately i can’t embbed it with the video tag, keep on getting 403 not authorized, A potentially unsafe operation has been detected in your request to this site…)
     
    PS.: Some nice messing around screenshot 😉

    • This reply was modified 2 years, 5 months ago by  Barzakh.
    • This reply was modified 2 years, 5 months ago by Zenin Zenin.
    2 users thanked author for this post.
Viewing 9 posts - 1 through 9 (of 9 total)