#mod_development
1 messages · Page 399 of 1
ah look, some of the options in display, have mouse over descriptions. think i'll utilize that. many of my options are not exactly obvious what they do
ya the tooltips are handy..i added those in. You ever think about adding translation files for the mod?
its kinda tedious adding all the getText() wrappers but i figure it probably saves the hassle of people reuploading the whole mod with all the hardcoded strings replaced in another language
yes eventually
adding them for the hotkeys and options screen wasnt so bad....the firearm tooltips were a real PITA
whats the name of the file with base game options again?
There has been a new Mod Published!
@placid delta getting these at a constant stream (maybe 2 a second)
huh looks like they dont know where to drop the wood
did you give the chop order or did they go about that themselves?
haven't been giving orders for a while, it's all been on their own
you got a base set?
I did change the wood drop area to somewhere closer to where I was building, and they have been taking wood there.
base is set.
I do notice they don't seem to take corpses from take corpse area, and drop them at the area, unless I order them too, and even then, they will only take one corpse, and go about their own after that
odd...i'm not looking at the most recent files so probably best i dont try and trace the error back any further lol
looks like it coud be a few different spots in the code though, not finding the base squares or survivor not properly in a group...though a groupless survivor chopping is probably unlikely
for some reason the drop square is nil. i added a check for that in the validation method for that task. should not error anymore now.
Hi guys. Big question for me, possibly an easy question for someone else; How do I modify a .class file within the Zomboid Folder? I can decompile in an environment like IntelliJ but the .class files are all read only, Grrrr.
Hello! I'm new 😄
Ha, noob
hello
Hi h hi
@pine vigil get and set methods for:
CarController.class
public ClientControls clientControls
please.
self driving car mod incoming
lol trying to make those survivors drive?
well, for my rather basic story mode intro. i'd like to have wife drive you to work
i swear....during the zombie apocolypse the last thing i'm going to do is let my wife drive LOL
BAM
hahaha
you should throw in a random chance the wife crashes you into a tree 😄
The initial chaos provided by the survivors mod would be even better with survivors driving and crashing cars
and police npc's shooting randomly and being overrun
problem is i can't make any npcs "Look" like police except putting the word "Police" over thier head
just give them blue shirts and pants
well, eventually we will get the animations update to fix that
I suppose that would look slightly better then just random clothes
I wish we had hats in game
I did think of a good way to allow npc to drive cars
It would just require a fair bit of work marking all possible routes on the maps on the roads.
More than a fair bit
Would make it easy for a unique npc in a story line to drive. Just have every square in the route marked.
yip
if the whole java/kahlua process wasnt so damn slow it would make for a interesting project...took a few courses a number of years back on programming autonmous vehicles
hehe
Or if you made a kind of matrix map of all the roads. Then a route on those roads could be calculated from any point to point instantly. Then just have car follow that route. Would always need destination point in mind though. Wouldn't be like "let's drive around looking for c"
Started moving all text into translation files for translation support. Boy is it dull work...
yep lol...the initial conversion is a real pain if the mods already developed...after that its not so bad
after setting up translations in orgm i decided any other mods i'd setup the translations right away from the begining and save the hassle lol
a way to get the selected language anyone?
uh try Translator.getLanguage().text
looks like that should work but i havent tested
sorry... Translator.getLanguage():text()
not sure why you'd need that one anyways...the translator class should handle it all seamlessly
trying to do it a uh ... better..way
the only time its ever called in the lua is from the options screen
its not working
odd the getText() in Translator is able to be used publicly
getLanguage is alos there. but is nil when try to use
worked for me
print("Language is: "..Translator.getLanguage():text())
1524090984258 Language is: English
just tested on startup, before the main menu screen
guess im trying to use it before its defined
and getText() is public in Translator...its also mapped to the global function getText()
thats whats used to actually pull the strings from the translation files
well i just tested mine pretty damn early in the start sequence....in the first file loaded from any mods, so its got to be defined by the time any mod lua starts to load
ah s**t i was called getText() not text()
getLanguage() should always be defined...if the language isnt actually chosen it will default to english
ah XD
but i was hoping text returned the 2 diget languge code
oh the 2 digit codes are part of the enum, it doesnt look like theres a clean way of returning it
you'd have to store them in a table such as codes['English'] = "EN"
but anyway this is good now i wont have to convert my huse dialoge file full of tables into language file terms. just have the translators copy that file, chage it and change the languge at the top and it should work
like:
if Translator.getLanguage():text() ~= "English" then return end
if not SurvivorSpeechTable then SurvivorSpeechTable = {} end
SuperDialogue = { -- not being used yet
WifeSpeech = {
"Darling?",
"What are we going to do darling?",
"Should we go find a safer place for now?",
"or should we stay here?",
"I'm scared..",
}
}
SurvivorSpeechTable["OutOfAmmo"] = {
"Out of Ammo!",
"I'm out of Ammo!",
"I'm Out",
"No more Ammo!"
};
SurvivorSpeechTable["HowDareYou"] = {
"How dare you!"
};
if Translator.getLanguage():text() ~= "Japanese" then return end
if not SurvivorSpeechTable then SurvivorSpeechTable = {} end
SurvivorSpeechTable["HowDareYou"] = {
"殺すぞ!"
};
For what it's worth, getLanguage() returns an enum.
i think tostring(Translator.getLanguage()) would return "en" no
So if you really want language codes, I don't see how Language.EN for the check wouldn't work.
sure, it returns the value of the enum though
he was asking about getting the enum index name...but i havent found a clean way of fetching that from the java yet...was banging my head against the wall a few weeks ago on that one lol
i just tried it, it works tostring(Translator.getLanguage()) returns "EN"
😮
lol nice
the oddness of kahlua conversions XD
interesting though tostring converts the class into the enum name, most of the time it doesnt
Looks like the Language enum doesn't have it's toString() overridden, I imagine that works into it a bit.
Japanese is supposed to be ja not jp
@pine vigil ya but usually you'd end up with the class name and memory location
such as zombie.inventory.types.HandWeapon@1d7741f
Yeah I notice enums don't do that once when I tried it with body parts
ah well lots of stuff i still have yet to try....dont tell people... I'm still a pz modding newbie <.<
Здравствуйте!
Хочу сделать мод, но плохо понимаю скрипты.
Хочу добавить машину. Модель с текстурой сделал. При замене моделей в игре работает. Но я хочу сделать отдельным объектом.
Помогите мне пожалуйста со скриптами.
Извините за мой английский, пользуюсь переводчиком.
Hello!
I want to make a mod, but I do not understand scripts very well.
I want to add a car. Model with a texture made. When replacing models in the game works. But I want to make it a separate object.
Help me please with the scripts.
Sorry for my English, I use a translator.
I recall someone saying how there is not yet support for adding your own models yet
What he shows in those screens is exactly what I imagined they are going to do with vehicles in the long run. At least that's what I'm hoping.
There's already the ability to "upgrade parts" so it only makes sense
@placid delta
It only remains to replace the original files in the game?
"Pickup Ranger" use, as it is done in the screenshots.
right now that is the only way from what i heard. I did not try it myself though.
sadly 😕
agree, sad indeed
I would imagine though, that modding concerns will become a priority after a public release
other than added your terms definitions to shared/Translate/ .txt files is there anything else that needs to be done to have a translation? my terms are not being recognized, no mention of my translation file in the console after game loaded.
what are you naming the translation files? it should match the names of the vanilla files
I have to overwrit e the base game ones?
you'll see stuff like: MOD: mod "ORGM" overrides media/lua/shared/Translate/EN/ContextMenu_EN.txt in the consle
overwriting is ok
the translation files are actually read before that, so it doesnt matter
but thats the only way you can get them to register
they actually have a different loading method then the rest of the files...the overwrite warning in the console is pretty misleading
ok well i see:
MOD: mod "SuperSurvivors" overrides media/lua/shared/Translate/EN/ContextMenu_EN.txt
MOD: mod "SuperSurvivors" overrides media/lua/shared/Translate/EN/UI_EN.txt
but it still not working
hrm should be but i'd have to see the file to actually check its ok
do i have to have the same wrapper id around all the terms as the file i overrided does?
ok so the file should basically look like:
ContextMenu_EN = {
ContextMenu_ORGM_Unload = "Unload",
}
then in the actual lua:
what a pain
context:addOption(getText("ContextMenu_ORGM_Unload"), ......
ya as i said the initial conversion is a real pain, expecially if you got alot of strings..once its done though its not so bad after
personally with the amount of strings in the survivors mod, i'd just bulk copy/paste the tables, then use regex find and replace features in your editor
already taken care of
you have to use the ContextMenu_ prefix if you use that file.
i had been organizing into my own files / file names and prefixes
what a waiste of time that was
ya
best to just keep the vanilla prefixes lol
the orgm conversion was a pain..the IGUI translations 100,000 characters in 320 lines, 225 lines in the tooltip file
all those damn firearm descriptions for the inspection window x.x
lot of text lol
now the funer part. translating to japanes
ya screw that...other people can upload translation files for orgm if they wish...i'm not going to include google translate versions of those XD
Fenris, you made ORGM ?
if the string doesnt exist in a languages translation files it going to revert back to english anyways
I took over the project last fall
im not gonna google translate eng to japanese. its awful pretty much garbage
meh its getting there...still tons of work to do on it before i'm happy with it lol
The life of a dev, am I right?
XD
Do you mind if I ask a question (nothing too big) about maybe a feature in the future ?
sure lol
Silencers, durability would be nice, and an option to allow them to only be able to be added to pistols, or similar
Putting a silencer on a shotgun is just funny xD
(they do exist, i know, but still)
well atm the suppressors are only available via nolan's mod.....eventually they'll make their way in but I'm revamping the whole attachment/component system first
Cool!
i really dont like the vanilla system...its fine for what its is, but being the REAL guns mod it needs to be more realistic, where firearms are made up of 'components' that can be swapped out, replaced etc
Yeah for sure
so for suppressors you'll need a threaded barrel installed etc
That would be amazing
I look forward to that 😃
I've been wanting to ask, but as a dev myself I hate to pester. You know?
the last update changed the how the stats are calculated to a more dynamic system which its part of the initial work for the new component system
Oh, that should be a big help for you. You thinking your component system will be similar to the Vehicle one?
uh somewhat i guess...i havent really had the chance to look at the vehicle one
if you get a chance, have a look at it
i invision yours being similar, except with less components ofc
i wont get a chance to look until it hits stable lol
bring up gui, gui has an imagine of the gun youre wanting to mod, has little square slots where you could drag and drop the components you wanted added to the gun
let me see if i can find a screen shot for you
i've seen the screenshots
kk
but the firearm components system is kinda in depth...think of it like a tree, theres a base component (reciever or frame etc)...adding a scope needs a mounting system (rails) which maybe built in to the receiver, or screwed on...so the tree that way would go receiver > rails > scope....for a shotgun barrel, it might have a built in choke, or a threaded choke system...so the tree that way branches off receiver > barrel > choke etc
perfect, im a bit of a gun guy so i know exactly what you mean
it will be pretty sweet but its low priority atm, taking my time with it to make sure its done right
as you should
once thats in place though I can start adding more firearms and calibers back in
plus i have to make a crapload of items and icons for all the various components not looking forward to that part LOL
no currently known bugs to fix atm XD
lol...hell i'd be happy if they became known....theres bound to be some there always is...the fact that their are 'no known bugs' just means their hiding good
yeah touche
i'm trying to think if ive ever had any bugs with guns, but im not sure if the bug i encountered was vanilla or ORGM
im thinking vanilla tbh, unlimited reload
well, technically there are a bugs that popup, but they can be traced back to the base game and not orgm, i usually patch them when i can
but before a mod update hits the workshop it usually goes through some pretty extensive bug testing
thats good to hear
one of the reason the steam version usually lags behind the version you can find on TIS forums
really ?
they have people to test that stuff ?
well not officially, but i tend to release them in a 3 stage cycle....it goes to our public server for live testing first, if its good I post the link in the TIS forums for a larger population of people to test there...if theres no reports of issues it eventually makes its way to the workshop
gotcha
currently steam is in sync with the stable version 3.07....3.08 is about to go live on our server for testing, so that will probably hit the forums in a few days...i'd like to push this one to the workshop asap but not going to rush the testing process
yeah smart, whats changed in this version ?
uh the major change at this point is a tab in the PZ options screen for all of orgm's settings, instead of having to define them in a patch mod with lua....syncing the settings between clients and servers in MP plus some other code changes that need some more testing to make sure they wont cause issues i havent found yet
very nice sir
other then the options screen the rest is pretty boring stuff
I'll probably do more with this version before it hits the forums
not really, server/client syncing is a+
but again, maybe not so much for the non devy people 😛
well the client and server settings were synced before, but you had to use a extra patch mod both clients and servers would load...like 'New Dawns ORGM' thats in the workshop...but this should negate the need for that
even better
ya..save on having to answer basic questions like to how to disable case ejection or edit spawn rates lol
hahahaha
anything you can do to make users stop asking the same questions over and over.... 👌
I'll admit I'm not a fan of answering questions because people cant be bothered to read the changelog file, or the document in there describing how to properly edit orgm lol....but since i dont actually have steam, i cant comment on the workshop page...so its khaos and OrMntMan that have to answer the bulk of the questions 😐
yep I'm a GOG user XD
i bought my copy of PZ way before it was on any platform too though
hehe, i had to switch my PZ to GOG
then to Steam
pre GOG PZ was fun
i'll keep my gog version...sure i miss out on the IWBUMS version, but I'm not really a fan of steam
I switched my server to IWBUMS so I could play with cars
I really couldn't wait, and I'm the type to always wait for final release
ya the waiting on vehicles is hard i'll admit, but thats not enough to make me switch over lol...usually end up playing on our server anyways, and i woudnt install IWBUMS on our server I like things stable
the more stable stuff is, the less work for me when shit goes wrong XD
lol
but i get you, stand your ground !
Cataclysm DDA
yep...besides if i started playing with vehicles, then all my development would be centered around that build...i dislike developing for stuff thats actively being worked on since it often means having to redo work when stuff upstream changes...probably not so much of a issue with ORGM i doubt many of the changes will effect it
but its pretty rare that i'll even consider working on a mod for a game thats still being developed
but that being said...i found it hard to play without orgm (love it too damn much) and there was just too many bugs that werent going to get fixed since OrMntMan stopped working on it 😄
and now here we are 😛
yep...mainly I'm just working on it for myself so i'm content with what i'm playing with...but why not share the results right? lol
hell yeah
well, i appreciate it at least. im sure the mod download number speak for themselves too
i'll be happy with the download count once it passes hydrocraft <.<
There was a big flaw in my plan to load a different lua file for each language
theres no point loading different lua file for languages lol...just set the text strings in your lua tables to something like "IGUI_surivors_outofammo1"
then let the translator do the rest
The lua files don't support special characters. My Japanese was turned to garbled garbage
There would have been a point. It would have meant I would not have had to move like 500 strings into a translation file
lol
see ya in 2030
ah thats why i suggested just copy/pasting the whole tables, and using a regex find & replace function to convert all your old text string tables into a proper format
you could probably do the whole thing writing 2-4 regualar expressions
never been that good with regex, just very basic like a diget here or something [0-9]
i love regex, nothing parses and reformats mass amounts of text faster...so damn powerful
sure after i eat something though...can probably skip the names...that could get tedious
btw... "I\ 'm out of Ammo!", your use of \ there is unnecessary
it would only matter if you were wrapping the strings in '...since you've used double quotes there no need to litteral the single quote
lol...damn discord stripped the \ from that string when i pasted
what's your download count compared to HC ?
I imagine HCs download count is monstrous
uh currently 77,791 vs 170,273 lol
@quasi geode if u do, let me know before you start, i've done some already
actually i'll probably be content once we pass cheat menu...after that its just 2 map mods then HC
oh...well i started to get started...pasted it into a text file anyways XD
still eating though so havent actually done anything yet lol
but really i'm just going to do the whole thing in bulk
hey man 77k is impressive!
i did the OrderDesc and OrderDisplayNames
im not sure what you are thinking to do, but i was thinking of making it like so:
SurvivorSpeechTable["OutOfAmmo"] = {
getText("ContextMenu_OutOfAmmo1"),
getText("ContextMenu_OutOfAmmo2"),
getText("ContextMenu_OutOfAmmo3"),
getText("ContextMenu_OutOfAmmo4"),
};
ContextMenu_OutOfAmmo1 = "Out of Ammo!",
ContextMenu_OutOfAmmo2 = "I'm out of Ammo!",
ContextMenu_OutOfAmmo3 = "I'm Out",
ContextMenu_OutOfAmmo4 = "No more Ammo!",
uh ya but its not really a context menu, so i been using IGUI_speech_OutOfAmmo1
but pretty much...IGUI_speech_ <Table name><index number>
god damn discord editting the _ out of my text lol
this thing is horrible for trying to show code examples
huh
ya i never actually use this thing...didnt even bother with discord til the TIS site went down the other week XD
i only know it because i looked up the formatting when i was making bots sent messages
ok....i may have underestimated the size of some of these blocks and the amount of manual edits required to tag the numbers on them...time to pull out the bigger guns and hit the whole damn thing with a python script lol
oh thats better should have done that in the first place
@placid delta https://tekagis.ca/IG_UI_EN.txt
i left out the OrderDesc and OrderDisplayNames, and all the male and female names
i could do the gender names if needed though
ah i messed up the first line there and forgot a "...thats what i get for doing that line manually
thanks for that
np..that would have been very tedious to do by hand lol...python ftw!
and the other half of the job is i guess going though the survivordialoge file again and writting getText("IGUI_speech_OutOfAmmo1") etc
yep lol
see why i tired to just allow translators to make a copy of that file and have it load the right one based on langauge.
i'd probably just record how many of each dialog there is in a table, then do something like getText("IGUI_speech_OutOfAmmo" .. ZombRand(SpeechCount.OutOfAmmo)+1 )
that doesnt really seem like its any less work
whats a regex to select anything between 2
"example asdasd asdas",
sorry
i mean replace any line like this:
"You're Dead meat",
into this:
getText("IGUI_speech_
("[^"]+",)
( ) for the capture [^ is anything except whats in this block ] + means 1 or more of the previous
gah sorry messed up that regex 1 sec
there lol...+ was in the wrong spot
ya thats working
ya i end up doing alot of text data reformatting for people...so spend alot of time pissing round with regex lol....that translation file i ended up using a few regex's to convert the data into python lists, then pumped that through a quick script 🙂
used to do craploads of that kind of work in perl...which is 90% screwing with regex lol
I've done a number of reading / text manipulation kind of scripts mostly in php, but I just use this function I made to select anything between two strings. That covers 95% of what I needed. When I did need regex, I had to fiddle via trial and error for some time to get it working, avoiding really trying to learn it
ah well when some client hands you 10,000 text files and says 'i need all this data reformatted so it looks like this...' regex is the only way to go XD
I've definitely done that without regex but still it's great, should learn it better
looks like overriting IGUI does actually cuase all other igui terms to be erased
no, its seems like i somehow accidentally deleted my base game IGUI EN translation is all
That would do it.
What’s the code language for zomboid?
There has been a new Mod Published!
java and lua
Good evening. I would to put the attenction of the devs on the following questions:
We are working on our server, on the writing of new mini-quests that we would to be readable and/or listenable on radio/tv, adding new phrases or modifing the old messages already in it.
We have found the following file: (C://Project Zomboid/Media/Radio/RadioData.txt) and we have found the following lines
text = (what the radio says)
member = 550510ab-0997-445d-9c4a-6f9acf9a8b3b
member = b14163e2-3103-4a88-8500-07cdf23ee6c1
member = 51b3dacb-eea4-4a87-9b5e-005fbb2d67a2
member = e0e74f88-e00b-4fec-b26d-96ef44d553a5
member = dfb1a0f4-5472-48fd-b9be-b810bbe36a4f
member = 93d3954e-fecd-4347-9eb5-ec4628ee8494
But we don't know what these codes are and how to generate others. So..
-What are those numbers under every phrases? And how to generate them?
-To create a meaningful text how we should proceed?
-What is the procedure to insert the Mini-Quests once we crate them?
-Is there a limit to the lenght of the phrases or the text?
-If we would to add others during the time, we just need to updated the mod or to hard reset it?
-Is there a way to award prizes to the players once they complete the quest?
I hope the devs can help us, since we have been supporting this game, with our server, for 4 years, with passion, dedication and professionalism. Thank you.
@placid delta Added getter and setters for ClientControls in CarController no idea when it might go out.
There has been a new Mod Published!
There has been a new Mod Published!
oh now it lives lol
Just incase anyone here came across the Custom Canning mod:
New Dawn Canning Mod (https://steamcommunity.com/sharedfiles/filedetails/?id=1337321988)
Please don't install it into your own server as it is not stable for installation and will destroy your world. We don't intend to destroy any, just a bad typo on item recipe that seems to trigger a bug in game that kills everything in hydro + orgm.
(Though usually typo should result in item not being added but the game decided to anyway with terrible results)
lol is that what happened to the ND server the other day? the canning mod is to blame?
ya thats kinda bizzare
It was something to do with
Item/Item2/Item3
Where you can choose either one of the items.
Instead we decided to go:
Item=10/Item2=10/Item3=10
The game now reads differently
MushroomGeneric1=10/MushroomGeneric2=10/MushroomGeneric3=10/MushroomGeneric4=10/MushroomGeneric5=10/MushroomGeneric6=10/MushroomGeneric7=10,
Trying to make any mushroom to work but they require 10. Though it looks almost legit but meh the game doesn't support such thing.
Just tested our Custom Chatbox mod, it is looking good thus far with some problems with radio and /all. The old chatbox really can't make it. Too dull and boring.
Though if anyone could let me know how can player broadcast radio message, that would be great.
player:say() doesn't seem to have any code that does radio stuff.
Since that's also the only possible code that original chatbox does, there might be something I am missing...
looking through the java, it looks like IsoGameCharacter.Say() calls IsoGameCharacter.ProcessSay() >>> IsoGameCharacter.chatElement.addChatLine()....which does the radio stuff
so player:Say() should just automatically be handling radios
I turn off the network part, there is a longer overload for IsoGameCharacter.Say() that can disable the sendNetwork as I handle that manually with my mod using luaNet. (So I can change chat distances and have font colors)
With all the data sent and received from the player, it should trigger the Say() locally for each player and then print out if it is in range. Maybe onWorldMessage return something fancy that I couldn't catch it.
using this one right?
public void Say(String line, boolean doNetWork, float r, float g, float b, UIFont font, float baseRange, String customTag, boolean bbcode, boolean img, boolean icons, boolean colors, boolean fonts, boolean equalizeHeights)
that still calls IsoGameCharacter.ProcessSay()
the shorter IsoGameCharacter.Say(string) simply calls the longer version
but tbh i havent heavly investigated the radio code...i just went with the logic flow from using Say()...eventually its calling the ChatElement.addChatLine() that has some of the radio code in there, but it looks incomplete
I have implement OnWorldMessage a little differently:
If user is [Device] it will display radio message
If user is nil then it it could be ServerMsg or some random things and just display it.
If there is a user, it would ignore the original message and use my custom one instead to display.
I hope it is not because it falls under the 3rd condition, as radio messages should be 1st one even if another user talks in the radio.
Though I had a plan to ditch the mech radio and replace it with something custom since my chatbox already had tabs in it.
hrm ya looks like GameClient and GameServer has specific functions for dealing with radio related udp packets outside of the basic chat, not sure where they're actually coming from though...tbh getting a headache tracing this code lol
That's the hardest part yet. Normal message I can still trace back
Though I really don't like how the distance is really hardcoded rather than using the one specified using Say() function.
It defeats the purpose kinda.
oh...ZombieRadio class in the update() method
loops through the player list and checks each player for .isSpeaking()
you'll have to call player:setSpeaking(true)
maybe...
I will try that when I have the chance to test the mod again.
ya i'm not sure actually that one will help....:setSpeaking() sets IsoGameCharacter.speaking = true...but :isSpeaking() is actually checking the IsoGameCharacter.chatElement.IsSpeaking()
the ChatElement.upate() method calls updateChatLines(), which will automatically set the ChatElement.Speaking to true/false....so really it should be auto detecting it all i think
the whole ProcessSay() > ChatElement.addChatLine() call happens even if you've doNetwork to false
dont think i can trace it anymore without actually running it through a debugger
There has been a new Mod Published!
any mods that adds turrets for base defense?
No but There is land mines
Since gun fights are this inevitable thing now, What do u think if I make standing next to walls or other objects add chance to avoid gunshots, to simulate cover? For each object around you adds like 15% gun shot avoid chance. So standing by a corner wall or inside a corner of cabinets, or in between some trees would give you like about 50% advantage as compared to standing in the open.
That'd make gun fights way more interesting no?
i was actually contemplating working cover into the calculations, but not with the current aiming system i think since cant really predict what target the java is actually going to select (well, i can but it would require a nasty mess of slow code)
personally i think your better off spending the effort on how the survivors actually react in potentially hostile situations...checking over their shoulders for Z's behind them...backing up while engaging advancing Z's when using firearms etc
There is an event for weapon hits character. And a way to reverse the damage of said hit with the request I made to con all while back setAvoidDamage
But that's only in IWbUMS
So it'd be easy , just check if the attacker weapon is gun, and check the amount of legitimate cover on victim and calc the damage avoid chance
ya but for it really to be effective, the object should actually be inbetween the line of fire, otherwise its just cheap...which means not just calculating what objects are around the target, but which target is actually being shot at and objects within line of sight from attacker to target
I also think simply adding some knock back to pvp Mele would make Mele pvp a billion times more interesting. It's so dull as it is now, whack whack whack...
But if there is an object in between , then they would not get hit anyway
Current system is, your in line of fire or not
Can you shoot over counter tops? Over cars?
cars idk...over tables yes
and windows
some objects you can completely fire over without any issues
If so, then yes. An object like counter or window frame wall in between should give good avoid chance
Still easily doable with the avoidDamage thing used in weapon hit character event
the whole calculation of targets though is a nasty mess in the java, its far to much effort to simulate the prediction of who's getting shot at in lua
U don't need to, onwraponhitcharacter event fires after the hit is already calculated. It gives you the attacker, victim etc
It means bob successfully hit jim
You just reverse the damage if your cover calculated true
ya...theres also actually another option other then OnWeaponHitCharacter event i noticed the other day...the avoidDamage was unnessarry
I'm using it to prevent friendly fire in survivors
if you look at the java code for the Hit method...
LuaEventManager.triggerEvent("OnWeaponHitCharacter", wielder, this, weapon, Float.valueOf(damageSplit)); if (LuaHookManager.TriggerHook("HookWeaponHitCharacter", wielder, this, weapon, Float.valueOf(damageSplit))) { return; }
you can use a hook and if it returns true the damage is never delt
thats in the 38.30 code...just spotted that one the other day lol
SetAvoidDamage seems easier
not sure i'd agree with that one..calling another function or just returning true...i'd see the hook as both easier and faster (code wise)
and also backwards compatible with the current stable...not that it matters much since the pathfinding isnt compatible anyways
the only real difference is your using Hook.WeaponHitCharacter.Add(myFucntion) instead of Events.OnWeaponHitCharacter.Add(myFunction)
all the arguments are the same
actually i think i just found a bug in that..the LuaHookManager class calls addEvent("WeaponHitCharacter"), but the Hit method is calling "HookWeaponHitCharacter"
guess i'd better stick that typo in the bug tracker lol
And maybe play a bullet ricocheted sound if an object by you blocks a bullet
i think if you're going to make cover be a thing, instead of just having a raw % chance, calculate it as a penalty based on the attackers hit chances
basically:
local aimingPerk = player:getPerkLevel(Perks.Aiming) local hitChance = weapon:getHitChance() + weapon:getAimingPerkHitChanceModifier() * aimingPerk local movePenalty = attacker:getBeenMovingFor() - (weapon:getAimingTime() + aimingPerk * 2) if movePenalty < 0 then movePenalty = 0 end if attacker:HasTrait("Marksman") then hitChance = hitChance + 20 end if ZombRand(100) > hitChance - movePenalty - coverPenalty then -- shot was blocked end
But all that stuff is already taken into account before the successful hit which triggers the oneeaponhitcharacter
yes, but this way it factors the additional role provided by cover, giving better skills a higher chance to bypass the cover...that code sample above was more a example of all the factors used to calculate the hit chances and how they're called
a higher skilled shooter is not likely to aim at the covered part of a target
So cover is less effective against higher shooting skill , fair enough I suppose.
Need to put little bullet splash anims where objects block bullets would be nice
ya that way if a target its 50% covered (ie: from the waist down) it doesnt just factor into a 50% chance the target can avoid the shot, the skilled shooter is not just aiming in a general direction and trying to randomly hit
could also alternatively base it off the critical hit chance instead...though thats often alot lower
one thing though the vanilla guns end up with insanely high hit chances at high level aiming
pistol for example base chance is 45, +15 per level = 195% at max aiming (out of a roll of 100), the move penalty at lvl 10 aiming is negated completely for the pistol
orgm drops the max chance for things like pistols to 115%, not counting movement penalties, which varies depending on the weight of the weapon
i dont really enjoy getting too indepth in the calculations.
I just whipped this up. it works as expected:
``
--- obj cover calculations
if(instanceof(weapon,"HandWeapon") and (weapon:isAimedFirearm()) then
local angle = getSpecificPlayer(0):getAngle()
local dir = IsoDirections.fromAngle(angle)
dir = IsoDirections.reverse(dir)
local victimSquare1 = victim:getCurrentSquare()
local victimSquare2 = victimSquare1:getTileInDirection(dir)
local coveredFire = false
for q=1,2 do
local objs
if q == 1 then objs = victimSquare2:getObjects()
else objs = victimSquare1:getObjects() end
local aimingPerk = wielder:getPerkLevel(Perks.Aiming)
local hitChanceBonus = 0
if wielder:HasTrait("Marksman") then hitChanceBonus = hitChanceBonus + 10 end
if(objs) then
for i=1, objs:size()-1 do
if(objs:get(i)) then
local obj = objs:get(i)--print(obj:getObjectName() .." has cover value of " ..tostring(getCoverValue(obj)))
local chance = getCoverValue(obj) - (aimingPerk*3) - hitChanceBonus
if ZombRand(100) < chance then
coveredFire = true
break
end
end
end
end
if(coveredFire) then break end
end
if coveredFire then
victim:Say("!!")
getSpecificPlayer(0):Say("!!")
if(victim.setAvoidDamage ~= nil) then victim:setAvoidDamage(true) end
return false
end
end
--- obj cover calculations END
``
ah, that should be "wielder" not getSpecificPlayer(0) on line 3 but u get the picture
nice...once the new animation system is in i'll probably work something similar into orgm for use on mp servers...kneeling and prone firing etc..i've just added a pre-firing hook into it the other day that would beable to check the position the player is in and adjust hit chances accordingly...though for now thats mostly going to be used for handling mechanical and ammo failures
like squib loads 😄
the realism fanatics will love me for that one....for everyone else i'll probably become the most hated of all modders LOL
naw...they should...zombies need cover too!
personally though i'd probably just throw all that in a seperate mod lol
risks turning the survivors mod into a mod that changes firearm behavior, its kinda going off topic XD
if the required mods thing worked properly then yes
if you add a required mod for a mod. it forces the download, but not the enabling of it
kind of dumb
interesting...i've never actually used it before
its a steam thing
ya i knew about the downloading part just figured it would do the activation as well
looks like i should not use the current square objects as well as the in front of square objects
walls behind me (but are techincally on the same square as me) are blocking bullets for me
ah i'd just exclude walls maybe, or check the direction the walls are in vs the shooter
if you dont check you'll probably break using windows as cover when firing from them
ya exlude walls, bc, if a wall was between you and them, they wouldnt have got that shot on you in thef irst place
ya
There has been a new Mod Published!
There has been a new Mod Published!
Hi Nolan did Hydro tell you about the issue with solar generators in his mod? He told me you worked on that part. Basically if you leave the area and come back the power is switched off even though the solar gen is plugged in. Power also turns off when you continue a saved game. I am assuming something was changed in the stable build as the solar gen was working before in previous stable/HC versions. Also the same issue occurred with the vanilla generator in the stable branch. But now in the IWBUMS branch vanilla generator now work properly when you leave the area (and come back to it) and when you load saved game. Perhaps when the cell is reloaded it didn't retain it's previous state that power was enabled before? It took me many many hours to get all the requirements for the solar generator so I'm hoping there would be a fix/work around for this. Hope you can help. Thanks.
what probably happened was that now when an area is reloaded, it gets checked if there is an active generator there or not, and since the solar gen is not a real generator, the area when re-loaded from re-entering game or cell will resultingly have no power. Basically it would need to be re-made in a different way. and i've got enough stuff to do atm really
@placid delta comment from the SS mod workshop page:
If using your supressor mod with ORGM (https://steamcommunity.com/sharedfiles/filedetails/?id=640674707) and your survivors have guns with them, when you load a save game, the guns arnt supressed. You have to switch weapons with them, then switch back, for there guns to be silinced again.
the issue is ORGM sets alot of the weapon stats when its equipped, when games are loaded alot of these stats are lost...part of the reason the backwards compatibility stuff unequips and re-equips the weapon on login...which is part of what the built in patch was doing for the survivors as well
IsoPlayer.load has a setPrimaryItem() call in it, so why wouldnt that trigger your init w/e function then?
oddly enough i don't think it does, or that comment about the silencers would be null and void
i'm not sure why, but i havent traced the IsoPlayer.load in the java, but it doesnt seem to call the OnEquipPrimary event for w/e reason
its more of a problem with silencer patch not survivors? orginially i had it set onattack event, not onequip event. you should just obsorb the orgm silencer mod as on option in ORGM defaulted to off.
I was going to eventually include them as a option, but after i redo the whole attachment system....the patch overwrites the whole silencers mod code, having it trigger on attack is wasteful, its causing extra checks every time the gun fires which can be quite a lot with full auto....the only time it really needs to check is on equip, and on loading
but as i said...orgm sets ALOT of other stats on equip too
recoil, swingtime, damage, aimtime, weapon weight etc
like pretty much everything
so without that OnEquipPrimary getting triggered the guns are kinda nerfed
i think when i made silencer, the onequip event didnt exist yet. or maybe i just didnt know about it.
ya for the player it does it on equip and on game start, but it doesnt help the survivors when their loaded...alot of the other item stats dont seem to get properly saved either when you call the item:set* methods
so i just add :
LuaEventManager.triggerEvent("OnEquipPrimary", this, leftHandItem);
to the survivor loading then?
sure you could trigger the event manually, i was doing a item = player:getPrimaryHandItem(); player:setPrimaryHandItem(nil); player:setPrimaryHandItem(item)
basically lol
just a forced unequip and re-equip
though triggering the event should work just as well i'd assume
ah ya see looking at the java the load method doesnt actually call the setPrimaryHandItem..it just does a this.leftHandItem =
@quasi geode I put ammo spawn rate to 3.0, didnt find a single gun and a total of 4 boxes in muld police station...i doing something wrong?
no...uh are you using the 3.08 or the 3.08.1 i posted the other day....3.08 has a slight bug
mag relood time i set to 3, tho it did not increase reload speed
BUT, if you suscibe to the workshop orgm, then copy over the workshop files with 3.08 the spawns should fix themselves lol
Nolan, the logic appears wrong in my opinion and I think TIS should fix it, not modders. On the forums I hear there is a workaround...remove all vanilla generators in the cell where you want to use the solar gen and the solar gen will work again. If the TIS developers don't think this is strange then I don't know what is.
ya just subscribe on steam and replace the workshop files with the 3.08 that should work for now
well TIS cant really run around supporting all mods.
i mean they could have one guy who sort of does that kind of thing on the side a bit perhaps
and the mag reload time setting...was that tested on a new game?
yes
hrm
brand new
oh...i see...the mags reload time is setup when the magazines are registered with ORGM on mod loading...going to the options screen, changing the setting then starting a game skips the effect
meh...would have to change the option, restart pz, then start a game...i'll have to fix that
im not sure what version i even have
change logs appear identical but
the one i just dl does not say .1
3.08.1 i mean
when was 3.08.1 updated?
if you just downloaded now then its 3.08.1
trying to figure out if these problems i experienced where on 3.08 or on 3.08.1
pretty sure my gun jammed when jamming was off too
Posted Saturday at 11:22 PM (PST) is when i made the forum post for 3.08.1
so few days ago
thats approx when i dl it so...inconcluisive i guess i should try it again with new dl
the jamming is another small side effect with the bug lol
No I meant that TIS gave us all those classes (eg Generator class) to use the generator feature. But they've effectively nullified it by only checking for their own generator.
ya the devs really cant take into account all the mods and the weirdness they do...if they start factoring all that into the development then none of the real dev work will get done. mods by nature are built to do things the base game doesnt...and tbh that would be a easy enough fix for hydro to implement himself
when a grid square gets loaded, if its got a solar gen that shoud be active, call the code that normally activates it, problem solved
I was thinking a few times about making a more in depth solar power system mod. It's something that in interested in in real life too
not that hard to write it really lol...theres a OnGridSquareLoad event...theres methods for getting all the objects in that grid square...and theres a function the solar gen calls when the player activates it
Require you find like charge controller, inverters and batteries to set up
the whole thing is probably 4 lines of code
It might not be that easy. If the base game detects no power before you do that. It will still spoil food in containers etc based on lapsed time since last loaded etc
that could be the only issue...if other squares that should have power get loaded before the square with the gen
but i'd imagine that would be a issue with normal generators too
Well base game would detect those real generators and calc how long they would have theoretically been running and if they stopped at some point due to no fuel etc then it would only calc spoilage from that point on etc. but again it would only do that for base game generators
It all depends on how exactly try work since this change that broke the solar gen
They* work
ya i took a peek at the java there but not really helpful i think since i'm looking at the stable branch
I think the current stable is the build hat broke it iirc
ya i think so, honestly i never really use the generators much lol
Yeah I saw the issue in stable first.
Solar generators are in a way 'end game.' Gives you a purpose/goal in HC.
Isogridsquare has a Boolean variable called isppwered or something
Is this in lua or java? Can you override it?
haveElectricity
It used to only be calculated when generator actions happen like set or turn off or out of fuel
But that's not the case anymore
its in java ppanda, you can call it from lua with square:setHaveElectricity(true | false)
Well the workaround for this issue is working so I'm happy with that.
The solar gen code is very simple. It just does what a generator does when it's turned on. Then the fake generator is removed
A basic validation was added which makes that useless
I was thinking if you derive the solar generator from the base generator will it fix the issue?
Or doe the code look specifically for the base generator and not it's derivations?
oh i see..looking at the IsoGenerator class, theres a .update() method, that calls .setSurroundingElectricity() i'd imagine .update() is constantly called, looks like the fuel consumtion is in there...still the setSurroundingElectricity() is some basic looping that could be implmented in lua fairly easy
well...theres something i didnt know...generators in poor condition can cause fires lol
A little off topic. On the right I see others 'playing...' Do you see them even because they have the browser open or its because they're logged into discord, regardless whether the browers/app is open?
In other words, I don't want people to see what I'm playing. How do I prevent that lol.
you using the discord app or logged in via web browser?
logged in via browser.
not sure if the browser does it...probably not
Lol. xD
Discord won't display what you're browsing so you're SAFE there.
But Discord will display any other executable.
So don't launch them porn apps. xD
You mean discord will display what I'm playing even if I don't have the browser open?
Yes.
Dang...alright I guess I need to logout each time.
I'm sure you can completely disable the 'currently playing' in the settings.
oh that's even better. thanks!
Yeah I can imagine awkward moments popping up that way on Discord LOL.
even better you can edit the name of what you playing 😄
Yeah change to: discordapp :).
Ah that settings is only found in the desktop app. I can't find it via browser.
*setting
ya i dont think the browser can do it
Just curious. Do the developers actually read this forum?
I mean this _modding subforum.
sometimes...actively reading everything in here, doubtful
haha are you really playing that or just renamed it?
i want it to say "russian roulette with a semi automatic pistol" but its too damn long 😐
ok.
and no i'm not actually playing lol thats notepad++ renamed XD
Anyways thanks Fenris and Nolan for looking into the solar gen issue. We had nice discussion - well mainly you two because I don't know how PZ works. But now I know more than before.
Yes, I actively read everything in this channel.
This and PZ_Discussion, generally I try to read all of.
connall is always watching 😯
I get busy sometimes, miss the boat on messages but I do generally read them all. Help where I can.
damn popup notifications from this channel force me to read everything lol
oh yay finally done recording barrel lengths for all the guns in orgm...that took some bloody time 😐
All im saying is when the cars come out, i wanna see The Mach 5 from Speed Racer lol
@quasi geode I crafted a silencer, seems there is some error when you equip it after p[utting on gun. i guess that recipe that creates it does not init it with your init process
oh...i think i know why...its not in the ORGM.ComponentTable to prevent them from spawning
need to get the components to have proper rarity values like the firearms
local cdetails = ORGM.getComponentData(mod) or { } that works as a patch for now lol
There has been a new Mod Published!
There has been a new Mod Published!
any ways (or a mod already made) to tweak fuel usage and cargo space of vehicles?
There has been a new Mod Published!
There has been a new Mod Published!
@earnest quartz Fuel usage can be adjusted in server settings. Cargo space looks to require modding.
kinda dumb question: I want to execute code whenever a object of my mod-item is created
I thought I could use the event OnObjectAdded but for some reason this isn't triggered at all
whats the creation method? container spawning or recipes? not sure if theres a generic catch-all event you could use
container spawning
oh...you can use OnFillContainer, its called after the items have spawned, then check for the items inside the container
i did something similar with one of the mods on our server, with the OnFillContainer event then using: local items = container:FindAll(itemName)
@quasi geode Hey man, do you have plans to make any ORGM items be produced through blacksmithing?
not at the moment really, theres not much that could really be done via blacksmithing unless we're going back to old powder/flintlock rifles
maybe some of the magazines, a few internal components, the foregrip attachment maybe
No special bullets or anything like that?
well...possibly lead or steel core bullets, but tbh i havent expanded the list of ammo types to include those yet
really should get around to added the lead only/soft point bullets
the current FMJ/HP rounds its using arent really easly made using primative smithing methods
ok, I'm only asking because someone asked about it in the blacksmith mod I uploaded
TIS' blacksmith recipes include bullet molds that allow you to make some of them each time
so I thought it was worth checking with you
ya...i'd guess those molds would mostly be used for solid lead softpoint bullets...a solid steel bullet would be pure hell on a barrel unless its jacketed, and you dont make jacketed bullets with molding techniques
though you could mold a pure brass bullet
or any soft metal really
eventually i'll be adding reloading as a expansion mod to orgm, was going to do some bullet casting for lead but its pretty low priority
new brass cases wont be included since their manufacting is actually a fairly advanced technique requiring alot of heavy machinery...and you'd have to find boxes of primers, so it wouldnt be like a endless supply of ammo
hydro lets you mold cases if i recall right which is pretty lame and unrealistic...you dont mold brass cases lol
I was thinking about making a recipe for iron sights, but that's all, I can't think of anything else about firearms that would be realistic
well, not just firearms related, I can't really think about many things they left out
ya those and the grips, really i wouldnt bother though, i'm redoing the whole attachment/component system anyways
once thats actually redone though, there will probably be a shitload of possible items 😄
maybe a throwable bomb?
You should think about adding some recipe magazines then, but you'd have to check if the blacksmith mod is enabled
ya, i'll probably throw the compatibility in with the expansion mod that handles case reloading and the gunsmithing profession
most of it wont really be recipe mags though...more like manuals you need to keep handy while working
alot of gunsmithing work is dealing with very small numbers, tolerances and measurements down to 0.001th of a inch...its not really stuff you read once and memorize lol
and the next question: any event that fires when an item is transfered to a container?
are there any texture mods?
@river plinth My cursory search seems to indicate that there is not.
There has been a new Mod Published!
There has been a new Mod Published!
There has been a new Mod Published!
Thanks for lookin into it @pine vigil , would be nice if this was a thing but guess I will need to use a workaround then
If you poke me on Monday @river plinth I might be able to create a new trigger for it.
yay more events!
more events are always welcome! Will do Connall
expecially a OnItemTransfer style event that would be handy
yep, would be best if it passes on the source container and the destination container
and of course the item transfered
and IsoPlayer doing the transfer
@quasi geode what is the loudest ORGM gun
its currently very static in the radius, all shotguns are SoundRadius = 200...this is going to change quite a bit next update
next update is dynamically factoring in barrel length + caliber to determine sound radius
so i guess its safe to saw that a base game sawed off shotgun is the loudest gun in the game
I just wipped up a way to visually represent sound radius so people can have an idea.
this is a sawed shotguns sound range http://undeniable.info/pz/range/?r=250
for now it is, but once its going to be calculating barrel length into damage/range/recoil/sound i'm willing to bet some will push past the 250 mark
regarding my cooling box problem from a couple weeks ago: further investigation of the IsoObject let me stumble upon the saveChange function, which has this code
public void saveChange(String change, KahluaTable tbl, ByteBuffer bb) { if ("container.customTemperature".equals(change)) { if (this.getContainer() != null) { bb.putFloat(this.getContainer().getCustomTemperature()); } else { bb.putFloat(0.0F); }
but I don't think I can call this from lua😫
the other thing I thought about but my knowledge is lacking: modData
when and how is modData loaded?
@river plinth IsoObject.saveChange() would be hard to call from lua, due to that ByteBuffer...but if you trace back the code, .saveChange() is called from GameServer.sendObjectChange(), which is called from IsoObject.sendObjectChange(String change, Object... args), which you can call from lua
thanks for investigating @quasi geode ! Kinda hard to navigate the sourcecode without jd gui for me
I tried the function discribed in your message, this is my call: container:sendObjectChange("container.customTemperature", {});
still havent got that jd gui working again? 😐
still getting Object tried to call nil
nope, using intellj now but kinda miss the easy to use search from jd gui
not sure why you' d be getting object tried to call nil...the method is clearly there in the IsoObject class and set public
3 different versions of it
public void sendObjectChange(String change)
public void sendObjectChange(String change, KahluaTable tbl)
public void sendObjectChange(String change, Object... args)
yep, tried pretty much all of them
and I have the normal checks to ensure that my container isn't nil
every other function I call on that container object works
the only gotcha with those is they need to be called on the server, but they still shouldnt be throwing a exception
that's the other thing that worries me: SP
thats really strange though, i'll have to see if i can try calling them when i get a chance
jd gui seem to work for me
I know why it doesn't work, just don't know how to fix it
I have OpenJDK 9 installed
with 8 it runs, with 9 it doesn't
I need 9 though for a private project I'm working on
@river plinth Still interested in when ModData is loaded?
There has been a new Mod Published!
okie after couple days of tryin and failing, can i request someone make a mod to adjust vehicle inventory limits please 😄
I haven't put my hands on the modding, but what are the limits? Is PZ open enough for us to make custom ncps/creatures (pasive, neutral and agresive instances)? I had an idea to try and make custom basements/underground tunel systems (grass level would probably be just 1 floor higher and tunels would occupy the first floor... Yeah, I should probably wait till they actually make basements a thing, but that might take another year lol) - not sure how and if that would really work, but don't care. The point is, it'd be cool if it was possible to code rats/wolves as agressive inhabitants of the world (dungeons would have a slight chance of spawning rats). .... Or is the modding more focused on stats and items?
there is a survivors mod, so people works, not sure how hard it would be to goto animals
I am beyond stumped with this. For some reason printing to console just does not work for me when triggered from the OnFillContainer event, despite other code working (such as adding items to the container) and it working a while back. It seems like maybe something changed in a build but I don't know why it would work from other events.
ZombTests = {};
function ZombTests.testFill(contRoom, contType, cont)
print("< OnFillContainer >");
if contType == "inventorymale" or contType == "inventoryfemale" then
print("< Zombie Corpse >");
end
end
function ZombTests.testUpdate()
print("< OnContainerUpdate >");
end
Events.OnFillContainer.Add(ZombTests.testFill);
Events.OnContainerUpdate.Add(ZombTests.testUpdate);```
Only < OnContainerUpdate > prints to the console. (And, oddly, this event seems to fire twice any time a door is opened or closed.)
where is the Event hooked from? clients, shared or server?
if its in client it wont trigger
@pine vigil I'm confused, it's there but it doesnt let me use it:
maybe because BaseVehicle.getController returns a "protected" CarController object? and those are not usable in lua? in actual java, protected doesnt really mean anything diff than public as i understand it, but this is lua so idk
Public is open to everyone, protected is accessible by child classes.
But yeah, that's probably the problem.
some people don't seem to think so : "in Java protected makes the method also accessible from the whole package. This stupidity in Java's visiblity model breaks the goal of protected"
i also tried to make a new CarController object, but CarController.new() says, "nil tried to call new" so it doesnt even reconginize the public class CarController for some reason
if the problem is the "protected" part of it. you could just move the setter and getter for ClientControls into the BaseVehicle class,
the same thing you put in CarController but just adding the getController() to the return values, then it could be in BaseVehcile
CarController.new() wouldn't work, because it's expected a BaseVehicle parameter. It's probably saying the function doesn't exist, not the class.
i did put a vehcile object in it
it said nil called new, which means CarController is nil
not a class
see
weird its like CarController is disabled on purpose or something
Oh bugger, I might know the issue. Two ticks
You got the ability to recompile source changes @placid delta ?
i can slong as the file is good, not hacked from decompiled
Nevermind then, I think this might be a simple case of an issue because the class is not exposed to the lua side.
theres no reason i have to do this now.but if it will eventually work thatd be good
Yeah, probably be a bit.
also can we have a trigger for when PlayWorldSound()
@pine vigil yep, still am. I haven't found a proper solution for my problem yet
Moddata on items are loaded when the grid is loaded IIRC @river plinth
Ehh square I mean.
automaticly or if I use the onLoadGridsquare and then cycle through the objects in that square?
It's automatically loaded, yeah.
When you alter moddata and leave the square, it gets saved automatically.
Dito when you ever the square.
There has been a new Mod Published!
@quasi geode Sorry, just realized my alerts were off. If you were talking to me, I have the script running from server. It's just beyond strange because both events do go off, but only one prints correctly. Is there something else that determines if something hooked from clients, shared, or server besides folder?
well besides the folder, it depends if your running in SP mode or MP, the java will determine what events are called on clients or servers. If your running it in MP, the server fills out containers, OnFillContainer is never called client side
so its mostly going to be the java that determines it regardless of where you put it in the lua
So does OnContainerUpdate run differently? On the client?
i cant recall, i really havent tested that event myself, i've spotted it in the java at a few points but idr exactly
It's hard to tell with events. I can't find any real reference for most of these.
but i print to the console all the time in OnFillContainer with ORGM, debugging the loot tables
That's what has been driving me up the wall. When I first started working on this, printing in OnFillContainer worked. At some point over the months I've been working on it on and off, it stopped.
usually what i do if i want to find where they're called, is hook into all the events, both in the client folder, and the server folder, and have it print the event name, and if it was called client side or server side, and run a local server
So slightly different print scripts in client and server to see?
so some events it prints twice, specifiying it got called on both sides, some just print once but at least it tells me where
That will help a little bit.
basically what i do, in the client folder:
``local function printEvent(event, ...)
print("--------------------------------------")
local d = {select(1,...)}
for i, v in ipairs(d) do d[i] = tostring(v) end
print("-- Client: "..event .. "("..table.concat(d, ", ")..")")
print("--")
print("--")
print("--")
end
Events.OnGameBoot.Add(function(...) printEvent("OnGameBoot", ...) end)
``
and the list of events goes on....
but it prints "client: " then the event name, then all the arguments it got
and repeat that exact same in the server folder
Oh wow. That's great for understanding the arguments.
yep
Hopefully I can figure out why OnFillContainer just stopped printing. Nothing else should have changed or seemed to be wrong with it.
oh..i totally forgot i actually debugged all the events that way and saved the output
OnContainerUpdate is called both client and server side
1521394590086 -------------------------------------- 1521394590086 -- Client: OnContainerUpdate() 1521394590087 -- 1521394590087 -- 1521394590087 -- 1521394590087 -------------------------------------- 1521394590087 -- Server: OnContainerUpdate()
Are you aware of anything that might otherwise interfere with scripts or the console?
nothing i can think of
theres the small mod i used to debug the events
its got the client/server files with the above function, all the events hooked (some commented out due to noise) and the results from various tests
all the test results i just copy/pasted from the console logs into the file in the client folder
most should pretty much be in the order they fired in
Welp. Not sure when, why, or how, but print doesn't work when triggered by OnFillContainer on multiplayer.
did you check the coop-console.txt file?
Yeah, nothing in there either.
thats odd, what build you using? like i said i print from there all the time with 38.30, cant imagine its changed for IWBUMS
IWMBUS 39.58 Steam
do you have any mods loaded that overwrite the server\Items\ItemPicker.lua file?
or the ItemPicker.fillContainer() function?
because thats where the event is triggered from
It's possible, though it's just occured to me I had more mods running in singleplayer than multiplayer.
ya that event is triggered in lua so the only thing i can think of is something is overwritting the file or the function in the file
christ... or my mod list somehow doesn't save and it was just because the mod wasn't loaded.
It's printing now.
lol...as long as it works XD
Now I just have to figure out why my own mod isn't printing.
There has been a new Mod Published!
Is there a way to remove the transfer item delay ? Via lua or else ?
Sure, just make your own version of TimedAction/inventorytransferaction.lua and dropaction.lua and alter the "new" methods to change the time parameter to 0 so that no matter what time value is fed to it it will still always be 0
Hello modders! Someone know, what I need to do for loading my replaced car model at mod for workshop. If I just put a new model with same name in models folder of my workshop directory, subscribers doesn't see replaced model of car.
I trying a replace police pickup for new
@placid delta thank you ! I'll take a look. Only server side or client have to be upgraded too ?
Will tweak it a bit
U would have to make a mod or add it to your server mod pack. And require it. Times actions are client side though
Sigh, this is cumbersome
Client side only is good though, optional and without disrupting the server is good
you cant just tweak a file server side, or the lua checksum will fail for everyone. you need to put that change in a mod, and require it. or if you already have server mod pack, jsut make thtechange there
Having trouble finding an example of the right syntax. To import multiple modules, is it...
imports
{
Base, Hydrocraft
}```
i'd imagine so, cant say i've ever tested though
@placid delta it already in package of mod (model and textures)... new textures was replaced default and was visible for other players, but not a model.
Custom model was ignored for loading. I know only one way to see a new model - manually cut a model file and replace in directory of game. But it hard for a users... add one step for them(
im not pz dev, so i cant add support for modding new car models
I think they said they would add support for it in the vanilla branch
Can anyone tell me what are the eaxct meanings for those numbers in Distribution.lua file? Like what does rolls mean? What does those numbers after each item in the tables mean?
rolls is related to how many items can spawn, with some math done considering loot rarity
numbers for each item are a chance of spawning that item
@nimble spoke Can you be a bit more specific? Like those numbers after each item are they multiplied by anything? What chance do they represent? (1 = 1% or 1 = 100%?) Are rolls multiplied by something?
For example if i set loot rarity for "other" loot to "2" (in configs) what number will be multiplied by 2: rolls or chance? Also i've noticed that if i set chance to something like 500 i get more items than in situation when i set chance to 100. Why is that?
Maybe there is some docs out there to which i can refer my issues?
I don't know the exact math, maybe a dev could help you there
take a look at the server/Items/ItemPicker.lua, ItemPicker.rollItem function
@quasi geode Hm, i'm looking at it and the way i see it: "More zombies = more loot" is relevant to cells. Thing is that for some reason "cell" is being defined as (PlayerX/10,PlayerY/10). But if you open an online map and toggle coords display you'd see that every cell contains 300 squares on X and 300 on Y. So "cell" is a square 300x300... And zombie data is being saved in the relevance with those cells. So my point is that when engine is trying to calculate zombie density it takes values like pkayer is somewhere near left edge of a map... Is it intentional?
its not checking the cell, its checking the chunk, theres a difference, but i wont explain that too damn early for me atm lol....but for the original Q, the amount of zombies nearby effects the % chance, lucky/unlucky effects the %, and loot spawn rarity effects %....esentially the number in the distrubution table is a %, but theres a number of modifiers
the multiplier for loot rarity settings are basically: 0.2 extremely rare, 0.6 rare, 1.0 normal, 2.0 common, 4 abundant
Yeah i already figured where i'm mistaken... Anyway 0.5 in distribution.lua mean 0.5% + modifiers(based on zombie pop), right?
more like 0.5% * modifiers
Yeah i forgot about loot rarity modifier... But anyway look at that:
((((itemNumber*100) * lootModifier) + (zombieDensity * 10)))
where itemNumber is from distribution.lua
thing is that it looks like there's a percentage of loot being spawned and then system adds density * 10 to that value which is (density * 0.1%)
right..the zombie density caps at 8, so at most it adds a 0.8% chance
if the distribution table has a number of 1, and loot is abundant, and you got lucky trait, with max zombies in the chunk the math is 1 (dist chance) * 1.1 (lucky) * 4 (abundant) + 0.8 (zombies) = 5.2% assuming your unlucky, and loot is rare, with no zombies is becomes 1 (dist chance) * 0.9 (unlucky) * 0.6 (rare) + 0.0 (zombies) = 0.54
Seems unfair tbh...
Is it supposed to add this zombiepop mult to chance and not to that mult with lootrarity?
I mean this "+" really confuses me... Looks like it's supposed to work like that instead:
((((itemNumber*100) * (lootModifier + zombieDensity * 10)))
no..the loot modifier is what has the biggest effect...adding a additional 0.8 to it would be pretty massive
And rolls are just... What? Amount of items out of the list which has chances of spawning in container? But if every item would fail to spanw then container should be empty?
rolls are the number of times it goes through the list, every item on the list has a chance to spawn for every roll
roll 3 isnt 'spawn 3 itmes', but 'try and spawn each item 3 times'
I see...
Thing is that i'm trying to dig that bug which pervents my mailboxes to be filled with recipe mags in MP (in SP everything works just fine). Maybe you know anything that could help me?
Like, maybe you know if SP uses some other method for filling containers? I just cannot figure that out.
theres no other method, its the same for SP and MP
I thought that SP basicaly creates the closed server and lets one player in, loading all the scripts that regural server normaly would.
that's what i thought...
What about this piece of code btw... I'm not really into lua but i do know some of other OOP-languages but i cannot figure what is this "i" for:
for i, k in ipairs(containerDist.items) do
To get stuff out of lists this method uses k.
including chances and the name
its a really funky loop design tbh
i = index (position in the table) k = key (the actual value)
more then likely anyways
So basicaly there's no use for "i" in that context?
when k is a item name, it puts the name in the itemname variable and skips to the next part (the actual number)
no i isnt actually referenced anywhere
imo they should have just used _ instead of i, since _ is often storage for a junk variable that isnt going to be referenced...but then again i wouldnt have designed the loop that way in the first place
That's what i thought... Well i'll keep digging.
I've been wondering about that with the mailboxes lately. Didn't know anyone noticed a difference between single and multiplayer.
Any ideas where can i find this func?
getWorld():getMetaChunk?
@proud spruce Problem is that mailboxes are the tip of the iceberg. It gets even worse when it comes to bookstores and tool-related spawns: Not a single axe on a whole map. How does that sound for you? Even though empty mailboxes are depressing too, i agree with you.
I've been wondering about a couple things that have seemed more rare than they ought to be. It's possible it's just awful luck, but I've not seen a lug wrench or tire pump yet, and not seen Mechanics Volumes 3 through 5 despite finding 2-3 copies of Vols 1 and 2.
I play with Hydrocraft, though, and I've noticed some stuff from that also feels rarer than when I played, say, a year ago so I'm wondering if the loot spawning logic is just starting to buckle under how many items it has to choose from.
ive still been hunting down corks for the hydrocraft chemistry lab, to no avail
Thinking about it, that's actually why the mailboxes bug me. Their loot table shouldn't be so long as to never spawn magazines, but maybe... I should peer into Hydro a little later and do some napkin math.
doesnt matter how long the loot table is, unless its spawned enough items to fill the container
hmm
Fenris_Wolf - Today at 9:13 AM
roll 3 isnt 'spawn 3 itmes', but 'try and spawn each item 3 times'
the only time it breaks from the loop is when the container gets full
Oh, so it rolls 3 times per item on the loot table to try to spawn it?
basically, it works its way down the table rolling for each item, then goes back to the top and starts again
Okay. I originally misread that message when you first posted it.
I get it now. Which now really concerns/confounds me.
if this is a problem in MP but not SP, then theres 3 likely possibilities: 1) mods interfering with the ItemPicker functions. 2) server config loot rarity settings. 3) desync been client and server, where the server isnt properly informing the client of the container contents....I'm assuming the issue is happening with the IWBUMS branch, since I've noticed no such problems on our 38.30 server
if the first two possible problems have been ruled out, then that leaves #3, which would be a likely canidate since they've been making a effort to optimize the data transmission
but thats just guesswork on my part, since i dont play that branch and only really half pay attention to whats going on with it development-wise
Yeah, I'm gonna be digging around and checking ItemPicker stuff later.
How moddable is PZ? Can you write code and implement complex mods?
Or is it mostly like, item data and graphics and stuff like that?
its entirely moddable
see survivors mod, and vehicles mod, adding new functionality before pz did it 😛
@pine vigil Sorry, but I just can't get the moddata thing to work. How does the game know what it should do with the loaded modData once the square with the item is loaded? I mean how do I tell the game that the modData it just loaded for my cooler item needs to be used for the customTemperature?
@quasi geode
- Using vanilla.
- Copying configs from SP to MP.
- Could be the case, but most likely it's not, because according to EnigmaGrey this issue could be fixed with loot-table altering. I'm still trying to ask him about the cause so i can mod loot-tables accordingly to patch that. (I've tried myself and managed to make everything to appear on client, but still i need to find the exact cause to patch it properly)
And yes, you're absolutely right, you won't see the issue on 38, only IWBUMS is affected. (and maybe vehicle since they have copied vehicle over IWBUMS)
There has been a new Mod Published!
I want to give these grinder some utility in my mod, but they seem to be very rare in the world map, and I'm not exactly sure what they do, do they just mix concrete with water or what?
looks like a concrete mixer ya
usually concrete, water and a filler like gravel or sand
The game calls them grinder, not mixer, so I got a little confused
so maybe they could be a source of mixed concrete? Like you have an empty bucket and you can fill it with concrete
normally you wouldnt do the mixing until your at the work site, since it starts to set once you add the water, and there very little point mixing the gravel/sand in with the croncrete offsite
yeah, but I don't want to go super detailed, I thought I might create another source of concrete beyond simply finding the bags in counters
I like the idea of making more world objects useful somehow
naw...the stuff you find in bags in the actual concrete, you dont get anything from the mixer except preping the bags to actually start pouring it
You're right, I'm brainstorming ideas here, these are very rare anyway, may not be worth giving them a use
If there are any world objects worth using let me know
The brick pallets in that picture may be way more useful, a simple "pick up bricks"
i was thinking of doing a similar sort of mod, bringing use to all the world item stuff...pool tables, pianos arcade machines etc etc
but its pretty low priority for me atm which means i probably wont do it lol
lol, those would be nice, I wanted to make street signs useful, give them street names and things like that
removing water gallons from dispensers and so no
ya lots of options to choose from lol
so much useless stuff that serves no real purpose other then raising ones quality of life
Couldnt they just be big water bottles?
Get a bunch of them stored up just in case.
I searched that map site and found one in westpoint, there may be a few more, but not that many, so I will turn my efforts to something I may actually find in game lol
@nimble spoke is that cement mixer able to be picked up / moved?
if so id love to need one of those in hydrocraft for mixing concrete 😛
as for the water dispensers, i just been carrying them home when i find, unless i have enough empty bottles to fill
I haven't checked their stats, but I think you should be able to pick them up
well, yeah, but you shouldn't need to take the whole dispenser with you
that is what I'll try to change
There has been a new Mod Published!
Turn them into furnaces to destroy trash
does hydrocraft have a github i can submit fixes to?
nope
the couple githubs i see for it look like independants
😦
how should i go about giving fixes then? forum?
or....some people dont want help which is fine too 😛
I think Hydro is decently active on the indie stone forums, but he seems pretty active on Steam. A comment on the workshop page to inquire might work.
^.^
forums is probably the best bet
I had made a mod to tweak a few things in Hydrocraft and he rolled some of my fixes into the mod itself when he spotted it, so he seems at least receptive to feedback.
i mostly just fixing typos atm heh
alot of the crops dont work since he renames items to HC, and forgot HC on some when moving the mod in 😉
That's odd. Never had an issue there.
i never played vanilla, and went crazy tryin to figure why some crops wouldnt plant in plowed ground, always red in the 'pick a seed' menu even when i had seeds
never even thought it was the mod at first XD bad me
@placid delta read the stuff on new super survivors, the whole give items / group etc, suggestion for down the road > loyalty, they might folow you home, act all good, but when you leave em alone, they take yer shiz and run ^.^ and 2nd, they group themselves, and that makes the raiders groups 😛
Heya guys, anyone know if you can download the girl and guy model anywhere? x3
No?
😥
@earnest quartz PM'ing hydromancer on TIS forums should do the trick, it did for me
mod suggestion/request > signs or such for crates to show text on the side of em to label whats in them
is there a way to make a bag give its weight reduction without needing to equip bag to arm/back?
such as hydrocraft dogs, need to equip to hand before the 100% weight reduction bonus is applied, which seems weird, as mr doggy should be walking himself, so i wanna mod it to always apply 😃
Certainly possible. Would need to do some lua though.
@placid delta will your vehicles be updated to the new vehicle system? i miss your fire truck 😄
i miss chopping down trees with the tank...always amazed me how it left planks in its path 😄
plus driving it through houses...screw going through the window LOL
tank was sure nice for crowds XD
i did dislike (but totally understand) it destroyed corpses though
ya i tried not to run the Z's over since they didnt have loot if you did
used corpses to make charcoal, and the clothes for rope heh
i'd hang a gun out the window and shoot 😄
wait til the helicopter event, lure them all with the cars and fire with the shotgun while driving around lol
id just stand by fences with guns and clean up zombies heh
you can shoot while driving? o.O
with the mod you could
mod suggestion (i dont know pz modding enough yet so throwing out idea to not lose it) > another car 'part' a ram, that doesnt spawn on any cars, you gotta craft it first with metalworking, then metalwork+mechanic? or just metalwork to add the part to the cars, not sure how hard it is to add new parts to the system
people comment that ramming stuff even gently hurts vehicle, ram lower chance of damage 😃
There has been a new Mod Published!
anyone know why the Hydrocraft Gather Dung isn't working on my server? I have the Mammal Fieldguide but never get the Gather Dung option
nope, went out to a spot where I could forage, thought that was one of the requirements
@edgy tinsel read the book first to learn the recipe?
that book doesn't teach a recipe, it is marked like any other non-skill book with the boredom, unhappiness, and stress(?) reductions. If I remember right from when I used it before you just right click on the book to use it. I'll do some mod isolation stuff, see if it's one of the other ones not being compatible
@edgy tinsel at some version it changed, need to read the books once to gain the recipe now
no clue your version but ya 😛
tried it, no joy
I've used that very recently so it sounds like something is interfering with it working properly.
Hello guys, wanted to add EnduranceChange attribute to Vitamins, but it doesnt work
item PillsVitamins
{
FatigueChange = -2,
EnduranceChange = +20,
Weight = 0.2,
UseDelta = 0.1,
Type = Drainable,
UseWhileEquipped = FALSE,
DisplayName = Vitamins,
Icon = Vitamins,
Tooltip = Tooltip_Vitamins,
}
it doesnt work inside module base, or with adding to another module
can someone help?
Tryed to change type to food, than it shows endurance bonus with mouse over, but don't give it on use
Can anyone tell me if it is possible in theory to attach some methods to player login/disconnect on server? Like, on disconnect: Spawn corpse with it's name and fill it with player inventory, remove everything from player inventory, store some variable which holds ingame time of player logoff. On login: Spawn player on coordinates of said container, transfer items from container to player inventory, reduce player tiredness according to time passed from his disconnect. If container coords are null (someone has burnt the body) then spawn player with 0 HP effectively killing him.
I don't want to go into java code since that would make impossible to release a code as a mod which could be installed on server, so i'm asking if it is possible to do on lua? (Or in java, since my server is running custom additions on java-side)
Some possible events that may work for those purposes are OnCreateLivingCharacter and OnCreatePlayer, though I don't recall precise events on connection and disconnection.
I'm not sure how the persistence would be managed as you'd have to store some sort of table of player names, logout times, and specific corpse IDs, at the very least.
The main problem, based on my (admittedly limited) knowledge, however, is I don't think you can interact with or access a player's inventory once they're offline and I don't think you can hook in to the event of them leaving and remove items before they've already disconnected on their end. I think the event fires on the server on them disconnecting, not on them beginning to.
To say nothing of problems that might occur when it happens due to a crash or connection drop.
@quasi geode any idea what causes this
whats the actual exception message getting thrown there?
1526914157049 function: checkLoaded -- file: ISORGMReloadManager.lua line # 140 java.lang.RuntimeException: attempted index: preFireShot of non-table: null
was that it? lol
if so, it seems to get triggered when you break a reloading timed action by firing a shot, i'm not entirely sure why its throwing those, since self.reloadable shouldnt be null since the if statement that code exists in has already checked it by calling some of its methods (ie: isLoaded)
either way its harmless, doesnt interfere with the shot being fired or cause any additional side effects..which is why it got left in the last update but its something i still need to investigate further
actually, i bet its that ISTimedActionQueue.clear(character) clearing the magazine from the ReloadManager thus setting it to null..at any rate as i said its harmless and i'll patch it next update
@pine vigil Renewing my request to fix this small issue. I can walk through furnace tiles, but the drum right next to it is ok.
are there any mods that add entirely new furniture / placable objects? not as items you lay on ground
I've seen at least one being discussed here, it was a table for making bullets
I'd like to work on it, but I don't have many ideas for furniture
Well, actually I just had an idea, labelled crates. Let's say you pick one of those posters with an orange on it, then you can craft a box and use that to label it
I don't know how to add the label later
but adding a specific crate option isn't hard
🤔
@earnest quartz Just in case you asked because of my picture, those are not items on the ground
@nimble spoke i would like labeled crates 😄 pref with text on side so can click>change anytime
So, when there's a tile construction_01_05 for example (empty pallet) how sohlud I retrieve 'construction_01_05' if I want to check for it? I thought it was getSprite():getName() but that doesn't seem to be working
is it just getSprite()?
Silly me, getSprite():getName() is exactly what I needed, but the result is construction_01_4 and not _01_04
There has been a new Mod Published!
Calling for help with moveable properties, it seems I should be able to change them with setProperties() but I don't know how
@nimble spoke should work something like this: ```local isospritelua = yourmoveable:getSprite();
local props = isospritelua:getProperties();
props:Set(IsoFlagType.bed);
isospritelua:setProperties(props)```
the available flags are collideW(0), collideN(1), solidfloor(2), noStart(3), windowW(4), windowN(5), hidewalls(6), exterior(7), NoWallLighting(8), doorW(9), doorN(10), transparentW(11), transparentN(12), WallOverlay(13), FloorOverlay(14), vegitation(15), burning(16), burntOut(17), unflamable(18), cutW(19), cutN(20), tableN(21), tableNW(22), tableW(23), tableSW(24), tableS(25), tableSE(26), tableE(27), tableNE(28), halfheight(29), HasRainSplashes(30), HasRaindrop(31), solid(32), trans(33), pushable(34), solidtrans(35), invisible(36), floorS(37), floorE(38), shelfS(39), shelfE(40), alwaysDraw(41), ontable(42), sledgesmash(43), climbSheetW(44), climbSheetN(45), climbSheetTopN(46), climbSheetTopW(47), attachtostairs(48), sheetCurtains(49), waterPiped(50), HoppableN(51), HoppableW(52), bed(53), blueprint(54), canPathW(55), canPathN(56), blocksight(57), climbSheetE(58), climbSheetS(59), climbSheetTopE(60), climbSheetTopS(61), makeWindowInvincible(62), water(63), canBeCut(64), canBeRemoved(65), taintedWater(66), smoke(67), attachedN(68), attachedS(69), attachedE(70), attachedW(71), attachedFloor(72), attachedSurface(73), attachedCeiling(74), attachedNW(75), ForceAmbient(76), WallSE(77), WindowN(78), WindowW(79), FloorHeightOneThird(80), FloorHeightTwoThirds(81), MAX(82);
hope this works, haven't tested this and it's a bit pseudo-codish
I'm still struggeling with my cooling box, anyone knows something about linking items to lua code?
have asked here too: https://theindiestone.com/forums/index.php?/topic/23824-linking-item-to-lua-code/
Sorry, didn't come up with a better name for the topic.
I'm currently struggling with the linkage of items and lua code altering them. I try to give a...
not sure what you mean by that, the mod data is stored in a kahlua table in the java...saved when the object is saved, loaded when the game loads the object instance..this kahlua table is what you get when you do a item:getModData()
How does this all work and when exactly does the shotgun instance reload the stored info from moddata? so its loaded automatically when the object instance is loaded
yep, but how is this done for example with the shotgun, it seems like the game is constructing a lua object for each shotgun item discovered by the player
well not so much a lua object, but yes every object has a mod data table attached
there is ISShotgunWeapon:new() in ISShotgunWeapon.lua, but it seems like it's nowhere called
ooo...thats for a reloadable object, thats slightly different
thats not 'directly' the same as the mod data
though the mod data and reloadable objects data are synced alot
yep, have seen the sync-parts, but not where the actual lua object is created with this new function
1 sec i'll have to dig it up...but that whole ISShotgunWeapon style object isnt going to be relivent to your cooler issue at all
why not? Right now I don't find a proper way to apply my modData values and upon reloading the modData reapplying the cooling effect
farming uses the event ``LoadGridsquare`, which seems appropriate for that, but not really for my item issue
as i said, the whole bit there is strictly for handling reloadable objects....more specifically, its so you can call things like reloadable:fireShot(), reloadable:isLoaded(), reloadable:canReload() etc...things that require custom code for different types of reloadables, without actually having to do a big if...elseif.. statement checking what type of reloadable it is, and without having to constantly work with the mod data directly
but, to answer the question, ISShotgunWeapon:new() would be called from ISReloadUtil:getReloadableForPlayer()
the whole reloadable classes like ISShotgunWeapon are entirely temporary and disposable objects
@river plinth Interesting, thank you. But those seem to be the boolean properties, I wonder how it works for weight as an example
if i recall right it only uses a single ISShotgunWeapon per player, not per shotgun
hm, than I don't understand the real purpos of modData
mod data is just a custom storage table thats saved/reloaded automatically...its up to you to actually do stuff with the data in there
there is only one event, onLoadModDataFromServer, but if there is really no other way to do stuff again with it without resorting to LoadGridsquare and cycling through every object
setProperties(propertycontainer, properties) that is what I've found for it
I know that I'm supposed to do something with it, but there aren't any real hooks to do something with it
well no...you'd have to use LoadGridSquare to actually check to see when the items are getting loaded back into the world
the lazy way would still be: cycle through every object that I got after LoadGridsquare triggered and apply the modData accordingly, but is this really supposed to be done this way?
seems kinda performance-heavy and if more stuff is doing this than performance will definately tank or is my assumption wrong?
well pretty much, theres no other way to do it, if there was a hook for triggering a event every time a item itself is loaded, that would be alot worse performance wise
You might want to take a look at the farming system
strong example of mod data there
ie: on our map theres probably about 10,000+ spent ammo cases lying around westpoint on the ground....if those tried to check the mod data automatically or had some event attached every time the items get loaded, it would be pure hell
in case you need to update an item, or several items constantly, consider the possibility of just doing it when necessary (when a player picks it up for example), and then do the math to get the desired result
no need to update each cooling box all the time, save in the mod data when it was last updated, then do the math with current time to decide what needs to change
crops do that to determine their state, and for example if the vegetables are fresh or rotten
safe to assume modData == MetaData ?
cooling box? like put food + ice, acts like a fridge?
@earnest quartz yep
the only real option is to use that LoadGridSquare, and try and write your code as efficiently as possible to minimize any performance cost
which reminds me...i need to run some benchmarks on kahlua efficiency vs real lua efficiency....ideal lua coding style maybe less then ideal for kahlua
@river plinth where did you find that list of flags? I need the other properties that aren't flags
found that in the class IsoFlagType.class
I'm stuck, it doesn't seem to be doing anything
even if I change the sprite from A to B, when I check for sprite B it doesn't recognize the ones that were changed to B, only B that were already in the map
still, A is not a moveable, B is, but when I change any into the other, the result is not moveable
so something is happening beyond a visual change
A can block movement, B can't, any change and the result will not block movement
There has been a new Mod Published!
I think I should simply destroy it and create what I want in place, but I don't know how to do that either
how can I inform a specific tile type? I found AddTileObject for IsoGridSquare
@placid delta setTexture is throwing an error when I use it in a recipe. Do you know anything about it? I'll check what exactly the error is in a minute
it isn't even a lua error. at se.krka.kahlua.integration.expose.MethodArguments.assertValid(MethodArguments.java:123)
wrong arguments getting past to the function