It is currently 25 May 2013, 03:46

Post new topic Reply to topic  Page 1 of 2
 [ 16 posts ]  1, 2  

Player Taunts Script Help


Author Message
 Post subject: Player Taunts Script Help
PostPosted: 17 Jul 2011, 16:18 
Offline
Chaingunner  We Are The Lamb
User avatar
Joined: 10 Jan 2011, 21:14
Posts: 140
Location: Alberta, Canada
Well. In my wad, I have an old gibbing system that, at random, when the zombies blow up to millions of pieces, the player would say a random quote 'that I have selected'. But now I'm replacing the old one with a more 'lag free' quality. But the thing is, the player quote thing won't work properly. So I want help with making a new one from scratch.

If anyone can help me, I want to try to make a quoting/Taunting script to be somewhat like in Blood or Zombies (CoD) if it is possible. And I want to be able to have different ones for different types of enemies (Zombies, Demons, Aliens, etc.) and we would have to put it that it will only play one sound at a time no matter what.

Is anyone up for the challenge, cause I fail at scripting.
"The one to help us fail. The one to let us grow
The torch is passed on. We are the lamb"

Imminent Firestorm Creator


Top
 Profile  
 
 Post subject: Re: Player Taunts Script Help
PostPosted: 18 Jul 2011, 07:19 
Offline
Cyberdemon  Approved Adder
User avatar
Joined: 01 Feb 2011, 20:07
Posts: 860
Here is a way to do it:

Make each enemy you want the taunt sound to be played upon its gibbed-death has a A_GiveToTarget with it giving a custom inventory item. This item will be given to the player if he/she gibbs that said enemy. In the PickUp state of the item, use A_PlaySound to play the taunt sound.


Top
 Profile  
 
 Post subject: Re: Player Taunts Script Help
PostPosted: 19 Jul 2011, 03:09 
Offline
Chaingunner  We Are The Lamb
User avatar
Joined: 10 Jan 2011, 21:14
Posts: 140
Location: Alberta, Canada
Blue Shadow wrote:
Here is a way to do it:

Make each enemy you want the taunt sound to be played upon its gibbed-death has a A_GiveToTarget with it giving a custom inventory item. This item will be given to the player if he/she gibbs that said enemy. In the PickUp state of the item, use A_PlaySound to play the taunt sound.

Alright! That's a start... but if more than one enemies gibb at the same time, won't that play all different sounds at the same time? So instead of just one line being said, it would end up saying 5 different lines at the same time and sound very weird. Is there a way to prevent that?


Top
 Profile  
 
 Post subject: Re: Player Taunts Script Help
PostPosted: 19 Jul 2011, 09:27 
Offline
Cyberdemon  Approved Adder
User avatar
Joined: 01 Feb 2011, 20:07
Posts: 860
The two taunt items in the example utilize sound channels in their A_PlaySound functions (CHAN_*):
Code:
  TNT1 A 1 A_PlaySound("baron/death", CHAN_VOICE)
If all the items use the same sound channel then only one sound will be played at a time. That means the code has already solved that problem.


Top
 Profile  
 
 Post subject: Re: Player Taunts Script Help
PostPosted: 19 Jul 2011, 16:46 
Offline
Arachnotron  Really?
User avatar
Joined: 04 Mar 2010, 21:30
Posts: 373
Location: Florida
You could always use a little ACS to do things much more cleanly. Give the player a TID and use this, for instance...

Code:
str PlayerTaunts[3] = {"Player/Taunt1", "Player/Taunt2", "Player/Taunt3"};

script 400 (void)
{
thingsound(player, PlayerTaunts[random(0,2)], 127);
delay(35 * 10); //wait ten seconds before another clip will play
}


And then in your monster code, call this script when one dies. Make sure you use plain ACS_Execute and not ACS_ExecuteAlways and you won't have any nasty overlap, and taunts won't override one another.

Code:
Death:
TNT1 A 0 ACS_Execute(400, 0, 0, 0, 0)


Top
 Profile  
 
 Post subject: Re: Player Taunts Script Help
PostPosted: 19 Jul 2011, 19:38 
Offline
Cyberdemon  Approved Adder
User avatar
Joined: 01 Feb 2011, 20:07
Posts: 860
@Ceeb: ACS way is "cleaner" and I thought about it but keep in mind that you also need custom damage for the player's weapons as well, because that script will execute even if an enemy gets gibbed by other enemy, not just by the player.


Top
 Profile  
 
 Post subject: Re: Player Taunts Script Help
PostPosted: 19 Jul 2011, 20:37 
Offline
Arachnotron  Really?
User avatar
Joined: 04 Mar 2010, 21:30
Posts: 373
Location: Florida
Good point. Rather than call ACS_Execute in the death state, then, you could apply a special to it. Then, if I'm not mistaken, apply the THINGSPEC_TriggerActs activation flag to every monster that should make the player taunt. Then, simply change my script above to use ActivatorSound so the sound automatically comes from the player.

One possible obstacle is that monsters may start taunting then. Funny, yes. Practical, no. But considering a flag exists that allows monsters to trigger thing specials, I don't think it's default behavior.


Top
 Profile  
 
 Post subject: Re: Player Taunts Script Help
PostPosted: 19 Jul 2011, 22:05 
Offline
Icon of Sin  O'Neill with it.
User avatar
Joined: 13 Dec 2009, 20:48
Posts: 1164
Location: IN SPACE
You can use [wiki]ClassifyActor[/wiki] to make sure it's a Player.
Douglas Adams wrote:
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.


Top
 Profile  
 
 Post subject: Re: Player Taunts Script Help
PostPosted: 20 Jul 2011, 01:46 
Offline
Chaingunner  We Are The Lamb
User avatar
Joined: 10 Jan 2011, 21:14
Posts: 140
Location: Alberta, Canada
Thanks for all the help you guys! But I'll think I'll stick to Blue Shadow's method for now.
Just one more question. Now I can I get it so that it will play the taunts randomly ? I don't want to have taunts going off all the time. Like, I was thinking about maybe '1 out of 10 kills' of the time, or something like that.


Top
 Profile  
 
 Post subject: Re: Player Taunts Script Help
PostPosted: 20 Jul 2011, 02:36 
Offline
Arachnotron  Really?
User avatar
Joined: 04 Mar 2010, 21:30
Posts: 373
Location: Florida
Terrorized666 wrote:
Thanks for all the help you guys! But I'll think I'll stick to Blue Shadow's method for now.
Just one more question. Now I can I get it so that it will play the taunts randomly ? I don't want to have taunts going off all the time. Like, I was thinking about maybe '1 out of 10 kills' of the time, or something like that.


I'm assuming you have a randomized SNDINFO definition. Just throw in a few blank sounds and blam, cheap random.


Top
 Profile  
 
Display posts from previous:  Sort by  

Post new topic Reply to topic  Page 1 of 2
 [ 16 posts ]  1, 2  


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron