You must log in to comment.

in reply to @hthrflwrs's post:

  • notice that some body parts aren't being updated properly
  • realize that they are having the proper data set, but it's not being sent to the model
  • realize that they set themselves properly if you set a different property after messing with a broken property
  • reason that, since the broken property is passing in the same data regardless of the different property, the only real difference between the two is the number of times the SetSkin() function has been called
  • call SetSkin() twice
  • it works

I'm still picking up very basic programming but I've run into similar things. Look at tutorial, command is done once. Try my hand at it, need to do it twice. Can't verify for what reason, but it works. Lesson complete.

This is... My first intuition is it's a multithreading thing where you need a mutex but if your game isn't multithreaded I've got no clue. Maybe the order is wrong inside the function? Like the code for "set data" is below the code for "apply data as skin", where it should be above it?

Huh. What plugin is it that's causing this, anyways? My next thought is that it's some bullshit with a void pointer where some pointer arithmetic is going wrong, and having the data at function start doesn't break it, but I'm guessing that wouldn't be your code anyways.

It could also be a memory thing? I think there are compiler optimizations having to do with the cache that require you to set the volatile keyword, and maybe the second time it gets called the memory is in the cache so it works correctly.

This is the kind of bug that universally scares me because it's always some horrible bullshit under the hood.

First thought: that would drive me so crazy i would literally not be able to work on the rest of the game until i had Solved it

Second thought: maybe just rename SetSkin() to something else and then make a new function called SetSkin() that calls the original one twice so that you dont ever have to worry about forgetting the second call etc.

oh i literally only need to do the second call in this one specific location. this is for character creation which has a lot of resetting the same skin, which is where the fiddly stuff comes in that requires double-setting it. for the whole rest of the game, i only need to call setskin() once lol

Hello! I would expect somewhere inside your set skin is:
1, update body part visually
2, set data of body part.
As a result of it being out of order, you have to call it twice, since you have to set the data before updating it visually.

But you said that everything is in proper order and you've checked. I would suggest adding in the updating-visually an extra time after each time you set data, and test results.