A_Chase w/ Custom Sound played

Moderator: GZDoom Developers

User avatar
BouncyTEM
Posts: 3821
Joined: Sun Aug 24, 2003 5:42 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: 2280 Lol Street: The Calamitous Carnival (formerly Senators Prison)

A_Chase w/ Custom Sound played

Post by BouncyTEM »

this would be extremely useful due to the fact it would allow monsters with sounds being played per step (like Cybie) but not actually using the Cybie's walking sound or be based on the Cybie. would help greatly.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49194
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Already possible. Just look at the CyberMastermind in the monster pack:

Code: Select all

	See:
		CYMM AABB 3 A_Chase
		CYMM B 0 A_PlaySound("spider/walk")
		CYMM CCDD 3 A_Chase
		CYMM D 0 A_PlaySound("spider/walk")
		CYMM EEFF 3 A_Chase
		CYMM F 0 A_PlaySound("spider/walk")
		Loop
No need to create new code pointers!
User avatar
BouncyTEM
Posts: 3821
Joined: Sun Aug 24, 2003 5:42 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: 2280 Lol Street: The Calamitous Carnival (formerly Senators Prison)

Post by BouncyTEM »

well, it would be useful as a code pointer for those monsters you just can't get the playsound to do it at the EXACT moment you want it, would it not?
(i know this from a monster i had made. i messed with A_Playsound and A_Chase like a maniac. no luck.)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49194
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

XXXX A 4 A_Metal is 100% the same as

XXXX A 0 A_PlaySound("cyber/hoof")
XXXX A 4 A_Chase

in terms of timing. If you have problems you made an error.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

How is it not possible to get the timing you want? Frames with a display 0 never visably show up, but their code pointers will still execute. Sometimes there has to be some expansion, but it still works.

Playing the hoof sound at the end of 48 tics...

Code: Select all

XXXX ABC 16 A_Chase
XXXX C 0 A_PlaySound("cyber/hoof")
And now how about playing the hoof sound every 16th tic...

Code: Select all

XXXX A 0 A_PlaySound("cyber/hoof")
XXXX A 16 A_Chase
XXXX B 0 A_PlaySound("cyber/hoof")
XXXX B 16 A_Chase
XXXX C 0 A_PlaySound("cyber/hoof")
XXXX C 16 A_Chase
And every 8th tic...

Code: Select all

XXXX A 0 A_PlaySound("cyber/hoof")
XXXX A 8 A_Chase
XXXX A 0 A_PlaySound("cyber/hoof")
XXXX A 8 A_Chase
XXXX B 0 A_PlaySound("cyber/hoof")
XXXX B 8 A_Chase
XXXX B 0 A_PlaySound("cyber/hoof")
XXXX B 8 A_Chase
XXXX C 0 A_PlaySound("cyber/hoof")
XXXX C 8 A_Chase
XXXX C 0 A_PlaySound("cyber/hoof")
XXXX C 8 A_Chase
In terms of timing, all three examples take up the same number of tics. The first one is 42 tics, the second one is 42 tics, and the third one is 42 tics. So all three of these occur in the same exact period of time, but the sound is playing a different intervals for each. You don't even have to keep the intervals even if you really don't want to.
User avatar
BouncyTEM
Posts: 3821
Joined: Sun Aug 24, 2003 5:42 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: 2280 Lol Street: The Calamitous Carnival (formerly Senators Prison)

Post by BouncyTEM »

yeah, i messed up. oh well. at least i was thinking of a decorate feature which might cut down some coding, but i guess people can't be lazy. :P
User avatar
Anakin S.
Posts: 1067
Joined: Fri Nov 28, 2003 9:39 pm
Location: A long time ago in a galaxy far, far away...

Post by Anakin S. »

Here's something I think needs to be cut down in the amount of coding. To make something random requires a lot of A_Jump statements, which can quickly get messy. I understand that A_Jump is useful for multiple attack sequences like the maulotaur, but for things reproducing a projectile that shoots particles out the back in random directions similar to the D'sparil lightning, this method would become quite cumbersome.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49194
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Bouncy wrote:yeah, i messed up. oh well. at least i was thinking of a decorate feature which might cut down some coding, but i guess people can't be lazy. :P
Lazy indeed! :P

Return to “Closed Feature Suggestions [GZDoom]”