Watch Dogs LUA scripts DECOMPILING

Discussion in 'Game Tweaks and Modifications' started by Ellcz, Jun 17, 2014.

  1. Ellcz

    Ellcz Guest

    Messages:
    19
    Likes Received:
    0
    GPU:
    GTX 770 / 2GB
    Maybe try to make patch.dat and .fat files again and that lua file exactly in that file. It should work. If not, we need to find another way. I didnt tried it yet, because Im doing something else. :p
     
  2. Nicistarful

    Nicistarful Guest

    Messages:
    38
    Likes Received:
    0
    GPU:
    Nvidia GTX 660 3GB EVGA
    How exactly do you mean it? And I edited it in the comman.dat/.fat
    Do you mean editing them also in the patch.dat/.fat?
     
  3. Nicistarful

    Nicistarful Guest

    Messages:
    38
    Likes Received:
    0
    GPU:
    Nvidia GTX 660 3GB EVGA
    I changed also the values in the files from the windy_city.dat/.fat and my game is continously crashing, when I press "Continue" in main screen. It loads the half bar and then crashes with error: "Watch_Dogs.exe has stopped working". I think I'll have to wait for a answer, for me it seems, like I couldn't modify anything. Changings in common.dat/.fat won't change anything ingame, changings in windy_city.dat/.fat lets the game crash. I'm desperated...
     
  4. Nicistarful

    Nicistarful Guest

    Messages:
    38
    Likes Received:
    0
    GPU:
    Nvidia GTX 660 3GB EVGA

  5. Ellcz

    Ellcz Guest

    Messages:
    19
    Likes Received:
    0
    GPU:
    GTX 770 / 2GB
    I mean, you need to patch it in same way how Ubisoft do it. They always update files, and then make new patch.dat and .fat.
     
  6. loubar22

    loubar22 Guest

    Messages:
    3
    Likes Received:
    0
    GPU:
    GTX 650ti boost oc 2GB
    Cops arresting and saving poeple are still there !!
     
  7. CYRIAQU3

    CYRIAQU3 Guest

    Messages:
    1
    Likes Received:
    0
    GPU:
    GTX 650
    Hello !
    I have found a compiler for the lua scripts
    Download : mega.co.nz/#!tI0DUC4C!A53P3wF-7NO1TEZJFaqcI3jyjyFrVVOxOdhVWHa2p3E

    But how to apply the modified scripts in-game ?
    The patch.dat/fat method doesnt work.

    Some scripts are in two folder : common.dat and windy_city.dat
    example : domino\system\traincontroler.lua

    I have decompiled the script, edit him (change train in station value from 20sec to 5 for testing), and recompil him with the program, i create the patch.dat from the common_unpack folder but nothing work (no crash, just no change).

    Anyone have got an idea ?

    (Sorry for my english)


    original traincontroler.lua decompiled :
    Code:
    TrainSystemControllerBox = {}
    function TrainSystemControllerBox:Create(cbox)
    end
    function TrainSystemControllerBox:Init(cbox)
      self.missionId = cbox:GetParentMissionId()
      self.callidSpawned = nil
      self.callidInteriorReady = nil
      self.callidPlayerInTrain = nil
      self.SkipStationsFlag = false
      self.SpawnDelayMultiplier = 1
      self.StationTimeOverride = 20
      self.TrainLineColour = 1
      self.callidPlayerHackedTrainToStop = nil
      self.callidPlayerHackedTrainToMotion = nil
    end
    function TrainSystemControllerBox:ShutDown()
      self._type.UnregisterCallback(self)
    end
    function TrainSystemControllerBox:UnregisterCallback()
      if self.TrainSpawner ~= nil then
        instance = CScriptCallbackSystem_GetInstance()
        if self.callidSpawned ~= nil then
          instance:RemoveCallback(self.TrainSpawner, self.callidSpawned)
        end
        if self.callidInteriorReady ~= nil then
          instance:RemoveCallback(self.TrainSpawner, self.callidInteriorReady)
        end
        if self.callidPlayerInTrain ~= nil then
          instance:RemoveCallback(self.TrainSpawner, self.callidPlayerInTrain)
        end
        if self.callidPlayerHackedTrainToStop ~= nil then
          instance:RemoveCallback(self.TrainSpawner, self.callidPlayerHackedTrainToStop)
        end
        if self.callidPlayerHackedTrainToMotion ~= nil then
          instance:RemoveCallback(self.TrainSpawner, self.callidPlayerHackedTrainToMotion)
        end
      end
    end
    function TrainSystemControllerBox:EnableSystem()
      local Out = self.Out
      local SystemEnabled = self.SystemEnabled
      HideAllTrainActivities(0, 1)
      Out(self)
      return SystemEnabled(self)
    end
    function TrainSystemControllerBox:DisableSystem()
      local Out = self.Out
      local SystemDisabled = self.SystemDisabled
      HideAllTrainActivities(1, 0)
      Out(self)
      return SystemDisabled(self)
    end
    function TrainSystemControllerBox:RequestScriptedTrain()
      local Out = self.Out
      local x = 0
      local y = 0
      local z = 0
      if self.TrainSpawner ~= nil and IsEntityValid(self.TrainSpawner) == 1 and self.callidSpawned == nil then
        x = GetEntityPosition(self.TrainSpawner, 0)
        y = GetEntityPosition(self.TrainSpawner, 1)
        z = GetEntityPosition(self.TrainSpawner, 2)
        instance = CScriptCallbackSystem_GetInstance()
        self.callidSpawned = instance:RegisterMissionEventCallback(self.TrainSpawner, self, "Event_TrainSpawnedEvent", "CTrainSpawnedEvent", self.missionId)
        self.callidInteriorReady = instance:RegisterMissionEventCallback(self.TrainSpawner, self, "Event_TrainInteriorReadyEvent", "CTrainInteriorReadyEvent", self.missionId)
        self.callidPlayerInTrain = instance:RegisterMissionEventCallback(self.TrainSpawner, self, "Event_PlayerInTrainEvent", "CPlayerInTrainEvent", self.missionId)
        self.callidPlayerHackedTrainToStop = instance:RegisterMissionEventCallback(self.TrainSpawner, self, "Event_PlayerHackedTrainToStop", "CPlayerHackedTrainToStop", self.missionId)
        self.callidPlayerHackedTrainToMotion = instance:RegisterMissionEventCallback(self.TrainSpawner, self, "Event_PlayerHackedTrainToMotion", "CPlayerHackedTrainToMotion", self.missionId)
        RequestTrainInPosition(x, y, z, self.TrainSpawner)
      end
      return Out(self)
    end
    function TrainSystemControllerBox:SetSkipAllStations()
      local Out = self.Out
      local SkipAllStationsDone = self.SkipAllStationsDone
      CloseAllStations(self.SkipStationsFlag)
      Out(self)
      SkipAllStationsDone(self)
    end
    function TrainSystemControllerBox:RemoveAllTrains()
      local Out = self.Out
      local RemovedAllTrains = self.RemovedAllTrains
      HideAllTrainActivities(1, 1)
      Out(self)
      return RemovedAllTrains(self)
    end
    function TrainSystemControllerBox:OverrideSpawningDelayMultiplier()
      local Out = self.Out
      SetSpawningDelayOverride(self.TrainLineColour, self.SpawnDelayMultiplier)
      Out(self)
    end
    function TrainSystemControllerBox:OverrideTimeInStations()
      local Out = self.Out
      SetTimeInStationOverride(self.StationTimeOverride)
      Out(self)
    end
    function TrainSystemControllerBox:HideLivingCity()
      local Out = self.Out
      HideLivingCityInTrains(self.hideLivingCityFlag)
      Out(self)
    end
    function TrainSystemControllerBox:BlockFastTravel()
      local Out = self.Out
      BlockFastTravel(self.BlockFastTravelFlag)
      Out(self)
    end
    function TrainSystemControllerBox:Event_TrainSpawnedEvent(trainId)
      self.SpawnedTrainEngine = trainId
      self.callidSpawned = nil
      return self:TrainSpawned()
    end
    function TrainSystemControllerBox:Event_TrainInteriorReadyEvent(trainId)
      self.TrainInteriorReadyId = trainId
      instance = CScriptCallbackSystem_GetInstance()
      instance:RemoveCallback(self.TrainSpawner, self.callidInteriorReady)
      self.callidInteriorReady = nil
      return self:TrainInteriorReady()
    end
    function TrainSystemControllerBox:Event_PlayerInTrainEvent(trainId)
      self.TrainPlayerIsIn = trainId
      self.callidPlayerInTrain = nil
      return self:PlayerInTrain()
    end
    function TrainSystemControllerBox:Event_PlayerHackedTrainToStop(trainId)
      self.HackedTrainId = trainId
      self.callidPlayerHackedTrainToStop = nil
      return self:PlayerHackedTrainToStop()
    end
    function TrainSystemControllerBox:Event_PlayerHackedTrainToMotion(trainId)
      self.HackedTrainId = trainId
      self.callidPlayerHackedTrainToMotion = nil
      return self:PlayerHackedTrainToMotion()
    end
    export = TrainSystemControllerBox
    TrainSystemControllerBox = nil
    
     
  8. Nicistarful

    Nicistarful Guest

    Messages:
    38
    Likes Received:
    0
    GPU:
    Nvidia GTX 660 3GB EVGA
    The decompiler can't decompile EVERYTHING, so how do you wanna tell the game to read the edited file, if it isn't complete? So it isn't readable, because some of the values and commands are missing. And the game reads the original ones.
     
  9. cicala

    cicala Member

    Messages:
    22
    Likes Received:
    1
    GPU:
    Geforce GTX 1080-Ti
    Instead of arguing about who modded what, why not work together like every modder did in the old days.
     
  10. Cru_N_cher

    Cru_N_cher Guest

    Messages:
    775
    Likes Received:
    2
    GPU:
    MSI NX8800GT OC
    That is because the team are modders themselves and need it easy for Production not to please us ;)
     

  11. Yecnot

    Yecnot Guest

    Messages:
    857
    Likes Received:
    0
    GPU:
    RTX 3080Ti
    People need to reinforce their egos, hence all the bashing and "reality show rofl" crap being spewed. :wanker:
     
  12. Ellcz

    Ellcz Guest

    Messages:
    19
    Likes Received:
    0
    GPU:
    GTX 770 / 2GB
    That's a bit tricky. Need to figure out yet.
     
  13. Marduk

    Marduk Guest

    Messages:
    663
    Likes Received:
    0
    GPU:
    gtx 780m
    would try the decompile.exe but didnt work.

    no drag n drop, no open with... , no start posiible.

    it only makes a cmd popup wich is so fast that i cannot read whats up...

    any idea?
     
  14. Marduk

    Marduk Guest

    Messages:
    663
    Likes Received:
    0
    GPU:
    gtx 780m
  15. Nicistarful

    Nicistarful Guest

    Messages:
    38
    Likes Received:
    0
    GPU:
    Nvidia GTX 660 3GB EVGA

  16. Marduk

    Marduk Guest

    Messages:
    663
    Likes Received:
    0
    GPU:
    gtx 780m
    working great

    positive is that you dont must use cmd and you Can decompile howmuch you want aATsSametime. lua files must only lie in ttheffolderof this package

    are you sure you have installed java runtime envir., its also neccesarry for the working of cmd commands by using unluac

    http://www.oracle.com/technetwork/ja...s-1880261.html

    should be fixed this

    1. Drop the .lua you want in the folder
    2. Drag/Drop the file to ELUAD.bat
    - it will create the right dec_*filename*.lua
    3. edit , or code
    4. drag/drop the edited dec_*filename*.lua to compile.exe
    - will create luac.out
    5. rename the luac.out to the original lua filename
     
    Last edited: Sep 1, 2014
  17. Marduk

    Marduk Guest

    Messages:
    663
    Likes Received:
    0
    GPU:
    gtx 780m
  18. xiaoxiao921

    xiaoxiao921 Guest

    Messages:
    28
    Likes Received:
    0
    GPU:
    AMD Radeon HD 8570
    none of them will work until we find a way to launch "cbox" thing
     
  19. Marduk

    Marduk Guest

    Messages:
    663
    Likes Received:
    0
    GPU:
    gtx 780m
    "cbox" would automatically load - its a box for the different luas ( they worked also for the other activated luas)

    its a cmd of dirrupt/lua, hm could be understand as "the toys for a sandbox"

    did i understand you right ?
     
  20. xiaoxiao921

    xiaoxiao921 Guest

    Messages:
    28
    Likes Received:
    0
    GPU:
    AMD Radeon HD 8570
    the cbox thing is the way they launch all of their lua script

    How they would change the time of day

    on the top of their lua script they add thing like this

    function export:Create(cbox)
    cbox:RegisterBox("Domino/System/SetTimeOfDay.lua")
    end

    then they add thing like this

    local l0
    self = self._graph
    l0 = Boxes[PathID("Domino/System/SetTimeOfDay.lua")]
    l0.Hour = 20
    l0.Minute = nil
    l0._graph = self
    l0.Out = self.f_10_Out
    l0:SetTimeOfDay()

    How we would change the time of day with the actual injector i use (and the only one available ? )

    CDynamicEnvironmentManager_GetInstance():SetScriptedTimeOfDay(23, 0);
     

Share This Page