My babies wont cry.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England

My babies wont cry.

Post by Hidden Hands »

I have babies as NPCs in my game. Originally, they were mute but then I deceided to give them a crying "active" sound but the sound doesn't play. I have scripted it the same way I script my monsters sounds, what am I doing wrong here please? Here is the code.

Code: Select all

ACTOR PinkBaby 19998
{
//$Category NPCs
  Radius 25
  Height 9
  Speed 3
  SeeSound "baby/active"
  ActiveSound "baby/active"
  States
  {
  Spawn:
    PBAB AABBCCBB 4 A_Wander
    Loop
 }
}

ACTOR BlueBaby 19997
{
//$Category NPCs
  Radius 25
  Height 9
  Speed 3
  SeeSound "baby/active"
  ActiveSound "baby/active"
  States
  {
  Spawn:
    BBAB AABBCCBB 4 A_Wander
    Loop
 }
}
and here is the SNDINFO.

Code: Select all

baby/active CRYBABY
Any and all help is greatly appreciated!
Thanks in advance.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: My babies wont cry.

Post by Matt »

Does A_Wander even call the active sound?
User avatar
Endie
Posts: 227
Joined: Thu Mar 16, 2017 7:34 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Somewhere in the void

Re: My babies wont cry.

Post by Endie »

Try this~

Code: Select all

   BBAB AABB 4 A_Wander
    BBAB CCDD 4 A_Look
    Loop
I guess with "A_Look" calls the active sound
User avatar
AFADoomer
Posts: 1339
Joined: Tue Jul 15, 2003 4:18 pm

Re: My babies wont cry.

Post by AFADoomer »

Or you could just use [wiki=A_ActiveSound]the function that plays the active sound[/wiki] directly?
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm

Re: My babies wont cry.

Post by Arctangent »

I'm pretty sure A_ActiveSound doesn't have the chance part of it, though. Might just need to replicate the A_Chase sound logic through an anonymous or ZScript function.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: My babies wont cry.

Post by Matt »

Might I suggest:

Code: Select all

ACTOR PinkBaby 19998
{
//$Category NPCs
  Radius 25
  Height 9
  Speed 3
  SeeSound "baby/active"
  ActiveSound "baby/active"
  States
  {
  Spawn:
    PBAB A 0 nodelay A_Jump(256,"Spawn2")
  Spawn2:
    "####" AABBCCBB 4 A_Wander
    "####" A 0 A_Jump(220,"Spawn2")  //adjust this number as needed
    "####" A 0 A_ActiveSound
    Loop
  }
}

ACTOR BlueBaby : PinkBaby 19997
{
//$Category NPCs
  States
  {
  Spawn:
    BBAB A 0 nodelay A_Jump(256,"Spawn2")
  }
}
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England

Re: My babies wont cry.

Post by Hidden Hands »

Matt wrote:Might I suggest:

Code: Select all

ACTOR PinkBaby 19998
{
//$Category NPCs
  Radius 25
  Height 9
  Speed 3
  SeeSound "baby/active"
  ActiveSound "baby/active"
  States
  {
  Spawn:
    PBAB A 0 nodelay A_Jump(256,"Spawn2")
  Spawn2:
    "####" AABBCCBB 4 A_Wander
    "####" A 0 A_Jump(220,"Spawn2")  //adjust this number as needed
    "####" A 0 A_ActiveSound
    Loop
  }
}

ACTOR BlueBaby : PinkBaby 19997
{
//$Category NPCs
  States
  {
  Spawn:
    BBAB A 0 nodelay A_Jump(256,"Spawn2")
  }
}
This is exactly what I wanted, thank you so much. You are a gem!

Also, thank you to everyone else that looked at this thread in an attempt to help. Much appreciated!

Return to “Scripting”