#mod_development
1 messages · Page 391 of 1
It is processed by the server?
I think so, yes
Ok. Thanks man.
Yeah zombies were made serverside in Build 33 or 34 I think
Any ideas for buildings
a big hostel
abandoned military base
^^
@cursive roost You don't happen to know if ammunition in PZ is handled as "drainable" from memory?
What's up with PlaySound no longer looping? I took a peek at SoundManager's class file, and it seems that all of the PlaySoundWav functions are now just a single-line that returns null, PlaySound just calls emitter() and only passes the name arg to it so the loop setting nor any of the other args will matter, PlayWorldSound works fine but as it's a world sound it only creates the sound at the square and radiates outwards, and I haven't been able to get PlayWorldSoundWav to work at all
It's kind of odd that looping support was dropped, and PlaySoundWav was completely depreciated. I'd assume the new FMOD system from build 33 (or was it 34? can't remember) might be responsible for this? It'd explain why PlaySoundWav was depreciated, perhaps FMOD doesn't support it, and it'd also explain why PlayWorldSoundWav won't work at all for me (maybe it was meant to be removed but somebody forgot to)
The emitter system seems to be screwed, too. I tried this: local emitter_ = getWorld():getFreeEmitter(); emitter_:PlaySoundLooped("saber_idle_2")
every function in BaseSoundEmitter, which it seems that most of the audio-related class files use, returns an error as it was trying access it like a table. I did a quick check using type() and it's userdata, so I tried using getObjects() and that errored out too.
to use looped sound i do them directly with fmod studio
because fmod studio rocks anything anyway.
sure you're sound is in a bank, etc?
it's a normal .ogg file
just curious, what were the reasons for the depreciation of PlaySoundWav?
someone please tell me how to load a gun with LUA
"Load" as in "fill with bullets"?
yes yes
the result of pressing r with ammo in game while holding the gun
like getPlayer():getPrimaryHandWeapon():setProjectileCount(15)
getProjectileCount exists but setProjectileCount does not
some people sayingyou just set moddata.roundChambered = 15 or something but that doesnt work
player:getPrimaryHandItem():LoadGun() I want to give the gun ammo, whether its reloading the gun from ammo in inventory or just setting the curr...
local primaryHandItemData = getPlayer():getPrimaryHandItem():getModData();
primaryHandItemData.currentCapacity = primaryHandItemData.maxCapacity
try that, @placid delta
not working for me. they really use moddata to keep track of shots?
I think so, yeah
this only seems to work for the Local player. Im trying to give loaded guns to other Players I spawned.
well w/e i just made it so it loads the gun in local players hand then pass it into the clones hand afterwards
How do i edit a soundbank?
Maybe this helps
Hello I Have from one game sound system constructed with fev & fsb file. I wanted change some s
Open FMOD Designer 2010.
Open the .fdp file used to create the .fev and .fsb.
Navigate to the Sound Defs view.
In each sound def, replace the audio files with the new audio files.
Navigate to the Banks view.
Ensure that each audio file is in the correct bank.
Build the project.
Replace the .fev and .fsb files in your game with the newly built ones.
Wether the fdp file is available is a different question
Soo how do you edit these??
never heard about .bank files
wait ... that is a FMOD soundbank file!?
hm
I found this on Darkest Dungeon ...
The .BANK files are information packets used by FMOD audio software and are accessed by the game engine they were created for.
Therefore you cant open up and modify any of the .BANK files without accessing the original project pack in FMOD.
Guess we'll have to ask @inland gull
I kinda disliked FMOD when it was introduced because it rendered my costum music packs unusable
same
I want to edit the bank files to make my custom music packs useable
again
fmod sux
Hmmm...haven't messed with fmod in some time, but I thought .bank files were for FMOD Studio & .fsb/.fev for were FMOD Designer...
You can still use .ogg files with PZ despite the change to fmod. at least, ORGM's working fine with them.
How do i then.. modify the music files ogg?
They don't want to play.
I changed them
but the originals play
only
@drifting ore Tells us NAO!
Not sure if the music files bheave differently, but we're stil using the OGG files that were included with ORGM for gun sounds.
You can see it in Red-Pak; it had to be updated to fix a few issues with sound not being heard from far away, though. Credit goes to @silent mural
problem with playsound is that it only takes in the name arg, all others passed to it aren't used
so looping is therefore broken since it straight up won't include it when creating a new emitter
Makes sense, Double. One for @inland gull Then. 😦
ok im testing that discord for the 1st time
I need to fire a function when a player kills a Zed
Events.OnZombieDead seems only to work in SP, not in MP
Am I using it wrong? Tried my code in client, shared and server but with no result
I think someone else asked the same question a few days (weeks?) ago Dr.Cox
Wish Discord had a search function 😦
@river plinth Check Oct 4th
I think RJ replied afterwards
ah, found it here
didn´t thought about looking through the posts here, only searched the forum
seems like it does work when processed clientside
so I think it has something to do with my player determination
hm, looks like I´m still to dumb to use it
CoxisShop.Init = function ()
if isCoopHost() then
print("...CoxisShop...INIT COOP HOST")
Events.OnZombieDead.Add(CoxisShop.onZombieDead);
print("...CoxisShop...INIT COOP HOST DONE")
end
end
CoxisShop.onZombieDead = function()
print("Here in onZombieDead")
end
As far as I know, zombies die on the esrver not the client, so for it to work, the server would have to send a message to the client. Not sure how you'd capture it.
what @drifting ore said @river plinth
OnZombieDead runs serverside
also... define the function BEFORE adding it to the event queue
in your code you add a pointer to nil to the Event
@cursive roost I´m currently testing it with hosting through the game, so just to get things straight: my code is in lua/server (of course in it´s seperate mod folder), to check if it´s hosted local I need isCoopHost(), so my only error is defining the added function after I added?
Ah ... wasn't that the weirdness with javascript-like function syntax?
but then again if init is called the variable shouldn't be nil anymore regardless of how you defined the function!? @cursive roost
I just woke up so maybe it's just a brain fart on my end.
sorry guys, I´m still to dumb to figure this out
my current code (rewritten all and done only the necessities I think):
damn you^^
:D:D
CoxisShopServer = {};
CoxisShopServer.afterZombieDead = function()
print("Here in onZombieDead")
end
CoxisShopServer.InitServer = function()
if (isServer() or isCoopHost()) then
print("...CoxisShop...INIT SERVER")
Events.OnZombieDead.Add(CoxisShopServer.afterZombieDead);
print("...CoxisShop...INIT SERVER DONE")
end
end
Events.OnServerStarted.Add(CoxisShopServer.InitServer)
Events.OnGameStart.Add(CoxisShopServer.InitServer)
cool stuff boy
strange thing: when hosting through the game the OnServerStarted events never execute, that´s why I need to use OnGameStart I guess?
Are you sure you have the correct event? I'm totally out of the loop with the latest events so I can't help you with that 😦
OnGameStart get´s at least executed
didn´t find any other event in the sourcecode with jd-gui
that would fit better
So you get the debug output with OnGameStart, but not with OnServerStart?
oh, and the lua is in C:\Users\Dr_Cox1911\Zomboid\mods\CoxisShop\media\lua\server
yep, debug output with OnGameStart but not with OnServerStarted
Have you tried with something simple (without if conditions)?
Events.OnServerStarted.Add(function() print('foo') end)
honestly didn´t test it with a normal dedicated server, wanted to get it to run with coophost first
hm maybe that's your problem? maybe the event isn't fired for coop?
just tried your line of code, doesn´t get fired in coop
you mean the OnZombieDead event doesn´t get fired in coop?
I mean the OnServerStarted
OnServerStarted definately doesn´t get fired in coop, that´s why I use OnGameStarted, which does get fired
I always thought coop was completely separated from the whole MP / Server stuff
works like a charm on dedicated server, don´t know what´s up with coophost though
bug? is this used in another mod successfully?
Coop isn't a "real" server
seems to be some kind of in-the-middle thingie, the onZombieDead isn´t fired on the "server" nor the client
Coop has always been strange in terms of implementation.
I'm not on linux right now, so can't grep through the source :/
When will we be able to create "Custom Moodles"
You already are able to create them yourself.
I need your help again guys, I´ve got a listbox and need to run a function when an item is selected. To do that I thought I could use the "onmousedown" and passing my function to it. This kinda works, but in the said function I loose the "self"-reference and therefore don´t have any access to the elements inside the class
anyone ever worked with a listbox and know how to maintain the "self"?
depends
show me your function real quick?
Lua has the self:foo( a, b, c ) syntax which is the same as foo( self, a, b, c )
so depending on your function you simply could pass the self "manually" as the first parameter of your function 🙂
Ah I just looked at your post on the forums. You don't have any controll over how onmousedown is called, right? If you want to, PM me your code and I'll try to figure it out when I get back home.
thanks for the offer @vernal jackal , but right now the mod isn´t very comfortable to use 😳
if you really want I can send you the mod, but as of right now it´s a pretty mess and needs a dedicated server to work (haven´t unbundled the settings-loading from the server yet, so that the client can work on it´s own)
right now, I don't think you can
last time I looked into it, the answer was:
"It's still a Java relic from the old days. Rework with mod support will come some day, though."
so right now, you can't do it from Lua
you can simulate one, maybe, but there's no easy way right now.
@next narwhal Modify the java source.
or that
what mod did you check?
do you get any errors or just not spawning the stuff?
hm, never used it without a function calling it, do you find the file being loaded in the console.txt?
not looking up this
now looking throw
wait pls
are u about console which opening with starting game?
yep, you can check that in C:\Users\YOURUSERNAME\Zomboid\console.txt
maybe it get´s loaded to soon and can´t add the items because of that
do you mind uploading it?
console?
yep, console.txt
your mod was active? Honestly I don´t know when the game loads the distribution if it´s not within a function
suburbs distribution is a bit weird
as expected, the game doesn´t load your distribution at all
try the function thing and it will work
Suburbs distribution file is from 0.2.0q versions btw.
Older versions
They dont work in new versions.
you aren´t supposed to modify the actual file
instead add items to the table and the game will distribute them
@river plinth "instead add items to the table" how?
just as you are doing (the table.insert does the thing)
"try the function thing and it will work" I do not understand
the code I posted back in the #pz_b42_chat
second screenshot should work, don´t forget to save though
if it doesn´t work, than I fear I can´t help you ☹
:с
@river plinth Do you know where the onmousedown callback is called?
@vernal jackal If i`m understand you rightly you mean the following code
function ISScrollingListBox:onMouseDown(x, y)
if #self.items == 0 then return end
local row = self:rowAt(x, y)
if row > #self.items then
row = #self.items;
end
if row < 1 then
row = 1;
end
-- RJ: If you select the same item it unselect it
--if self.selected == y then
--if self.selected == y then
--self.selected = -1;
--return;
--end
self.selected = row;
if self.onmousedown then
self.onmousedown(self.target, self.items[self.selected].item);
end
end
Yes
already thought about just redefining this code-section, but don´t know if it would be the way to go?
Ok I see the problem. The onmousedown callback has a predefined list of variables so we can't fix it there... in your case I don't understand what _onmousedown is because from the code above it looks like it should be an item.
function ISCoxisShopWeaponUpWindow:checkPrice(_target, _onmousedown)
local splitstring = luautils.split(_target, "|");
print(splitstring[2]);
print(tostring(self.char:getModData().playerMoney));
end
Where is self.char stored in?
in ISCoxisShopWeaponUpWindow
I think I should elaborate a bit more, with the "self" in this function I planned on accessing my instance of ISCoxisShopWeaponUpWindow, which holds the char that has opened the window
You can`t help me? :с
@river plinth Ok in this case you could try using IsCoxiShopWeaponUpWindow directly?
@vernal jackal You simply mean this: ```LUA
print(tostring(ISCoxisShopWeaponUpWindow.char:getModData().playerMoney));
but than it´s calling char which is nil (because it´s not defined for this instance)
hmmmmmm
Ah yes ... I forgot how the PZ OOP works 😛
You are probably right about changing the listbox.
if self.onmousedown then
self.onmousedown(self.target, self.items[self.selected].item, self);
end
or
if self.onmousedown then
self.onmousedown( ... );
end
@river plinth Can't think of a much better solution :/
currently trying it, somehow the split throws now an error (worked like the last 100 tries but just now, it doesn´t)
anyway, to late for me to get on a bughunt, thanks rm-code
will work on it tomorrow and update the thread if it works
No problem
(I like to assert parameters during bug hunting ... helps a lot)
assert( type( foo ) == 'string', string.format( 'Expected a string. Received %s', type( foo )));
Discord really needs scrollable script panels 😛
since robo isn´t here I hope you @cursive roost can help me out
maybe
I´m using sendClientCommand with the OnGameStart event, only problem: the game doesn´t seem to be ready to receive anything from the server just yet (registered my function to receive the command with "Events.OnServerCommand.Add(CoxisShop.ReceiveServerCommand);"
I´ve looked through the sourcecode and think I found the culprit within "IngameState.class", it sleeps for 10 seconds before it updates the GameClient state (indicated with "Waiting for player-connect response from server" in the console)
why do you need to do that on game start?
what else event could I use?
what do you want to do?
again looked through the source but nothing seems to be triggered after the state change
what I want to achieve: after a player logs in it tells the server with sendClientCommand, the server then sends the client some settings
are those settings necessary at that point?
the sending and recieving works fine (tested it with a button that fires the communication)
how about "OnConnected"?
I want to pretty much only transmit the data once, hence why the initial connecting seems the way to go
OnConnected fires way before during the loading process, seems that the client is only able to receive servercommands once the 10 second sleep mentioned above is done
here is the bit of the java class: ```JAVA
System.gc();
LuaEventManager.triggerEvent("OnGameStart");
LuaEventManager.triggerEvent("OnLoad");
if (GameClient.bClient)
{
GameClient.instance.sendPlayerConnect(IsoPlayer.instance);
DebugLog.log("Waiting for player-connect response from server");
while (IsoPlayer.instance.OnlineID == -1)
{
try
{
Thread.sleep(10L);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
GameClient.instance.update();
}
LightingThread.instance.GameLoadingUpdate();
}
}
OnGameStart, add a function to EveryTenMinutes, then remove the function on first firing
I can remove events?
I believe so, yes.
Otherwise
just create an array where you store who you sent data to
iterate that EveryTenMinutes
it shouldn't be that resource heav
y
hm, haven´t thought about the array thing, will try how it works out
didn´t find a way to remove events though (at least not in LuaEventManager)
thanks!
It works just like adding a function
Events.OnGameStart.Add(foobar)
Events.OnGameStart.Remove(foobar)
zombie/Lua/Event.java
ah, thanks again! Was looking in the wrong thing than (addEvent is in LuaEvenManager, that´s why I thought remove would be in there as well)
addEvent creates an entirely new event
it doesn't add functions to existing triggers
hm, I should have looked at the function I guess 😊
I am here now, but I don't have any clue about what you just asked 😛
lol
@bold drum sorry, forgot to add a link in the first post
did you gave it a test yet?
Yes, the work is good.
So far, the only problem is menu overflow.
I use the Chinese language, English is not the problem.
And if I write a nonexistent item in CoxisShopSettings.ini, I get an exception.
-----------------------------------------
STACK TRACE
-----------------------------------------
function: create -- file: ISCoxisShopPanel.lua line # 65
function: initialise -- file: ISCoxisShopPanel.lua line # 33
function: createChildren -- file: ISCoxisShop.lua line # 86
function: instantiate -- file: ISUIElement.lua line # 580
function: addToUIManager -- file: ISUIElement.lua line # 883
function: showUpgradeScreen -- file: CoxisShop.lua line # 55
function: onKeyPressed -- file: CoxisShop.lua line # 94
java.lang.RuntimeException: attempted index: getDisplayName of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1549)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:623)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1727)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1672)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:53)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:81)
at zombie.Lua.Event.trigger(Event.java:37)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:83)
at zombie.input.GameKeyboard.update(GameKeyboard.java:48)
at zombie.GameWindow.logic(GameWindow.java:574)
at zombie.GameWindow.run(GameWindow.java:1238)
at zombie.GameWindow.maina(GameWindow.java:1018)
at zombie.gameStates.MainScreenState.main(MainScreenState.java:177)
-----------------------------------------
STACK TRACE
-----------------------------------------
thanks for reporting! What item did you add? As of right now, I don´t check if the item is legit (I don´t have a strategy on how to do so yet)
hm, strange with the language, the buttons at the top worked fine for me when selecting german
could you send me the chinese translation?
@river plinth Are you measuring the string length?
Could be a problem with the font returning wrong width values?
nope, guess i need to do that
tested long strings, I guess normal font returns the correct width
thanks @bold drum , don´t have the time to look at it today, will try this length thing the next couple of days
Look forward to the new version.
Translation file has been requests to merge into your Github Dev branch.
@river plinth You should add CoxisUtil as a Mod dependence on the Workshop
@cursive roost thanks the tip! Thought that the "require" in the modinfo does that automaticly
guess I was wrong
it'll automatically actiate the dep in PZ
but steam couldn't possibly know about that
thought that uploading through the game would parse this info to steam
no, sadly not
@river plinth Any player on the server to kill the zombie will trigger AfterZombieDead function?
This will lead to all online players get the money.
@river plinth Also, make the key configurable
o is already occupied for me :/
see https://github.com/blind-coder/pz-hotbar/blob/master/media/lua/client/hotbar_keybinds.lua for an example
@river plinth I made a small utility script for custom keybindings https://github.com/rm-code/pz-keyinjector
or what blindcoder did 😄
thanks @bold drum for the report, will get on it, will include the key configurator, but all of this will have to wait unfortunately, no time for coding today 😢
@river plinth You're welcome 😄
@cursive roost thanks! one thing that I can remove from the todo-list
@cursive roost I hate the windows github client 😡
merged into the wrong branch and now it want´s to push my dev into your dev branch instead the other way around 😫
back to console I guess, that at least doesn´t screw up without me telling it to 😂
I used source tree for quite a long time.
it has a nice vizualisation of the git tree
maybe you can undo your merge and cherry pick the correct commit?
(no idea how it works with merge since I usually rebase for a fast-forward merge)
eww
never do fast forward!
you can't easily unmerge
git merge --no-ff <branch>
but I prefer a clean history 😛
Can some explain to me how to ge the worchench in hydrocraft. Is there a bookni gotta read first. Cant seem to find jack nm on the webs
@river plinth I suppose you didn't really want to push into my repo, so I'm closing the PR?
@cursive roost yep, close it please
oops
@river plinth bug: no money when killing zombies by pressing space 😦
was in wrong channel 😄
are you sure that the rng didn´t strike you?
oh, you don't get money for every kill?
nope, you can set it in the settings ini
ah, okay
I'll keep teh window open and check
okay, I just got some for a space kill
I´ve rewritten the MP part of the mod to get rid of the "all players earn money"-part but need to wait for an answer of TurboTuTone regarding LuaNet on Steam before putting it out there
LuaNet?
Turbo has written an awesome mod called LuaNet back when ApCom was still a thing
a framework to allow enhanced message stuff in PZ
like package to a specific player from player or server alike
oooh, nice
I just realized where your name comes from Turbo. At least I think I do. lol I miss that show.
@river plinth you pushed a PR again?
@cursive roost nope (?)
yes, the CN update got pushed to my PR again
maybe I didn't close the PR correctly...
PUSH ALL THE UPDATES
okay, it was still open
and since you opened the PR from :dev and pushed to it, it got added to the PR
doesn't @river plinth have to remove the remote from his local repo?
that´s the only comment I merged (directly on github, not through gitshell/windows prog)
atleast github states that it only pushed it to coxisshop:dev
ok strange
Sorry to be that guy, but i've been looking around and i just can't find any map editing tools for the life of me. Where do i get them?
steam://install/380880
@timid kite don´t know if this would work: upon right clicking check if the square has the piano (could work with instanceof, don´t know though) and then add a option to the context menu to play the piano
How add the option to context menu?
there was a mod for pianos to play, maybe you can find some of the piano code in there 😃
Can you send it to me, I cant find it, sorry
Hey Folks,just like the title says... Playable Piano v1.0This mod allows to play the pianos that sometimes can be found in houses. It's pretty much my first...
but seems like he deleted it from the workshop, cause it wasnt working with the new sounds
still, here it is https://mega.nz/#!epZiRCQJ!AwdVjWVq53e8SrD8WkfxAp_PdhpOEq_w1a7LBuJjNlg
MEGA provides free cloud storage with convenient and powerful always-on privacy. Claim your free 50GB now!
thx
@bold drum Sorry for the late response, but i click the link and nothing happens except that i'm brought to the steam store front page
@woven basin check on your steam tools, there it is the project zomboid modding tools with all you need
@vestal crypt I only have the PZ dedicated server there, odd.
well, is another tool just like that one, check on the tools list to see if its unistalled, the link @bold drum gave you, was a steam link to install it from it
It's not there for some reason
I tried restarting Steam but it's still not there, and the link won't work still.
not sure, but maybe it has something to do with the iwbums version?
I can use the link and I am not in iwbums
I am not in IWBUMS but it still wont work.
well, then it is kinda strange not appearing for mega
discord app or browser page?
discord app.
Uh
try to copy the link and paste it on the browser, im on browser discord and works fine like that
In what browser? Steam browser?
i use chrome

