Jump to content

TheZ

Member
  • Posts

    2
  • Joined

  • Last visited

  1. Thank you for your self-sufficient answer. I had feeling that this is somehow like that, but didn't find any evidence that is so before asking. Now its clear. Okay, the only thing that we got is this "OnContainerUpdate" event triggered during ToggleDoorActual call which is no how connected to the door itself which makes it a tricky thing to maintain this somehow.. Okay.. I see. Thanks again for clearing things here.
  2. Hey folks, I would like to ask is there are a way to override vanilla functions of IsoDoor and IsoThumpables? What I'm trying to achive is just to a piece of my funcionality on every ToggleDoor function call for every signle door. Its says that both functions are public and I can't feel any preventing clues of doing me so, but none of my infinite attempts were even close to success. i tried to inject my stuff iside the function by doing so: local originalToggleDoor = IsoDoor.ToggleDoor; local originalToggleDoorThump = IsoThumpable.ToggleDoor; ---@param chr IsoGameCharacter function IsoDoor:ToggleDoor(chr) print("My toxical injection comes here"); originalToggleDoor(self, chr); end ---@param chr IsoGameCharacter function IsoThumpable:ToggleDoor(chr) print("My toxical thump injection comes here"); originalToggleDoorThump(self, chr); end then I tried something that: local originalToggleDoor; ---@param chr IsoGameCharacter local function toxicToggleDoor(self, chr) print("My toxic stuff comes here"); originalToggleDoor(self, chr); end Events.OnGameBoot.Add(function() originalToggleDoor = IsoDoor.ToggleDoor; IsoDoor.ToggleDoor = toxicToggleDoor; end); and there were a lot more of some odd attempted to at least break somehow this ToggleDoor but all were just ignored like I'm totally tryng to access something else. no erros in logs, no any clue of the attempt just initial message which confirms that the script is loaded. I want to find out where am I mistaken and is it doable at all. Please, save my zombified soul thank you. The answer for now is: You can override lua functions. You cannot override java methods (this way). IsoDoor & IsoThumpable are Java classes. We can subscribe for an event triggered during ToggleDoorActual and named "OnContainerUpdate". But the event doesn't pass any parameter related to the Door itsef or another place from which this event could be triggered.
×
×
  • Create New...