Jump to content

Smitty's Sirens & Alarms


smitty

Recommended Posts

On 3/14/2021 at 10:54 PM, doughphunghus said:

I believe I have found a fix for this mod to get it to work in a19.4 stable.  There was also an existing bug I found, possibly 2 (if changes were made in 19.4 that broke it).

 

I cannot upload the fixed files here (the forum blocking xml uploads) so for now, here's what you have to do to fix it. You should be able to make these changes in an existing game and it "just works" as we're not creating or removing any new resources/blocks/items/etc.

 

NOTE: You have to have Perk Engineering up to level 3 (in the fixed version) for the perk to unlock them as that's when the normal vanilla speaker unlocks.

NOTE: I could not replicate the "schematic not unlocking them" issue.  Using the schematic in the old version (and the new) should unlock them all without the perk.

NOTE: I will leave it up to Smitty to update and relink a "a19.4 stable" version, or patch and test however they see fit, or not update, etc.

 

Bug 1: "Speaker - Alarm Siren 2" is not working.

Change the SoundDataNode block for everything for speaker 16 in sounds.xml to the XML below

The actual change is just changing a single underscore to a space for the AudioClip (the wrong sound was named "alarm_siren_2"), but this is easier to document as the entire XML block


   <!-- Speaker 16 -->
    <SoundDataNode name="smitty_siren16">
      <AudioSource name="Sounds/AudioSource_VO_Announce"/>
      <AudioClip ClipName="#@modfolder:Resources/smittylv_envato_sounds.unity3d?alarm_siren 2" Loop="true"/>
      <LocalCrouchVolumeScale name="1.0"/>
      <CrouchNoiseScale name="0.5"/>
      <NoiseScale name="1"/>
      <MaxVoices value="10"/>
      <MaxRepeatRate value="0"/>
    </SoundDataNode>

 

Bug 2: Perk AdvancedEngineering not working to unlock the speakers

I don't know why (maybe it didn't work before?) but this gets it to work in a19.4 stable:

1. Create a new file in the mod under the Config folder and call it: progression.xml (note: On windows, you might need to have visible file name extensions "on" or you might end up creating progression.xml.txt instead)

2. Add this XML to the file


<Smitty>
  <append xpath="/progression/perks/perk[@name='perkAdvancedEngineering']/effect_group"> 
      <passive_effect name="RecipeTagUnlocked" operation="base_set" level="3,5" value="1" tags="smittySpeaker1,smittySpeaker2,smittySpeaker3,smittySpeaker4,smittySpeaker5,smittySpeaker6,smittySpeaker7,smittySpeaker8,smittySpeaker9,smittySpeaker10,smittySpeaker11,smittySpeaker12,smittySpeaker13,smittySpeaker14,smittySpeaker15,smittySpeaker16,smittySpeaker17,smittySpeaker18,smittySpeaker19"/>
  </append>
</Smitty>

 

Also:

If you want to be super pedantic/accurate, you would also change the Version line in ModInfo.xml from 1.0.0 to 1.0.1 or something different from the original.  Using 2.0.0 might also be accurate if it doesn't work in the original version of the game it was built on. I'm not sure, just 1.0.1 indicates its not the original


<Version value="1.0.1" />

 

 

Hello!

 

Your fix worked - I can craft and use the speakers now, thank you so much! I've got alarms blaring whenever zombies come near the entrances to the base now, it's super useful! :D

 

I did notice something else though; the friends I play with can't hear the speaker alarms even with the mod installed on their end. They play with the exact same mods as I do. Is this how it's supposed to be? We don't play on a dedicated server but just on a normal private game; I'm not sure if this matters. 

Link to comment
Share on other sites

14 minutes ago, Camiracundus said:

 

I did notice something else though; the friends I play with can't hear the speaker alarms even with the mod installed on their end.

That’s not supposed to happen.  I’ll see what I can figure out. All the speakers extend from the standard “speaker” so it should work (ha ha, should!).

 

