[SUG] Assign Fail Sound for disallowed/failed assignments

Started by WillLem, May 31, 2023, 11:46:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WillLem

From discussion in this topic:

Quote from: jkapp76
Could you ... Make the selecting tone (or a fail tone) ...?

Quote from: WillLem
a fail sound would be ideal for any and all disallowed assignments

Quote from: jkapp76
You could use the same (assign) tone but pitch it down to sound negative.

WillLem

Implemented this in Commit dcbe9fecf.

It's a wierd one, I had to cobble it together from various existing checks and variables in LemGame. The code is somewhat counter-intuitive in that I had to say "if not Lem Selected" when I thought it would be "if Lem Selected", but it could be that something is reversing the logic somewhere else. I'd like to investigate it further and get to know exactly what's going on in case it can be refined/improved.

Anyway, we now have an "assign fail" sound! At the moment it's the "builder-running-out-of-bricks" sound (ting.wav) but pitch shifted up slightly so it's discernable from the actual builder brick tone. Eventually, I'll replace this with a dedicated sound that can then be user-customised by replacing it with whatever sound you like.

For steel checks, it's the "destructive-skill-has-just-hit-steel" sound (chink.wav). It's probably best to keep this one as-is, since it makes sense to let the player know that the reason they can't assign the skill is because there's steel. For any other type of failed assignment (trying to assign a Builder to a lem that's already building, any permanent skill to an athlete that already has that permanent skill, Bashers whilst a lem is falling, Laserers to a Blocker, etc, etc) it's the default assign fail sound as described above.

Hopefully, I'll get a dedicated sound sorted in time for the release of 2.1 (sooon!)

WillLem

This feature caused an AV error when clicking the screen, so has been removed in Version 2.1.1. Not sure what's causing it, but I'll hopefully find a fix soon.

WillLem

OK, I think I've found a fix for this.

The problem was that the check for "is a Lemming selected?" wasn't actually set to a meaningful value. I was calling SelectedLemming correctly, but then not actually assigning it a value. Consequently, the code was checking for nothing to happen, quite literally. Dividing by zero, basically :forehead:

This has now been corrected, and - as far as the minimal testing I've done so far is concerned - it now works quite smoothly.

I'm going to hold off on a hotfix release until I've addressed a few other bugs that I've spotted whilst playing through the Sandbox pack, and given everything a more thorough test.

Fixed in commit 4d8ab9a39

WillLem

Fixed a bug with this where the steel sound is triggered for non-steel-interactive skills (such as throwing skills, Builders, Freezers, etc). It's now only triggered for attempted Miners and Diggers on steel.

Fix implemented in Commit eade06f18.