Change music in game after a set frag count

General discussion of the port and Doom-related chat.
Post Reply
Glitchologteam
New User
Posts: 2
Joined: Thu Aug 15, 2013 12:04 am

Change music in game after a set frag count

#1

Post by Glitchologteam » Thu Nov 07, 2013 1:09 am

Hello there, I am looking for a actionscript code to do the following in my Video Game Wad Deatmatch Wad

as soon as semeone get 37 frags , I want the music of the current level to change for another one.

The reason I want to do that comes from the street fighters game, where when semeone is near ko, a more dramatic version of the stage music plays and I want to do the same when 3 frag remain for each map


Thanks in advance!
Last edited by Glitchologteam on Thu Nov 07, 2013 1:11 am, edited 1 time in total.

User avatar
Ænima
Addicted to Zandronum
Posts: 3579
Joined: Tue Jun 05, 2012 6:12 pm

RE: Change music in game after a set frag count

#2

Post by Ænima » Thu Nov 07, 2013 1:27 am

EDIT:
Actually, Qent's is better. I forgot that SetMusic applies to everyone and not just the activator, so no need for two seperate scripts. :v:
Last edited by Ænima on Thu Nov 07, 2013 2:24 am, edited 1 time in total.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Qent
Retired Staff / Community Team Member
Posts: 1424
Joined: Tue May 29, 2012 7:56 pm
Contact:

RE: Change music in game after a set frag count

#3

Post by Qent » Thu Nov 07, 2013 1:39 am

Code: Select all

script 890 DEATH {
  // Go to the thing that killed me.
  SetActivatorToTarget(0);
  
  // If I wasn't killed by a player then do nothing.
  // If there is no fraglimit then do nothing.
  if(PlayerNumber() < 0 || GetCVar("fraglimit") <= 0)
    Terminate;
  
  if(PlayerFrags() >= GetCVar("fraglimit") - 3)
    SetMusic("d_ultima");
}
Assuming you actually use a fraglimit, instead of a hardcoded 40. (I don't know what kind of mod you're doing, but you should probably not hardcode a fraglimit of 40.)
Last edited by Qent on Thu Nov 07, 2013 1:46 am, edited 1 time in total.

Post Reply