Jump to content

Recommended Posts

So there is this mod called Return of Giants that adds the original Moose Goose and Dragonfly spawning mechanics. The issue is that the Moose Goose does not have a warning sound, but the Dragonfly does. Me and a friend on steam are trying to add the Moose Goose warning sound by copying the Dragonfly sound.

Here are some screenshots;

Original Dragonfly warning code in the mod:

04578F31FEF15DCCCB1BDCCA52EF971B61A7B9BD

Moose Goose warning sound found in Reign of Giants files:

167A1E72D033F260FA8AB887BC602208BF571854

Replacing the original Dragonfly code in the mod with the Moose Goose:

B5F19869C269CE2FBA7BB1587AF2C715267DB098

Warning sound in prefabs:

6CE24FF8E18C03F48D263677E50B907FC695EDC8

5A5E1369C4666A21609BF59B968AB2878D8BA0D0

 

Is there anything that is wrong?

The sound will not play.

14 hours ago, Monti18 said:

What exactly is the error that you have? Just no sound at all?

If that's the case, is it working if you just let the sound play like this?

I mean with inst.SoundEmitter:PlaySound(sound).

The sound won't play at all. I'll get him to try it.

16 hours ago, Monti18 said:

What exactly is the error that you have? Just no sound at all?

If that's the case, is it working if you just let the sound play like this?

I mean with inst.SoundEmitter:PlaySound(sound).

He's asking if you put it into the modmain.

17 hours ago, Monti18 said:

What exactly is the error that you have? Just no sound at all?

If that's the case, is it working if you just let the sound play like this?

I mean with inst.SoundEmitter:PlaySound(sound).

test1
Shared with Dropbox
https://www.dropbox.com/sh/i4bnqpcqd3itcym/AADDcX_GT7GTVkAQllTMWtyda?dl=0
theres the entire code if you need it

The problem is that the sound path is not correct.

If you look at the code, you see that the path is always dontstarve_DLC001/creatures/moose/something, but in your file its goosemoose instead of moose.

So replace the goosemoose with moose and it should work.

I tried it with this in the command line and heard the sound:

ThePlayer.SoundEmitter:PlaySound("dontstarve_DLC001/creatures/moose/distant")

 

Edited by Monti18
  • Like 1
12 hours ago, Monti18 said:

The problem is that the sound path is not correct.

If you look at the code, you see that the path is always dontstarve_DLC001/creatures/moose/something, but in your file its goosemoose instead of moose.

So replace the goosemoose with moose and it should work.

I tried it with this in the command line and heard the sound:


ThePlayer.SoundEmitter:PlaySound("dontstarve_DLC001/creatures/moose/distant")

 

Is there anything else wrong or just changing that work?

5 hours ago, Monti18 said:

I think it should be just this, the rest looks good! :)

Ok it still doesn't work here's the new Dropbox. Make sure to check everything because we really have no idea what we're doing.

 

https://www.dropbox.com/sh/gs2bl7mzu2tkl6h/AADVj-Eke6Mt7OifN926ypa4a?dl=0

I you spawn the prefab with c_spawn"goosewarning_lvl4" directly beneath you, you will hear the sound. I'm not sure why you don't hear it otherwise, but this would take quite some time to find out and I don't really have the time for that.

Add some prints in the goosespawner component in DoWarningSound and OnUpdate to check if the warning sound is played and where it gets stuck.

  • Like 1
13 hours ago, Monti18 said:

I you spawn the prefab with c_spawn"goosewarning_lvl4" directly beneath you, you will hear the sound. I'm not sure why you don't hear it otherwise, but this would take quite some time to find out and I don't really have the time for that.

Add some prints in the goosespawner component in DoWarningSound and OnUpdate to check if the warning sound is played and where it gets stuck.

So like,

function self:DoWarningSound(_targetplayer)
    --Players near _targetplayer will hear the warning sound from the
    --same direction and volume offset from their own local positions
--Moose/Goose doesn't actually have a warning sound. It will just show up uninvited.
    SpawnPrefab("goosewarning_lvl"..
          (((_timetoattack == nil or
        _timetoattack < 30) and "4") or
        (_timetoattack < 60 and "3") or
        (_timetoattack < 90 and "2") or
                             "1")
    ).Transform:SetPosition(_targetplayer.Transform:GetWorldPosition())
c_spawn"goosewarning_lvl4"
end

 

that?

No I meant using the console of the game. If you press ' it opens the console and there you can enter it and hear the sound.

function self:DoWarningSound(_targetplayer)
  	print("now playing warning sound")
  	print(_targetplayer)
    --Players near _targetplayer will hear the warning sound from the
    --same direction and volume offset from their own local positions
--Moose/Goose doesn't actually have a warning sound. It will just show up uninvited.
    SpawnPrefab("goosewarning_lvl"..
          (((_timetoattack == nil or
        _timetoattack < 30) and "4") or
        (_timetoattack < 60 and "3") or
        (_timetoattack < 90 and "2") or
                             "1")
    ).Transform:SetPosition(_targetplayer.Transform:GetWorldPosition())
end

Using prints is something like this, there you can see if it happens or not in the server logs and also the arguments that are passed.

Then you can see where the function is not working, which means where the prints are stopping if you are doing it all the way with the onupdate function.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...