Jefferzoonn Posted May 4, 2023 Report Posted May 4, 2023 I'm trying to create a mod that simply consists of having a block that if you jump on top of it throws you up with great force, but I can't understand the api documentation, I don't even know what methods to look for, for example To cancel the fall damage, does anyone know of an api guide or if someone would be so kind as to make one, it would be great, at least with the basics to know how to use it. Excuse my English, I have used the google translator
genovefa Posted August 26, 2023 Report Posted August 26, 2023 Looks like one of the wiki pages actually makes a trampoline block as an example. https://wiki.vintagestory.at/index.php/Modding:Advanced_Blocks
Omega Haxors Posted September 23, 2023 Report Posted September 23, 2023 (edited) The API documentation is shit, what I do is take the source code and read that. For your example you want to read the damage event and cancel (or modify the damage of it) if conditions are met. When you don't have something to hook on to you can either hook onto the tick itself or make your own tick handler and hook onto that. It's clumsy and I wouldn't suggest doing so unless you have to. Eventually I have to get around to rewriting all of my mods because they use an obscenely inefficient method which lags the game to shit. Treat all coding in this game as an event handler. Something happens, and then your code will react to that. Ultimately that's how things get done. Edited September 23, 2023 by Omega Haxors
l33tmaan Posted September 24, 2023 Report Posted September 24, 2023 On 9/22/2023 at 10:42 PM, Omega Haxors said: Eventually I have to get around to rewriting all of my mods because they use an obscenely inefficient method which lags the game to shit. Hey, how exactly do you determine the performance hit your mods incur, and more importantly, why they impact performance?
Omega Haxors Posted September 27, 2023 Report Posted September 27, 2023 On 9/24/2023 at 8:44 AM, l33tmaan said: Hey, how exactly do you determine the performance hit your mods incur, and more importantly, why they impact performance? I'm usually a low-level programmer so I tend to think of each part eventually breaking down into machine code. One method to test for lag is kind of horrifying, but it's to load the server with a reliable source of lag then measure dropped ticks.
l33tmaan Posted September 27, 2023 Report Posted September 27, 2023 Oh, so you mean "just load your server". Hah! I will see myself out, now.
Recommended Posts