Mega doesn't even have an option in the tools section of steam
copy and paste doesnt work for me, but when i click it, it trys to open steam to download it
dont know why is nt in there tho
Same thing for me Eudoxio, but it doesn't seem mega has access to the tools
and the exact same thing happens when you try to install something you don't own: You get redirected to the store page
The thing is i own the game, that's why this all confuses me.
Should owning the game not automatically give me the permissions for the tools?
Yeah, that's the weird thing
short question
I can check if an IsoObject is a wall by checking object:getSprite():getProperties():Is(IsoFlagType.cutN) or cutW
anyone knows if there's something similiar for floor tiles?
there is IsoFlagType.floorS and floorE but it's not used anywhere AFAICT
to answer my own question, IsoGridSquare:getFloor() is what I need
I still can't install the map editor
have you tried downloading it from the forums?
@vernal jackal I have not, could you link me to it? I can't seem to find it.
The zombie-respawning stuff in Build 32 requires a new set of data files for maps. These files are named chunkdata_X_Y.bin, there is one of these files for...
@woven basin use this steam://install/380880
that doesnt work for him., for any strange reason, he dont have access to the modding tools
hmmm, i have access...why?
not sure, that is really his problem, that the tools doesnt show on the steam tools library
Is there a possiblity that someone could send their folder/files to me instead? I've tried everything and it just won't show up in my steam tools library
So is there any good tutorial you guys could reccomend?
For.. What?
Oh right, modding. 😄
Honestly I just started with something simple like Professions.
youtube tutorials?
Text or youtube, doesn't matter.
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
Thanks
Welcome to Thuztors Mapping Guide Version 0.2.With this document I'm trying to teach you in using the Mapping Tools.New in this version: - new BuildingEd tu...
Thuztor made a pretty good guide for it, also along that post you can find some useful comments 😃
Could it be that the modding tools are bound to the actual PZ-branch?
Which branches are you on @scenic sigil / @woven basin ?
Stable
Hello, I'd like to get started modding, but I can't seem to even load the mods in single player. Am I supposed to do that with a host instead?
where do you put your mods?
in c:\users\me\Zomboid\mods\
(I'd be happy to read a guide, but all I can find is a guide about the code itself, not how to get started)
yep
And I can play multiplayer with those mods
or "host" with the mods
but when i click "solo" and start a game, I don't get a choice to pick which mods to activate in "custom sandbox"
I'm an idiot, I had to double-click to activate it.
Is there a way to reload a mod while in-game (and edit it in-game?) or do I have to leave the game and restart every time?
not in-game, you have to go out to the main menu, activate the mod and then load the game
you can activate games mid-game, but you need to save, go to main menu, activate them, and load your game again
there's an "experimental" file reload system
does it actually work?
also, how can I add stuff to the "watch" window in the debugger?
and how can I exit the debugger when there's an error (pressing F11 again doesn't seem to do much)
I've never used the debugger, to my shame :/
Well, maybe Will knows 😉
Because one of my mods causes an exception when loading, and I can't get past it (F11 doesn't work)
(it's not technically my mod)
Well, to answer my own question in case someone was curious, you can reload your own source code from within the game by clicking the button
Probably more FAO @rose leaf I don't think my admin access lets me do much on the spam filter, or if it does I'm not sure how to acess/deal with the problem. Think this has come up before though.
kewl, just wanted to flag it 😃
@novel seal @pine vigil I've replied http://steamcommunity.com/app/108600/discussions/1/208684375427870278/#c152390014783785247
tl;dr, Word blacklist is there because spammers are crafty buggers, and they're winning the war
Hey Devs, how well does the new anim system tie into modding?
Like are outfits/new guns + Models pretty easy to add? Etc.
Hello, anyone having any issue following the workshop update of "allmapshere" mod? it seems to have lost its directory structure
@drifting ore "Pretty easy" is relative, but I'd say yes ^^
I'm pretty sure the devs know how much this would benefit the game and the modding community.
@timid kite I'd recommend variants before full-on fresh models. You can take something that exists, say the 'Varmint Rifle' and build a new item from it, using the same model. Like a Daisy BB Gun, with damage so low killing a zombie is pretty much only on crit, and aim that drops off drastically out past 30 feet, but near silent operation and a ~200 BB "clip" that reloads pretty quick.
Anyone wanna point me in the right direction on where to look to see how the triggerables are implemented? Want to modify some of the bombs and make some new ones... Most importantly make remotes re-namable.
Cant seem to find anything in the .lua files
(Also brand new to modding PZ.)
Also are the javadocs even up to date? Found the Remote... item type is Normal, but dont see it in the enum list, same with Key.
Must be something other than a folder in Contents/Mods
@long ridge Items are scripted with a custom syntax. Not sure which folder they are located in nowadays, but it's a plain .txt file IIRC
I found the text file yesterday @vernal jackal , but doesn't seem like anything I can actually edit functionality wise. I can change blast radius, remote range, etc, but doesn't seem to be hookable into the plus side of things which kind of sucks.... Unless I am still looking in the wrong place.
Essentially it seems like "X key adds Y functionality" rather than using an event like the trap being triggered
aye
if you want custom behavior you probably need to work with the java side
(a yes ... your other question: I think the javadocs haven't been updated in ages)
but I'd suggest trying to do it via Lua first
for custom events you could ping @inland gull and hope that he doesn't hunt you down with a baguette
Oh, he loves those baguettes.
Is there a copy of the source somewhere or am I going to have to decompile the .class files?
At work so I don't have the files on hand
Either way, two things on my agenda: making zombies give feedback over radio, and having a motion sensor "trap" to send out messages to a radio
I love how zombies can heat me yelling over the radio, but sadly it doesn't work the other way around... Need some sort of baby monitor to let me know if zombies are creeping up in my base
So I was thinking I could also incorporate that by allowing traps to send messages to a frequency... Like "Alert: hallway" or Alert: alley" to a master radio that I can be at
Or hell... Why stop at zombies.... Could work for players too who are breaking into your base
You'll have to decompile it yourself.
I like the radio idea.
Might be doable in Lua though ... I haven't touched the PZ code in a long time so don't take my word for granted ^^
Just thought of throwing out a mod idea if anyone needs one. Perhaps double pressing W makes it autowalk or autorun. Because the map is so huge
oh god that's kinda sad to me
the mod community feels like we really need to add a "auto move" function for a more comfortable walk to the next town. Because vehicles aren't in yet
not saying it's a bad idea
...
"it's not a bad idea but I'm gonna shit on it anyway and imply that you are too lazy or pampered"
Lol
@drifting ore sounds like a good idea
@inland gull / @novel seal would either of you fine gentlemen point me in the right direction on how to add an event for triggerables (namely "OnTriggeredItem") and call it via the LuaEventManager? I have registered and added the event, and I see how you guys are triggering it with the static method, but I cannot seem to find the logic on when the Trap gets activated via timer, remote, motion sensor, etc.
looked through almost all of the Zombie.Iso package but havent found anything relavant
Additionally, triggerEvent's variable names seem to have been lost with the decompiler, so I just have a string for the event, and 6 objects. If you could tell me what those objects are, thatd be great.
IsoObject.DoChecksumCheck() -> checksum = getMD5Checksum("D:/Dropbox/Zomboid/zombie/build/classes/" + str);
lolwat!?
sorry, I'm the writer I'm afraid and ill-equipped to answer
RJ probably won't pick up as it's the weekend
Oh sorry @novel seal! It said you were in the Dev group
hopefully someone like @cursive roost or @vernal jackal would be clever enough? if they're around?
yeah I'm a Dev, but kinda in the 'stupid people' department of Dev 😄
Lol no worries. In the meantime just gonna be poking around a bit more
@long ridge I think the events are all hardcoded on the java side as well IIRC.
They are... im editing them 😄
Ok then what is the question? ^^
Im trying to find where the traps are triggered. Like when you throw a flame bomb, and it explodes
I want to send off a new event that i have just added to do a lua pcall.
Or more clearer, use the LuaEventManager to trigger the event
I suppose I could try and find the triggering mechanic for the remote (which i cant seem to find either) but that would only fire off the event in the case that this is a triggerable trap
Phew ... I remember that some event triggers are located in the lua source but no idea in which classes.
Just do a search in all files for it ^^
why?
And I looked at the already existing events and nothing related to traps
Correct. But this event is custom and therefore is not exposed to any Lua end. Additionally, there is no handling in these explosions via the lua side at all. It all seems to be done in Java
so using triggerEvent as a keyword in the java side would be pointless
so you need to add a custom event you trigger when something happens on the java side
Yes. That part is done. I need to use LuaEventManager.triggerEvent within the java classes when the trap goes off. That is the part I am looking for
?
So I have registered the event, just need to figure out where the logic is to fire it off
I dont see one. Lemme look again
...... im a fucking idiot. I skimmed right over it
goddamnit.
I was looking in inventory... Seems its in Objects.
Guess that makes sense.
yeah because the traps you place in the world aren't inventoryItems, but WorldObjects (or whatever they are called in the PZ's source ^^)
I never worked too much with InventoryWorldObjects, that's @cursive roost's speciality
Hey guys! Can you tell me is it possible to add custom Moodles by mod?
yes, but only if you modify the java source, which would mean de- and recompiling the code
everything is moddable that way ^^
But I will be able to replace that file from steam workshop mod?
nope, you can´t ship mods that change the java source with workshop mods
sad then
None of my mods are on Workshop
it's not really an issue if you can live with the fact that less poeple will play your mod
oh wait I lie ... @river plinth uploaded some of them IIRC
😄
Devs should share such things to lua actually )
I see where you are coming from, but they can't port the whole engine to Lua.
But as far as I know moodles might be refactored out eventually.
@long ridge you still need help?
Sorry was on the Vive.
im good man. Found what i needed...
My own stupidity. Completely skipped the IsoTrap class
great that you found it 😄
does mods usually work on save games? can't find any info on that.
I think they do but items that are from the mod will not magically appear in it
though dont take my word for granted
It depends how the mod works. If it relies on the item spawning system, those items will only appear in unexplored areas of the map..
If it's a map mod, those cells the map overwrites will need to be deleted or a new game started.
If it just alters the logic of the game, then the mods will work fine, whether it's a save or a new world.
thank you
Eh eh eh ^^
How soon moodles might be cut out?
I would say "later" rather than "sooner"
What will instead of it?
well, animations and voip is currently using up all the ressources, as well as the whole factions thing
with those things, I believe TIS is booked solid
I think the current main focus here are the animations, and I think they are working on it to make the new system modable if I'm not mistaking
when 3d first person zomboid m8s 😉
lmao
wow Snakemans map mod project looks AMAZING
it does
if there'd be some kind of "triangulate position" option so that for a few moments you'd see where you are
AND it were possible to use the games mapdata, so it'd work dynamically for all maps
it'd be a dream come true 😄
Can you give me a link to it ? Is it workshop ? Sounds interesting ^^
it's a WIP; scroll down here https://theindiestone.com/forums/index.php?/topic/21633-pz-cartographer-aka-cartozed/ 😃
PZ Cartographer - aka CartoZed Pz Cartographer is a little tool that can draw 2d topdown images from lotheader/lotpack data. It should work for ...
Wow. 😮
my thought exactly 😃
I did a mod that required you to "draw" a map by running around with pieces of paper and a pen/pencil
but the modData became way to big to be usable
Hey, guys.
How can I send custom getModData data to the server?
I try self.item:transmitModData() don't work for me. (self.item is InventoryItem)
What shall I do?
there shouldn't be any need for that
that should really be done automatically
self.item:getModData()["key"] = "value";
that should be all you need to do
self.item:getModData()["Name"] = getPlayer():getName();
This value will not work?
that should be fine
and after a reload the data isn't there?
though I would strongly suggest using something like
self.item:getModData()["MyModID"]["Name"]
to avoid namespaces conflicts
The same item, but another player to get a different value, I do not understand why.
getPlayer() always gives the currently playing charactel
so getPlayer() on my system returns my character, on yours it'll return your character
so obviously getPlayer():getName() will be different
I check getModData == nil
if self.item:getModData()["AnyValue"] == nil then --Avoid overwriting existing data.
self.item:getModData()["AnyValue"] = getPlayer():getName();
end
It should not overwrite the existing getModData.
hmm
weird
huh
transmitModData only does something if the item is on the ground...
or rather, when this.square is set
and InventoryItem doesn't have a transmitModData function at all
yeah, moddata on those is automatically handled... or rather, should be
can you upload the whole file on a pastebin service?
Problem seems to be solved.
I don't even know what happened.
local tb = getPlayer():getInventory():FindAndReturn("Axe")
--tb:getModData()["test"] = getOnlineUsername();
print (tb:getModData()["test"])
Between the two players, I got the right Axe["test"] value.
so i am new to modding this game - how is the state of modding and IWBUMS? do they work generally or is are they made for stable?
personally, I'd not release a mod for iwbums only
but I think it's possible to do so
mods for stable GENERALLY work for iwbums, though
I don't think there's code incompatibilities
thank you 😃
anyone know how to get the required material to make a mod for this game?
What do you mean by "required material"?
like code
If you just want to add or modify some items you'll need to look at the item scripts... can't remember what the files are called, but they have a simple .txt ending.
You can find the .lua sources in some subfolder of the "zombie" folder (can't look up the exact path since I'm not on my gaming pc). The Lua scripts aren't compiled so they are the first thing you want to look at. They also give you a lot of options already.
If you want to do some some elaborate stuff you'll have to decompile the java sources, but that's ... a whole different topic ^^
setX(float) and setY(float) why don't move the player?
local pl = getPlayer()
pl:setX(10613)
pl:setY(9650)
The screen is just black loading map, nothing happened. what did I miss?
you can't move the player to a location that is not streamed into the game
ie not too far off the visible screen
Thanks bc. but "CheatMenu" MOD seems to be able to teleport the player to any location on the map.
It uses other methods?
no idea, never used it
I just remember that setX / setY limitation from way-back-when
Problem solved. thanks.
local pl = getPlayer();
pl:setX(10630);
pl:setY(9313);
pl:setZ(0);
pl:setLx(pl:getX());
pl:setLy(pl:getY());
pl:setLz(pl:getZ());
seL... gotta look that up 😃
I found it in Javadoc, interesting.
You also have to set the collision of the player to move them more than 1 tile at a time, hence the setl* functions, whatever the he hell L is . . .
I believe..
Hi
I try get worldModData by
worldModData=getWorld():getModData()
But here i have error:
Object tried to call nil in ...
IsoWorld is IsoObject child and have mod data. What can be wrong?
hmm, usually, gametime is used for such
why do you want to attach moddata to world?
For save some data on server
also, IsoWorld is NOT an IsoObject
gametime is, though, so you should really use that
getGameTime()
What BC said. IsoWorld has no ModData function.
well, gametime is not an isoObject either, but it has the modData API
Quietly edits to trip up BlidncodeR
I want save modData in server world save
I see how that work whith player^modData
But it local save
WordData - server save
You can't. You'd need to use GameTime.
gametime is also serverside
what are you trying to do? once you get into megabyte sized moddata, the game starts to lag a lot...
I try save player descriptions
its string table 100-300 lines
for local player works fine
Other path getFileReader and getFileWriter dont work...
should be fnie, though
Somthing wrong betwen client and server...
I suggest
local gameTime = getGameTime();
local modData = gameTime:getModData();
modData["<yourmodid>"]["<playerID>"]["data"] = "<whatever>";
that's the modData you should use
replace <yourmodid> with the ID of your mod to avoid namespace conflicts
Thanks
you're welcome 😃
Is there any kind of way to increase the rarity of loot even more than extremetly Rare? Because I find everything I need in order to survive just in few days! I want to keep the zombie population in normal, but make loot even more harder to find :D yes im insane
Is there any kind of way to make that happen with mods or some stuff, thing, kinda? :o
ahh te car drivng mod is so great, its gonna be awesome when its fully finished
yo anyone who does 3d models. there is no export as .txt in blender. so how to i export to pz format?
did you figure it out @placid delta ? last i remember you had to use custom export? see: https://github.com/JabJabJab/BlenderZomboidIO
yes but 19 out of the 20 times i have exported a model and texture, it crashes a few seconds after equipping the weapon with said model. and no logged errors to work with.
Lol that looks bloody cheap
the coding etc looks great hopefully someone can come and help out with some good looking models for all perspectives
well done Nolan :)
even if i can find a way to hide his head and legs it would look a lot better
dont you think it would be easier to focus on the easy (?) stuff first? like just adding a bicycle?
That's actually harder than a car. Though I already made the support for a vehicle thy doesn't use gas,
Tried yesterday to load a bike model but it wasnt working. Will probably try again but there will not be a peddling animation
ahhh alright
did hydrocraft got updated?
How do I make the game spawn items from my mod naturally so I don't have to implement an item spawn script with my mod.
Depends on the spawning you want. If you want to spawn them like other items just add them to the default tables.
you need to add a lua file with something like this
local function initDistribution()
local insert = table.insert;
-- All your item stuff here
insert(SuburbsDistributions["all"]["wardrobe"].items, "Module.Item");
insert(SuburbsDistributions["all"]["wardrobe"].items, 1);
insert(SuburbsDistributions["all"]["sidetable"].items, "Module.DifferentItem");
insert(SuburbsDistributions["all"]["sidetable"].items, 1);
end
Events.OnGameBoot.Add(initDistribution);
@amber island I suggest looking at some of the already released item mods like OGRM
Don't use oRGM as example they have their own unique item spawn stem via lua
ah then don't do that
@vernal jackal thanks I'll look at another mod
Personally I think the car mod looks great for a mod,perhaps if the dev team one day implements it...It will blend more with the whole code and thus be easier to do and improve
I tested this mod the other day and thought "it's a really cool one", but after a while a few things bothered me like the Tank and the overall graphics of the vehicles... These are real big immersion breakers for me :/ But that guy pulled out some great work indeed
ha ha! NIGHT OF THE AXE ZEDS ATTACK
If we could just harness them to chop trees for us, we'd be rich.
woodcutters union i see
That looks amazing
Nice! I'm curious, any interest in making hostile survivors?
@placid delta any plan on open sourcing it as well? I would love to contribute.
there are hostile survivors already
there are some stories people posted about thier interactions with hostile survivors some are quite funny
no problem with people helping with the mod. I warn you its a bit messy though.
Thanks for the link, I have not tested this just yet but been watching the videos so I thought they were all just friendly.
Ill download the mod now and play some in the afternoon.
Do you have the source on github?
What makes me so curious is it says that it only works with single player, I was wondering what is the hurdle to make it work with MP?
no, ive never put anything on github before
i imagine there are a number of hurdles. first major one is that the survivors are IsoPlayer class instances
not IsoSurvivor instances
which are meant to be, well just players. local to the persons client
Gotcha, again, I have not attempted to mod zomboid at all, but does it expose any TCP/UDP layer to mods?
no everything client side
There appears to be a number of network functionality:
zombie.core.raknet.UdpEngine
zombie.core.network
zombie.network
zombie.core.raknet.UdpConnection
a lot of stuff you will see there will only be accessable or useable via java
hmm.. Nolan I think you have inspired me to look into PZ modding a bit
How do I add the folder to make them weapons?
Like I downloaded the folder that makes the survivors independent and hostile. But I don't know how to make it work. They still follow me like zombies
How do I make the file work?
By the way Ik talking about Survivor Mod
Thanks
I did all that but it stop has copying survivors
The survivors still have no weapons and follow me every move
what build you running?
The newest build 35.26 @placid delta
actually if your build dont match patch the result will be recipies broken, but since you say they still mirror your movement it means you did not copy it correctly
it asked you if you want to replace /save over the files 3 times like in video?
I copied over the three files. Should I download and do it again?
did it ask you if you want to copy / replace like in the video?
if it didnt you werent pasting the right thing in the right place
it will ask you if you want to replace 3 files
I just rejoined beta and downloaded beta link and it said replace three and it copied all 6
it should be the zombie.zip not zombie2.zip
Okay let me fix this then
Okay I have 32.26 and I made sure I have the Zombie.zip objects scrips in the zombies file. Ik about to start my game in a moment
@placid delta still don't work
watch thevideo again. and pay close attention to exactly what i copy to where
Okay but my screen copies like differently than yours does
It doesn't use the extra steps when I copy a file to the original. It says it has the same name as existing files and would you like to overwrite ten and when I do it says copying 6 things to zombie file
doesnt sound right, should only be 3 files not 6
@placid delta when I try to move replace it says copy instead of move
@placid delta so I studied the video and did exactly everything up to the common part. There is no common after I hit steam
zombie/scripting/objects/*take all files from here in the download
open and paste into the same spot in zombie from your install zombie/scriping/objects/
I'm pretty sure I just did that now I'm testing the game again
@placid delta ugh forget it. It don't work I'll just wait till they actually add them or something
Does anyone have experience with the blends system?
A preview of the map I am working on
sweet
@cursive atlas Looks damn nice! I haven´t got a clue though about what you´r asking
Yes. I've no idea what a blend even is.
Can I drink it?
Nice map
blender* ??
I mean alter the blends.txt and rules.txt to allow more colors to be used in bmp to tmx
Bah, I cannot get photoshop to preserve transparency when I copy things...
After far to many false starts, I have rendered grand traverse peninsula into manageable regions of RGBA with A being infrared.
Now I am bringing out each channel in a separate layer so I can figure out the best way to get usefull data : RGB Infrared, Hue, Saturation
It seems to me that the hue channel is best for viewing differences
I don't know what are you talking about, but it sounds like fun 🙃
@placid delta Do you know if Survivor mod works with local co-op?
I have heard it "works" but has some issues such as screen will split in 4 even with 2 players
Hey, for build 36.1 i've added a way to override base recipe and even making them obsolete 😃
will that be done in lua or in the scripts txt files? can u give an example.
No, I just try to use it.
anyone know how to add a wooden box to a worldcoordinate that´s currently not loaded?
I'm betting that might be impossible.
Save the coordiantes where you want the wooden box, add it on the LoadGridSquare event?
seems like LoadGridSquare is gone, every occurence in any of the shipped Lua files is commented and I´m getting an error when trying to add an event to it
that was my first approach
I actually have no idea what the events "ReuseGridsquare", "LoadGridsquare", "OnIsoThumpableLoad" and "OnIsoThumpableSave" do
Well that's odd. They're all commented out.
Interesting.
@inland gull What'd you do? What'd you do!
Oh, I think EasyPickins mentioend something about ReuseGirdSquare a long time ago. Hmm.
http://projectzomboid.com/blog/2013/07/its-been-a-tough-old-week/ Blast from the past.
But not helpful, really.
nevermind, revalidated my files and now I can add an Event to LoadGridquare
and it is still executed
sorry, should have done that first before asking here 😊
Yeah, but now I want to know what everything's using instead of LoadGridSquare!
so do I, it was my go-to event for this kind of thing
and I use it in two mods, including spraypaint
it works fine now though, never thought it would be that easy to add an object to a tile
I think I finally get used to the way PZ is handling all this Lua stuff
far away from a real modder though
still with LoadGridsquare and then created a IsoThumpable with the according special attributes like isContainer
I was previously really scared lookint at the objects tut from TurboTuTone
@inland gull now that you are online, quick question: what do I need to pass to PlayWorldSound as the parameter "name"?
I´ve tried a bunch of different combinitations, but nothing works
my file is in "Testmod/media/sound/breakdoor.ogg"
so I tried getSoundManager():PlayWorldSound('media/sound/breakdoor.ogg', ...)
getSoundManager():PlayWorldSound('breakdoor.ogg', ...)
and getSoundManager():PlayWorldSound('breakdoor', ...)
local sound = getSoundManager():PlayWorldSound("thumpsqueak", _square, 0.2, 20, 1.0, 6, true);
addSound(_character, _character:getX(), _character:getY(), _character:getZ(), 10, 5);
what´s the addSound for?
it actually play the sound.. not even sur the playworldsound is still used 😄
ah no sry
the addSound is just to attract the zombies
ah, perfect, I need that to
So many peepholes.
would anyone be interested in a migrating horde mod?
i was thinking, i can make a fake matrix of the map as an array. plot x number of "hordes" randomly into the array matrix. then after each 10 minutes event, move said hordes in random directions (in the array matrix) then, after each move. check if the horde has entered the players loaded cell. if it has, spawn the horde, and set each spawned zombie with a direction the horde was last moving.
hmm, doesn't the game have "virtual" hordes anyway?
i was thinking more of a "walking dead" farm invasion type of horde
like hordes in the 100s or 1000s
personally, I wouldn't play with that, I suck enough on "Survival" as it is
but it sounds cool
need to make sure players aren't hit by it too often
if its made like i describe. i think most the time, the hordes would pass by you
unless you make noise at the wrong time
but ya i would want it to be a fairly rare kind of event
that would be cool
anynoe else having issues with IsoGridSquare:playSound("foo", true);?
yep, doens´t play the sound for me, only if the player is present on that tile
Not seeing that used.
Line 16: self.sawSound = self.character:getEmitter():playSound("PZ_Saw", true);
And . . .
self.sound = getSoundManager():PlayWorldSound("shoveling", self.gridSquare, 0, 10, 1, true);
The second one, i take it, is what you want.
I tried the PlayWorldSound one as well, but again, it seems like it only works if the player is on the square aswell
PlayWorldSound is old and maybe obsolete / broken nowadays?
I used it in my lockpicking mod back in the day.
@drifting ore Any info on wether IsoWorldObjects have an emitter too?
New mod: Obey gravity, it's the law! https://theindiestone.com/forums/index.php?/topic/21837-obey-gravity-its-the-law/
This is a mod adding a hotbar for quick item access to the bottom of the HUD. This mod lets structures come crashing down when their support str...
(it makes building crash down)
@cursive roost did you find a way to play the sound on the square?
no 😦
but I also didn't want to spend another night on it
I could just play it on the players square, but that'd be cheating
@cursive roost cheating is half of what codings about 😉
@cursive roost did you mean " This is a mod adding a hotbar for quick item access to the bottom of the HUD. " at the top of your post as well?
of course not, thanks for the notice
I just copied that other post over to have something to start from
is there a list of all the Events? the list on PZ mods site seems outdated.
nope
you can find all the events in one of the java classes though
LuaHookManager or something like that
The class LuaEventManager has all the events
@river plinth to the rescue!
How feasable would it be to have a container like shelves detect the catagory of items put in it and have different sprites based upon that?
just uploaded a version of Gravity that fixes building floor tiles on the ground floor.
👍
@devs I'm curently working on the wooden dowels mod right now and I'm trying to create walls with custom items but it seems that it uses MultiStageBuilding.getStages() to get what walls to do. My problem is that MultiStageBuilding is a class... 😥
So I won't be able to add custom stages / create my own since it's on the java side right ?
Ohhhh, I loved Wooden Dowels Mod!
A new update is going to be up any time soon, the core mod has been updated and I'm taking time to polish everithing right now
unfortunately, you won't be able to create full walls but only frames because I could not manage to access the "stages" code that define the requirements to build on a frame sorry 😕

+
=😀
@winged lotus Hrrrm, that would be bad... maybe you can recreate that part in media/lua/server/BuildingObjects somehow?
I remember walls being plain IsoWorldObjects, but maybe no longer...
ah, no, ISWoodenWall
I'm gonna have to update the CrafTec mod, too, possibly on the weekend, maybe we can share some overlap then and see ow it went
MUAHAHA, go me 😄
returning unconditional "true" in a canBuild function I overrode instead of calling the original function 😄
okay, fixing that needs to wait until I'm back home
Oh I didn't knew Craftec, just saw a video that's a really good idea 😃
@cursive roost From what I saw, to build a wooden wall, the game now check if you are right clicking on a woden wall frame and then iterate on a "stages" object from MultiStageBuilding.getStages() which returns all the stages of wall (from the crapy level 1 to the perfect level 5), then the lua code take care of what to show (if the player has enough items or not for instance). So the requirements like "what item is needed" and "what carpentry level is required" now come from this java class if I'm not mistaking, making it harder to overide when using it 😕
It also feels like building the wall on a frame seems to ignore the items on the floor and only use items from inventory, but I'm not 100% sure about it, it was late back when I tested it.
@winged lotus thanks 😃
I'll check that when I get back home, but that'll be 7 hours from now, idling on the MUC airport right now
@winged lotus even easier!
check media/scripting/multistagebuild.txt
you can use recipes for that
so ideally you would just need to extend on that
Wow how could I miss that 😮
I grep'ed too but only in media/lua ah ah there is my mistake ^^
I only found the .class file that way
anyway thanks a lot for the help on this one 😃
you're welcome! 😃
Now I have to decide if I want dowels walls to be "upgradable" or not, it would be cool but clearly unrealistic to try to upgrade a wall made with dowels you would just end up cracking your planks and detroy the whole structure or at least make it more fragile... Hum... Hum...
Depends, if you want the dowels to be simple replacements for nails, I'd say let them be upgradable
otherwise, skip the woden frame stage and make the wall directly, but allow them to be barricaded and fortified with metalworking.
Hum, yes that's interesting yes, also, a wooden wall frame made with dowels to support a nail-made-wall seems also relevant to me...
I should also add SkillRequired:Woodwork=3 & CraftingSound:PZ_Saw to the crafting dowel recipe !
And maybe make it exclusive to the carpenter job & handy trait and creating a magasine to learn it(and manage it's distribution), ha ha, well I have a lot of things to now to make the mod better 😄
personally, I'd use one or the other, either limit to job/trait or to a magazine
having no personal experience with dowels, I didn't find it hard to learn about them and I'd certainly try making them. Maybe limit learning it to people without the all-thumbs trait
But the ingeneer recipes to make bombs for instance are learnable both way isn't it ?
"limit learning it to people without the all-thumbs trait" ah ah, that would be a good thing yeah 😄
I mostly play single player, and while I rarely have trouble finding enough nails, I really dislike the limited-to-job mechanic.
but that's just me 😃
Oh by the way, do you have any experience in adding new graphics files to the game ? I would like to change some of the crafted look to show diferently the things made with dowels instead of using the base game models. Any leads ?
yes
you can just chuck them into media/textures/ as .png files
so say you have a media/textures/wooden_dowel.png file
then in an items.txt file you'd use Icon = wooden_dowel.png
and within lua you'd use
media/textures/wooden_dowel.png
please DO be careful with UPPER/lowercase, though, or it'll break on non-windows systems
Aaalllright ! It's just like icons
I thought because I want to do it for in game spites like walls and stairs, it would be diferent 😅
And I note that, only lowercase in image names then (I'll be easier this way) !
ah, for buildings you meant
gimme a sec, let me check how I did that
okay, full path for the sprite and you're set
./server/BuildingObjects/ISSimpleStill.lua: o.sprites.westSprite = "media/textures/destill1a_east-west.png";
./server/BuildingObjects/ISSimpleStill.lua: o.sprites.northSprite = "media/textures/destill1a_south-north.png";
./server/BuildingObjects/ISSimpleStill.lua: o.sprites.southSprite = "media/textures/destill1a_north-south.png";
./server/BuildingObjects/ISSimpleStill.lua: o.sprites.eastSprite = "media/textures/destill1a_west-east.png";
that's how I did it back then
brb, gotta switch places at the airport
Okay thank's a lot ! BTW how do you make code quotation on discord ?
using two or three `
to start and end it, respective
two backticks will look like this
while three will look like this
Perfect thanks 👌
Awwn so close...! 🙁 So I managed to add a custom "stage" to build a wall, that's working perfectly 😃 But during my tests I came across an other bug !
If the furniture I build gets destroyed by a zombie / tool : it drops correct items (dowels / planks / others... ) but when I use the new "dismantle" feature on it : it gives back nails...! So I'll have to correct this now 😆
So I made some research and I found that the context menu of disassembly :
ISWorldMenuElements.ContextDisassemble
Has a function self.disassemble( _data, _v ) that is calling ISMoveablesAction:new( ... , "scrap" )
Which triggers the scrap function from moveProps : moveProps:scrapObject( self.character )
This leads me to think that the code stating that scraping an item gives nails is somewhere within moveProps and this one being initialized by ISMoveableSpriteProps.fromObject( object );
So this track eventually led me to find the function scrapObject that define the materials obtained with scrapDef using material from the sprite:getProperties(); so here is my guess :
The items scraped are taken from the sprite of the object no question asked if it's a player made item or an item from map generation, instead of using the items that was used to build it like when it's destroyed (in case of player made items) am i right ?
Well guys I'm completely stucked, I'm open to any leads : what would you do if you had to change the new dismantle system to make it loot the true items used to make the furniture when it's a player made furniture (the same way the destroying system works) ?
I may have an idea but it would require functions that I'm not sure it exists :
Is there a function of a moveProps or object able to say if the furniture has been crafted by the player ?
Is there a function of a moveProps or object able to return the materials used to make it (the same way the destruction works) ?
Take a look in ISContextDiassemble.lua and start at line 34. But I'm just totally guessing that that's relevant, so.
local moveProps = ISMoveableSpriteProps.fromObject( object ); seems to include possible materials.
Yes I saw that one indeed : it is creating a ISMoveableSpriteProps using the object to create the materials. So it should be returning the right items, but in game when I break the furniture with an axe, I get back my custem items used to make it. But when I dissmantle it, I get planks and nails (what I think is material2 & material3 from the dismantle function).
It feels like this ISMoveableSpriteProps.fromObject( object ) doesn't return the right materials when it's working with player made furnitures 😦
Huh, I'm surprised destroying it with an axe gives the right items then.
ISMoveableSpriteProps determines what an item should return based on its spritename, so that might explain the disccrepency. Not sure how moddable it is then.
Excactly, I came up with the same conclusion on the spritename ! Spendt this whole morning thinking about a way to make it moddable but I'm kinda losing hope right now...
I think maybe I should create my own dismantle function that uses the same system as the "item is destroyed" to produce correct scrap for player made furniture.
But this would require two things that I can't figure out :
- A way to know if the
ISMoveableSpritePropsis a furniture made by the player - Figure out where & how the "destroyed item system" works (because I can't find where it happens and what function it uses to get the right materials).
Probably will have to modify SMoveablesAction so you can do what you want.
Just need to figure out what your item identifies as and, on compleition of the actoin, return the correct items instead of let TIS's code do it for you.
Not ideal.
At least assuming this is the action used for diassembly -- it does mention scraping, but maybe that's on a failed move (item breaks).
Oh, fun fact, I just re-activated the old "dismantle" system :
-- dismantle stuff
-- TODO: RJ: removed it for now need to see exactly how it works as now we have a proper right click to dismantle items...
if getSpecificPlayer(player):getInventory():contains("Saw") and getSpecificPlayer(player):getInventory():contains("Screwdriver") then
if test then return ISWorldObjectContextMenu.setTest() end
context:addOption("Old dismantle system", worldobjects, ISBuildMenu.onDismantle, getSpecificPlayer(player));
end
And it drops the right items, to ones used to make the furniture, just like when it's broken, so there is maybe a lead here on how to fix the new system, I'll get into it.
I run across some funny comments sometimes 😄
-- No sledgehammering the daffodils.
Hey, I have an other question, how do I check if an object has a "metod" before using it in lua ? I checked online but only find ways to check if a function is nil but can't manage to do this with methods 😦
@winged lotus if it's a lua function, you can do ``` if obj.function then
obj:function(123);
end
I don't think it works this way for java, though
Yep, but it'a a Method, so this method doesn't works
java method you mean?
All happy Java functions exist on joyous Lua tables, so it should work.
You'll have to treat the package name as a table though.
Actaully, I might be wrong on that. Might only be able to test if it's nil.
Here is my problem, player made objects have the object:isDismantable() but the not made by player doesn't, so I want to check if the method exist before using it (because it throws error if I dont)