one possibility is that the config/resources/*.unity3d file (whatever  that file is named, I forget. I’m on my phone) might be corrupt for them . It’s a very remote possibility, if everyone shared the same bad copy.  
 

can someone else craft one of these speakers, and have them place and connect it, and validate that only they can hear it?

 

note: there is a way to have sounds “only play in a players head” but I thought that only applies to player buffs, and had to be explicitly set as an option.   Maybe the speaker block is different and needs some explicit “play for everyone” when it is extended as sometimes properties don’t always extend, by purposeful design apparently. 

Link to comment
Share on other sites

Just now, doughphunghus said:

That’s not supposed to happen.  I’ll see what I can figure out. All the speakers extend from the standard “speaker” so it should work (ha ha, should!).

 

one possibility is that the config/resources/*.unity3d file (whatever  that file is named, I forget. I’m on my phone) might be corrupt for them . It’s a very remote possibility, if everyone shared the same bad copy.  
 

can someone else craft one of these speakers, and have them place and connect it, and validate that only they can hear it?

 

note: there is a way to have sounds “only play in a players head” but I thought that only applies to player buffs, and had to be explicitly set as an option.   Maybe the speaker block is different and needs some explicit “play for everyone” when it is extended as sometimes properties don’t always extend, by purposeful design apparently. 

Thanks for the fast reply :)

 

I'll have them try crafting their own alarm speaker later and see if they can hear those! 

Link to comment
Share on other sites

21 hours ago, Camiracundus said:

Thanks for the fast reply :)

 

I'll have them try crafting their own alarm speaker later and see if they can hear those! 

I had both of my friends try crafting their own speakers and connecting them; they can't hear them at all. I'm not sure if they need to craft their own generator + motion sensor either; they used my extras for that, but the speakers they made on their own. They tested the Ship Siren sound for them; I could hear the noise coming from their speaker but they couldn't hear it themselves; seems like only the host can hear them. 

Link to comment
Share on other sites

3 hours ago, Camiracundus said:

I had both of my friends try crafting their own speakers and connecting them; they can't hear them at all. I'm not sure if they need to craft their own generator + motion sensor either; they used my extras for that, but the speakers they made on their own. They tested the Ship Siren sound for them; I could hear the noise coming from their speaker but they couldn't hear it themselves; seems like only the host can hear them. 

This is really weird then. 
ummm, can you test that they/you can hear the “regular” vanilla speaker that they place and hook up themselves?

 

I don’t think the source of the electricity should matter, just possibly who places the block (if that matters).  I don’t know why that don’t hear anything as things like the trader speaker announcements should be heard by all (well, it’s a little special) but normal “sounds” from every other object (doors, guns, cabinets, etc) should be hearable by everyone and this  shouldn’t be any different. 
 

I looked at the xml yesterday and didn’t see anything obvious, but there’s 1 possible change I could try and can post the xml to try tonight. After that I’m out of obvious ideas and might have to see if some of the modding discord’s have an answer. I don’t have a server to test any of this on , I only have local single player games. :(
 

it’s also possible that it’s a bug  in the game for the speaker class in PvP. If the fix I’m going to send doesn’t fix it, and the Modding discord(s) doesn’t have an answer, I’ll submit a bug report with your testing info and my xml updates/etc. and see what TFP can validate it’s working properly or not (I’d say not).  It’s a mod so they might not be willing to fix it BUT it’s also just a basic “extension” of a vanilla block so maybe its an issue vs “a mod issue”. If the vanilla speaker isn’t heard by everyone then we have a much more solid case, I would think unless this is intended behaviour 

Link to comment
Share on other sites

Update: IF in the game players place a vanilla speaker (non smitty's speaker) and it CAN be heard by all players, attempt this XML edit to Smitty's mod:

 

PvP test/XML edit #2:

Change the "blocks.xml" file to change the single "smittySpeaker1" block to look like this (below) and see if this speaker can be placed by one player and heard by all players. FYI: The block in game is called "Speaker - Ship Siren", per the Localization.txt file translation.

 

The difference in this code is that it is not extending the Speaker class, but copying the vanilla speaker, adding a vanilla speaker icon, and changing the sound.

If this fails to work (only the person who places the block can hear it), then it looks like a PvP only bug to me and I'll file a bug report.

If this "fixes" the issue, then I'll see if I can get ahold of smitty to update the mod with all the fixes and post it for a19.4.

 

<block name="smittySpeaker1">
    	<property name="CreativeMode" value="Player"/>
	    <property name="Class" value="Speaker"/>
	    <property name="CustomIcon" value="speaker"/>
	    <property name="UnlockedBy" value="perkAdvancedEngineering,speakerSchematic"/>
	    <property name="PlaySound" value="smitty_siren1"/>
	    <property name="Material" value="Mmetal_weak"/>
	    <property name="Shape" value="ModelEntity"/>
	    <property name="Model" value="Entities/Electrical/loudspeakerPrefab"/>
	    <property name="HandleFace" value="South"/>
	    <property name="ImposterDontBlock" value="true"/>
	    <property name="Collide" value="movement,melee,bullet,arrow,rocket"/>
	    <property name="LootList" value="7"/>
	    <property name="RequiredPower" value="5"/>
	    <property name="DisplayType" value="blockElectrical"/>
	    <property name="Group" value="Science"/>
	    <property class="RepairItems">
		    <property name="resourceForgedIron" value="3"/>
		    <property name="resourceElectricParts" value="2"/>
	    </property>
	    <drop event="Harvest" name="terrStone" count="0" tool_category="Disassemble"/>
	    <drop event="Harvest" name="resourceElectricParts" count="0,2" tag="salvageHarvest"/>
	    <drop event="Harvest" name="resourceScrapIron" count="5,10" tag="allHarvest"/>
	    <drop event="Destroy" count="0"/>
	    <drop event="Fall" name="scrapMetalPile" count="1" prob="0.75" stick_chance="1"/>
	    <property name="TakeDelay" value="5"/>
	    <property name="EconomicValue" value="72"/>
	    <property name="FilterTags" value="fdecor,felectrical"/>
	    <property name="SortOrder1" value="70a0"/>
    </block>

 

Link to comment
Share on other sites

On 3/1/2021 at 10:03 AM, doughphunghus said:

Not that I’m aware of, for like “overall sounds of a specific block or sound node”.  Of course, there are some audio settings from the main menu that can be changed (music/ambiance volumes) but I don’t know setting what a speaker/block falls under.

 

@smitty I  consider these sounds and the mod “owned by smitty” so if they want to change it (have me tweak the sound levels and repackage the sounds ) I could do that if they asked me to but maybe this is exactly how smitty wants their mod?

 

I can put together a different mod with some sounds for you if you would like, the hard part is getting the sounds that are “freely available to use”. (send me some links and I’ll see if I can use them.).  It might sound weird using this limitation, but I feel weird just taking clips from others and giving them to someone else (or the forums) unless they are licensed freely. If you want, I can point you to some links on how to add your own sounds to the game and you can create/add whatever sounds you want as your own mod.  It’s not super hard but it takes some time to get unity set up/installed and do the actual xml editing. Sound converting is actually easy once you’re set up to do it.

 

also:  I do have the capability to create “voice alerts” that can say whatever you want (I’m using the very ancient “espeak” tool right now) but the voices are not super pretty (sounds robotic).  I’m working on this for a mech mod I’ve released, which is still in development, and the volume levels need tweaking as well.  Additionally, I might be able to create something using some tools I have to mimic a sound/alarm if you have one in mind. Basic stuff though.


Yes you can change the volume levels as you need! I did find some too loud as well. Scared the S%@T out of me lol.

Also I've had the lines recorded if you wanted to go forth with the request by one of the players here to have ones that speak lines.
I messaged you the file and it is yours to do with as you wish.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...