Noxys Swimming

by _Noxy_

Allows you to "Swim" through water.

Content
4 months ago
0.16 - 2.0
7.28K
Transportation

g Can Swim even when deep water is disabled

4 months ago

Hi, I just found out that I can still swim even when the deep water option is disabled (it is supposed that I shouldn't be able to do that).

Also, the car can easily travel through water like nothing, just getting the movement reduction while in "normal" water, but later with no downgrades in deep water... while also not having any vfx from the water.

The player has the vfx, so that's great, but seems that only him and not others

4 months ago

other entities*

like the car.

4 months ago

Thanks for the report. It seems I can no longer have different collision behavior for the different waters. So I've opted to remove this setting. However you can still use the speed to limit mobility in deep water. I also added a setting for enabling (or disabling) the vehicle VFX. This is all in release 0.5.2.

4 months ago

You can have different collision masks between waters, but you’ll have to deepcopy the collision masks before editing them.

In 2.0, all water tiles share a reference to the same collision mask so editing one edits them all. Deepcopy first, then edit.

4 months ago

I tried that and it still didn't work.

4 months ago

This code:

  local mask = data.raw.tile[water].collision_mask.layers
  if mask["player"] then mask["player"] = nil end

should be changed to

  local mask = table.deepcopy(data.raw.tile[water].collision_mask)
  if mask.layers["player"] then mask.layers["player"] = nil end
  data.raw.tile[water].collision_mask = mask

Maybe you were deepcopying the layers dict rather than the collision_mask itself?

4 months ago

I was copying the collision_mask but I was also tired and haven't had the time to try again and likely won't until the weekend. Maybe I botched something in the testing, I was also doing updates to other mods in parallel.

New response