Custom #558
-
With the void client, how would I go about adding custom items? Last thing I worked on was PI a long time ago and I'm looking to get back into this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, While there probably are some 6xx revision UI cache editors around (like you might be used to with PI or other 317's) I don't know what one's people typically use as I just write quick scripts to do what I need as you can find in void/tools. The difference between PI and void, is you won't need to modify the client to add custom items, you can just make cache modifications to add everything you want. Assuming you have a custom item models or just want to use existing models and create new definitions, this should be quite straight-forward, here's an example of how that import world.gregs.voidps.buffer.write.BufferWriter
import world.gregs.voidps.cache.Cache
import world.gregs.voidps.cache.CacheDelegate
import world.gregs.voidps.cache.Index
import world.gregs.voidps.cache.definition.data.ItemDefinitionFull
import world.gregs.voidps.cache.definition.decoder.ItemDecoder
import world.gregs.voidps.cache.definition.encoder.ItemEncoder
import world.gregs.voidps.tools.property
import java.io.File
object AddCustomItem {
@JvmStatic
fun main(args: Array<String>) {
val cache: Cache = CacheDelegate(property("cachePath"))
// Write model
val modelFile = File("./model-file.dat").readBytes()
val modelId = 12345
cache.write(Index.MODELS, modelId, 0, modelFile)
// Write item definition
val encoder = ItemEncoder()
val decoder = ItemDecoder()
val definition = ItemDefinitionFull().apply {
id = 54321
name = "Custom item"
cost = 123456
primaryMaleModel = 12345
primaryFemaleModel = 12345
}
val writer = BufferWriter(capacity = 2048)
with(encoder) {
writer.encode(definition, definition)
}
cache.write(Index.ITEMS, decoder.getArchive(definition.id), decoder.getFile(definition.id), writer.toArray())
cache.update()
}
} |
Beta Was this translation helpful? Give feedback.
Hi,
While there probably are some 6xx revision UI cache editors around (like you might be used to with PI or other 317's) I don't know what one's people typically use as I just write quick scripts to do what I need as you can find in void/tools. The difference between PI and void, is you won't need to modify the client to add custom items, you can just make cache modifications to add everything you want.
Assuming you have a custom item models or just want to use existing models and create new definitions, this should be quite straight-forward, here's an example of how that
AddCustomItem.kt
file might look: