Comments (16)
(You could save the content somewhere else in game with luacontroller.)
from digilines.
@DS-Minetest That would be a horrible hack. BTW, according to #34 that’s unreliable now.
from digilines.
Related: #49.
@Hawk777 what do you think on this?
from digilines.
Personally, I guess I see there being three options:
- Only report the complete contents of the chest when asked, plus maybe a message saying it changed.
- Only report puts and takes, requiring someone else to accumulate the contents if they care (not possible right now but possible once #49 is merged since then the data will be reliable).
- Do both.
Between 1 and 2, I prefer 2. The reason is that some consumers will care about contents and others will care about changes. If you only have 1, calculating 2 from it is quite annoying, because you have to iterate the contents, establish a way of comparing two stacks for equality, and then generate all the changes from it. Calculating 1 from 2, on the other hand, is easy: it’s basically just accumulating puts and takes by count. So it’s easier for people who care about contents to calculate it from changes, than for people who care about changes to calculate it from contents.
I also think that sending the entire contents of the chest could turn into a really big message, especially if some items have nontrivial metadata attached. I’m also mildly opposed to building equipment that does more than it needs to to get the job done, so on both of those points, I prefer 2 over 3, but not too strongly.
I’m not sure why you think remembering the contents is a huge hack? It seems pretty sensible to me.
from digilines.
I really think the API should change to only report ACTUAL puts/takes (the current API is very confusing, and easily overheats a Luacontroller) AND respond with a simple table format to a request ("GET" perhaps?) for total contents.
from digilines.
I really think the API should change to only report ACTUAL puts/takes
This should now already be the case. Update your digilines to the newest version (not the one from contentdb, it's a year old).
(the current API is very confusing, and easily overheats a Luacontroller)
Use a luacontroller code, that does not send a digiline signal every event. This should avoid the overheating, probably.
Also try print(event)
.
from digilines.
from digilines.
The speed of multiple events being sent from the digilines chest to the luacontroller is what is causing the issue.
I see. Either there are ridiculously many interactions with the chest in a short time or the server has changed a overheating setting.
If that is already the case, why is this issue still open?
It's still not possible to request the contents of a digiline_chest.
I do not know what version the server I am playing on is using but I will recommend they update.
Existing builds with digiline chests might (= will probably for sure) break.
from digilines.
This should now already be the case. Update your digilines to the newest version (not the one from contentdb, it's a year old).
I have checked and they are already up to date with the latest version.
Current behavior:
On taking a stack with more than one item, two messages come through, one with the correct number of items removed, and one with 1 item removed. On taking a stack with only one item, a message comes through without a number, and then another with 1 item removed.
Also takes are reported from moving stacks around in the chest.. I would at least understand if puts were also reported, but they aren't. These are at least reported differently enough from the true takes that I haven't had an issue with accurate tracking of the chest itself.
from digilines.
I have checked and they are already up to date with the latest version.
Digilines in minetest-mods: https://github.com/minetest-mods/digilines dates: 20 Oct 2017
We are on the "latest" state rofl
The newest commits are from march 6th (see https://github.com/minetest-mods/digilines/commits/master).
from digilines.
I have Minetest 0.4.17.1 and Digilines 434010b. I put this code on a Luacontroller:
print("=====")
function dump(x)
if type(x) == "table" then
print("{")
for k,v in pairs(x) do
print(k .. ": ")
dump(v)
end
print("}")
else
print(x)
end
end
dump(event)
When I take part of a stack (more than one, but less than all of them), I get this in the console:
"====="
"{"
"type: "
"digiline"
"channel: "
""
"msg: "
"{"
"stack: "
"{"
"meta: "
"{"
"}"
"metadata: "
""
"count: "
50
"name: "
"digilines:chest"
"wear: "
0
"}"
"action: "
"utake"
"from_slot: "
1
"}"
"}"
2019-05-16 22:30:31: ACTION[Server]: singleplayer takes stuff from chest at (-31,20,78)
When I take the rest, I get this:
"====="
"{"
"type: "
"digiline"
"channel: "
""
"msg: "
"{"
"stack: "
"{"
"meta: "
"{"
"}"
"metadata: "
""
"count: "
49
"name: "
"digilines:chest"
"wear: "
0
"}"
"action: "
"utake"
"from_slot: "
1
"}"
"}"
"====="
"{"
"type: "
"digiline"
"channel: "
""
"msg: "
"{"
"action: "
"empty"
"}"
"}"
2019-05-16 22:30:39: ACTION[Server]: singleplayer takes stuff from chest at (-31,20,78)
Looks like exactly what’s expected: only one utake
, followed by an empty
if that’s the case.
from digilines.
The newest commits are from march 6th (see https://github.com/minetest-mods/digilines/commits/master).
@DS-Minetest To be honest, I'm not sure why it's shown this way on GitHub, but the latest commit referenced there and here is the one from 2017 ..and is also dated March 6, 2019.
Edit: I'm guessing the original commit was created in 2017 but not pulled until 2019.
from digilines.
434010b has this metadata:
Author: Christopher Head
AuthorDate: Fri Oct 20 00:24:32 2017 -0700
Commit: Auke Kok
CommitDate: Tue Mar 5 22:04:56 2019 -0800
so I guess Github is showing commit date, and @TangentFoxy is looking at author date instead.
from digilines.
To be clear: @TangentFoxy are you seeing something other than what I posted above, using the same commit (434010b)?
from digilines.
GitHub shows commit date in one place, and author date in another.
from digilines.
Back to topic, though, my real question was: @TangentFoxy, you said “On taking a stack with more than one item, two messages come through, one with the correct number of items removed, and one with 1 item removed. On taking a stack with only one item, a message comes through without a number, and then another with 1 item removed.” Do you see this unexpected behaviour with 434010b? Can you help us reproduce this behaviour? Can you perhaps run my sample code I posted in a comment above and explain what actions to take in the chest, what output it produces, and why that output is wrong?
from digilines.
Related Issues (20)
- lcd: letters are a bit far away
- LCD: Make the text left-aligned HOT 4
- Add protected digiline_chest
- The display produces lots of warning messages like HOT 10
- minetest.setting_* functions are deprecated HOT 1
- LCD appears broken HOT 4
- LCD Z-fighting HOT 9
- LCD text is not visible from distance
- Vertical digilines HOT 2
- Add Support for Tubelib and/or Terumet to the Digilines Chest HOT 1
- LCD line length limits are not enforced properly HOT 2
- LCD lines and character limits HOT 4
- Clear screen HOT 1
- German "Umlaute" are ignored when cut and paste text in a Microcontroller editor HOT 2
- Documentation is missing HOT 2
- Get contents of a digiline chest? HOT 1
- Digiline distributor not working in the game
- moves stuff in chest at
- *hard* depends on default or mcl, not optionally HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from digilines.