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.

My babies wont cry.

Postby Hidden Hands » Wed Feb 28, 2018 5:50 pm

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 allExpand view
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 allExpand view
baby/active CRYBABY


Any and all help is greatly appreciated!
Thanks in advance.
User avatar
Hidden Hands
Cherub
 
Joined: 20 Sep 2016
Location: London, England
Discord: VGCtm
Operating System: Windows Vista/7/2008 32-bit

Re: My babies wont cry.

Postby Matt » Wed Feb 28, 2018 8:05 pm

Does A_Wander even call the active sound?
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: My babies wont cry.

Postby Endie » Wed Feb 28, 2018 10:25 pm

Try this~

Code: Select allExpand view
   BBAB AABB 4 A_Wander
    BBAB CCDD 4 A_Look
    Loop


I guess with "A_Look" calls the active sound
User avatar
Endie
I'm doing what i love. Doesn't mean i'm good at it though
 
Joined: 16 Mar 2017
Location: Somewhere in the void
Discord: 「Moa Dixøn」#4254
Operating System: Windows Vista/7/2008 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: My babies wont cry.

Postby AFADoomer » Wed Feb 28, 2018 10:27 pm

Or you could just use the function that plays the active sound directly?
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: My babies wont cry.

Postby Arctangent » Wed Feb 28, 2018 11:07 pm

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
Arctangent
squawky
 
Joined: 06 Nov 2014
Discord: SquawkyAtan#2371

Re: My babies wont cry.

Postby Matt » Thu Mar 01, 2018 1:42 pm

Might I suggest:

Code: Select allExpand view
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
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: My babies wont cry.

Postby Hidden Hands » Sun Mar 04, 2018 7:40 am

Matt wrote:Might I suggest:

Code: Select allExpand view
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!
User avatar
Hidden Hands
Cherub
 
Joined: 20 Sep 2016
Location: London, England
Discord: VGCtm
Operating System: Windows Vista/7/2008 32-bit


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests