However, what ends up happening is that for every pull percentage here that is not specified (i.e. 60%, 15%, etc) the bow model reverts to the original bow model instead of remaining as the previously specified model.
For example, when the bow is at 25% charged, the model changes to item/bow2. However, upon reaching 26% charged, the bow model reverts to item/bow (the original).
I've modified the same file in a similar way in my pack, and haven't had any such issues. The only thing I notice that's really different between yours and mine is that I have a starting state that is just "pulling:1" and no "pull" percentage. Doesn't seem like it would change anything, but might be work trying?
The Meaning of Life, the Universe, and Everything.
Join Date:
9/14/2015
Posts:
43
Member Details
Ok so I don't program in java/java script but I do program in C++. Could you possibly do something similar to
// Example starting from 25% pull
if (pull <= 44) {
//change bow model here
}
So possibly in json(Don't get mad if this is wrong please, I don't know java/JavaScript.)
Again starting from 25
"pull": 0.25, 0.26, 0.27, 0.28, 0.29 //ect
What I'm trying to get at is that you probably need to set the model to be loaded for every variable change because right now you have it set so at 25% the model loads but at 26% nothing is telling it to load so it reverts back to the default.
Ok so I don't program in java/java script but I do program in C++. Could you possibly do something similar to
// Example starting from 25% pull
if (pull <= 44) {
//change bow model here
}
So possibly in json(Don't get mad if this is wrong please, I don't know java/JavaScript.)
Again starting from 25
"pull": 0.25, 0.26, 0.27, 0.28, 0.29 //ect
What I'm trying to get at is that you probably need to set the model to be loaded for every variable change because right now you have it set so at 25% the model loads but at 26% nothing is telling it to load so it reverts back to the default.
The vanilla file avoids that issue while still only having 3 states:
I'm having some difficulty in setting models for the bow when the player pulls the bow back to a certain percentage.
Here is a snippet of my code that I wrote to accomplish this:
"overrides": [
{
"predicate": {
"pulling": 1,
"pull": 0.05
},
"model": "item/bow1"
},
{
"predicate": {
"pulling": 1,
"pull": 0.25
},
"model": "item/bow2"
},
{
"predicate": {
"pulling": 1,
"pull": 0.45
},
"model": "item/bow3"
},
{
"predicate": {
"pulling": 1,
"pull": 0.65
},
"model": "item/bow4"
},
{
"predicate": {
"pulling": 1,
"pull": 0.85
},
"model": "item/bow5"
},
{
"predicate": {
"pulling": 1,
"pull": 1
},
"model": "item/bow6"
}
]
However, what ends up happening is that for every pull percentage here that is not specified (i.e. 60%, 15%, etc) the bow model reverts to the original bow model instead of remaining as the previously specified model.
For example, when the bow is at 25% charged, the model changes to item/bow2. However, upon reaching 26% charged, the bow model reverts to item/bow (the original).
How can I fix this?
Hello. I am a noob. Help please? Thanks.
I've modified the same file in a similar way in my pack, and haven't had any such issues. The only thing I notice that's really different between yours and mine is that I have a starting state that is just "pulling:1" and no "pull" percentage. Doesn't seem like it would change anything, but might be work trying?
Ok so I don't program in java/java script but I do program in C++. Could you possibly do something similar to
So possibly in json(Don't get mad if this is wrong please, I don't know java/JavaScript.)
Again starting from 25
What I'm trying to get at is that you probably need to set the model to be loaded for every variable change because right now you have it set so at 25% the model loads but at 26% nothing is telling it to load so it reverts back to the default.
The vanilla file avoids that issue while still only having 3 states:
{
"predicate": {
"pulling": 1
},
"model": "item/bow_pulling_0"
},
{
"predicate": {
"pulling": 1,
"pull": 0.65
},
"model": "item/bow_pulling_1"
},
{
"predicate": {
"pulling": 1,
"pull": 0.9
},
"model": "item/bow_pulling_2"
}