Open Discord-Github-Bridge opened 10 months ago
engineersmith_4628 on Discord says
What are we animating? We're animating
create:contraption
s by setting their nbt to a certain premade-structures
How are is the nbt data for the structures created? Right now they're hard coded. Could we put these into a file and read them. (Has to be a json; or we add a read function to ptdye-plus)
What is animated currently? What does it do?
Right now; the only thing it really does is handle the "opening" sequence of the trading platform. Which requires it increasing by Y amount every tick until it reaches the desired height where it is then made solid from the create:contraption
What is needed?
We need a way to smi-quickly define structures and their animations and be able to call them through lets say a minecraft command.
Basically we need three main things
How bad is generating json from nbt or vice versa?
If we can hold the structure data in an object at runtime that will be the best
engineersmith_4628 on Discord says
Well we can just have a single string field
Well but I want to manipulate it
So that's not that good
I think making nbt from json could work, kjs has some helper functions that we can highjack
But making json from nbt...
Which we need if we want to build something and use it instead json define each block
engineersmith_4628 on Discord says
So define each block as an json object?
[
{ "blocka": "dirt", "nbt":"{\t"I_am\":\"dirt\"}" },
{ "blocka": "container", "nbt":"{\"insertdata\":\"${here}\"}"
]
engineersmith_4628 on Discord says
I think the biggest issue is creating these structures in a readable-or even an editable format
engineersmith_4628 on Discord says
Since; in nbt world the position is a hash of the 3 axises
engineersmith_4628 on Discord says
Oh; there's
NBT.toJson()
function in kjs globals. No idea what it actually does
engineersmith_4628 on Discord says
But there's no
fromJson
function
engineersmith_4628 on Discord says
Ah; there's
fromTag
which has an edge case for the json format
engineersmith_4628 on Discord says
Update time (mostly for self-reflection) I found how to find glue. Which doesn't sound exciting... BUT with this new found power instead of making nbts with limited knowledge. You can make a build; select it with glue and BAM we can find it in code to convert it into all the things we need to do https://github.com/EngineerSmith/Create-Prepare-to-Dye/blob/animation/kubejs/server_scripts/base/animation/commands.js
engineersmith_4628 on Discord says
Update time Been busy (and got distracted with 'art' so now there's a new painting in the game).
Made a block that can be placed next to 'glued' structures. So that when you right click it, it saves the time of having to type any commands as it can all be done with a click. It will then highlight (similarly to glue) the connected blocks of the structure so the builder can check that everything is correctly included.
Current issue is that I found BlockEvents.rightClicked
is being triggered twice in a row. Not sure what is causing it as it seems they're both running server side; so it's not running once on client and then on server... I'll have to keep looking into it.
Anyway; once this is done. I think adding some sort of interface (<:cry:1184476833090113606> ) for naming the structure. Then some sort of item, which you can link structures together and start animating them (without affecting the already built ones - think ghost blocks of create's schematics)
Twice one for each hand!
Check if main hand and it should work
I seems like you are making it player facing, that sounds like a lot more work
engineersmith_4628 on Discord says
Mhmm; not really. I think this will be the best way to make it useable than having commands and trying to figure out positions.
I got rid of the UI idea for naming; and just using name tags (named on anvils)
You could purely do it with commands sure; but I think having no visuals will cause it to be harder to animate
engineersmith_4628 on Discord says
Just trying to make it UX friendly than end user friendly
engineersmith_4628 on Discord says
The end results will be "two" systems which work together
engineersmith_4628 on Discord says
1st the creation of the animation; which will produce a json of keyframes (with functions like lerps to positions, and actions like adding/removing blocks (e.g. upside down fire)) 2nd reading the jsons and putting them into action when it's called for it
makes sense. i like
engineersmith_4628 on Discord says
Do you know how to add block entity values to jade? So they show when you look at the block?
not sure but kikis2111 did something similar with the ponder tooltip thing maybe he knows
engineersmith_4628 on Discord says
yarden.zamirWhat's the mod that allows you to shift+click to pick up a block entity? And do you know how I can blacklist my block? If you don't know I can look into it
engineersmith_4628 on Discord says
You know your luck for a simple solution is out when you find autistic.sack.of.friends asking a similar question https://discord.com/channels/303440391124942858/1149285329417797672/1149285329417797672
Yeah its possible with the jade api if you add on to the java mod
autistic.sack.of.friends on Discord says
json serialization isn't so bad, but not terribly efficient
Code in these files is related: https://github.com/jasperalani/ptdye-plus/tree/main/src/main/java/com/kikis/ptdyeplus/integration
autistic.sack.of.friends on Discord says
i don't know if it works for blocks
autistic.sack.of.friends on Discord says
probably not...
engineersmith_4628 on Discord says
I need the block position every frame
autistic.sack.of.friends on Discord says
can't you just store a time and an animation id
autistic.sack.of.friends on Discord says
and an origin
engineersmith_4628 on Discord says
This is for the blocks within the structure
engineersmith_4628 on Discord says
OHH big brain moment
autistic.sack.of.friends on Discord says
isn't that a default feature of create structures...
engineersmith_4628 on Discord says
I can just send the client aabb information and then let the client find the blocks instead of storing the blocks in nbt/entity data
autistic.sack.of.friends on Discord says
is it that reliably ordered...
engineersmith_4628 on Discord says
While it won't be the most accurate; it should work fine as it'd use the same create function as the server is doing
engineersmith_4628 on Discord says
and order doesn't matter for this
autistic.sack.of.friends on Discord says
i meant if the bounding box thing runs after the blocks are placed
engineersmith_4628 on Discord says
Imagine create glue visual outline; do you notice it lagging as it only draws 1/20 a second than the frame rate
engineersmith_4628 on Discord says