Fix Stalker texture generation #4343

Merged
the-real-herowl merged 4 commits from teknomunk/MineClone2:fix-stalker-texture-gen into master 2024-06-01 22:23:40 +02:00
Member

This fixes stalker texture generation when the stalker is standing on a node that uses a texture using a texture modifier.

Testing

  1. Build the structure in the image.
  2. Use /spawn_mob stalker to drop a stalker into this cage
  3. Verify there is not error about a missing texture.
This fixes stalker texture generation when the stalker is standing on a node that uses a texture using a texture modifier. ### Testing 1. Build the structure in the image. 2. Use /spawn_mob stalker to drop a stalker into this cage 3. Verify there is not error about a missing texture.
Author
Member

This will fix one of the issues referenced in #4333 Some issues with the new update 0.87

This will fix one of the issues referenced in #4333 Some issues with the new update 0.87
teknomunk added this to the 0.87.1 milestone 2024-05-29 14:02:17 +02:00
teknomunk added the
#P3: elevated
label 2024-05-29 14:02:28 +02:00
the-real-herowl reviewed 2024-05-30 09:41:12 +02:00
@ -134,1 +135,3 @@
self.object:set_properties({textures={get_texture(self)}})
local new_texture = get_texture(self)
local old_texture = self._stalker_texture
if not old_texture or old_texture ~= new_texture then

Why not just do

if self._stalker_texture ~= new_texture then

instead if this line and the previous one?

Why not just do ``` if self._stalker_texture ~= new_texture then ``` instead if this line and the previous one?
Author
Member

You are right in pointing this out. There shouldn't be a difference. I'm guessing it is habit from dealing with crashes from comparing numbers with possibly nil fields.

You are right in pointing this out. There shouldn't be a difference. I'm guessing it is habit from dealing with crashes from comparing numbers with possibly nil fields.
Author
Member

Now using your version instead.

Now using your version instead.
teknomunk marked this conversation as resolved
@ -135,0 +135,4 @@
local new_texture = get_texture(self)
local old_texture = self._stalker_texture
if not old_texture or old_texture ~= new_texture then
self.object:set_properties({textures={new_texture}})

The "2 mesh buffers" warning means it should get a second (blank) texture here, just like above, in the mob definition.

The "2 mesh buffers" warning means it should get a second (blank) texture here, just like above, in the mob definition.
Author
Member

Updated this to use "mobs_mc_empty.png" like elsewhere in this file.

Updated this to use "mobs_mc_empty.png" like elsewhere in this file.
teknomunk marked this conversation as resolved
the-real-herowl added the
Testing / Retest
label 2024-05-30 10:53:40 +02:00
teknomunk force-pushed fix-stalker-texture-gen from fba255f3f6 to 7be8826c12 2024-05-30 12:56:29 +02:00 Compare
the-real-herowl requested changes 2024-05-30 13:24:25 +02:00
@ -267,1 +272,3 @@
self.object:set_properties({textures={get_texture(self), get_overloaded_aura(self._aura_timer)}})
local new_texture = get_texture(self)
if self._stalker_texture ~= new_texture then
self.object:set_properties({textures={new_texture, get_overloaded_aura(self._aura_timer)}})

Actually, this one was OK.

Firstly, you're not setting self._stalker_texture at any point, so this does nothing.

Secondly, this should be updated every frame step, for the aura animation. Yeah, it is stupid that we have to do animations server-side.

Actually, this one was OK. Firstly, you're not setting `self._stalker_texture` at any point, so this does nothing. Secondly, this should be updated every ~~frame~~ step, for the aura animation. Yeah, it is stupid that we have to do animations server-side.
Author
Member

Give me a minute, I'll revert this one.

Give me a minute, I'll revert this one.
the-real-herowl marked this conversation as resolved
teknomunk force-pushed fix-stalker-texture-gen from 8de73a695b to de19549d04 2024-05-30 13:37:43 +02:00 Compare
the-real-herowl requested review from the-real-herowl 2024-05-30 13:49:42 +02:00
teknomunk force-pushed fix-stalker-texture-gen from de19549d04 to a256208e6b 2024-05-31 12:47:55 +02:00 Compare
the-real-herowl approved these changes 2024-06-01 22:23:17 +02:00
the-real-herowl removed the
Testing / Retest
label 2024-06-01 22:23:23 +02:00
the-real-herowl merged commit beccbacc73 into master 2024-06-01 22:23:40 +02:00
teknomunk deleted branch fix-stalker-texture-gen 2024-06-01 23:00:57 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#4343
No description provided.