
(v0.5)
Mod Remix Template
Wanna remix songs from other mods? Now you can!
IMPORTANT NOTE!!! If a mod song you're targetting is not initially referenced in script, it will not be loadable until you enter the mod level, in which it may take a load for it to get properly remixed!
Ink_Collectible_ModRemix_Base.uc - The base remix class. Do not edit it, but you must extend it for this to work.
Ink_Collectible_ModRemix_Template.uc - The template class you'll be following, set up for Maximum Metal's songs currently. Paste in each of the target mod soundcues' names, remove the SoundCue'' part of the path name, and surround it with quotes to make it a string. Edit the rest of the remix as normal, localizing it and adding a HUD Icon. Oh, and RENAME THE CLASS FILE!!!
Ink_GameMod_ModRemixes_RENAME.uc - The gamemod, which YOU SHOULD RENAME!!! All you need to do is add all the remixes you're giving out to the array in defaultproperties. It'll handle both giving the remix, and calling the function for the remix to check for the mod soundcues.
collectibles.int - Your localization file. Put it under your mod's Localization > INT folders. Here's what each thing is localized as:
- Ink_ModRemix_Template_Name - The remix's item name.
- Ink_ModRemix_Template_Desc0 - The remix's item description.
- Ink_Collectible_ModRemix_Template - The remix class name, probably can match the localized item name. Used by Maximum Metal.
- TemplateCueForNormalRound, TemplateCueForSpecialRound - The last part of each remix cue's path name. Localize as the song name. Used by Maximum Metal.
class Ink_Collectible_ModRemix_Base extends Hat_Collectible_Remix abstract; var() Array<string> TargetModCueNames; //Refer to the defaults below. var bool NeedsEdit; //This will reset once the game closes, but persist throughout. Basically so we don't have to iterate multiple times a session. static function UpdateTargetCues() { local Ink_Collectible_ModRemix_Base DefaultRemix; local SoundCue AddonCue; local string format; local int i; if (!default.NeedsEdit) return; format = default.class.GetPackageName() $ ".Default__" $ string(default.class); DefaultRemix = Ink_Collectible_ModRemix_Base(DynamicLoadObject(format, default.class, true)); if (DefaultRemix != None) { for (i = 0; i < default.TargetModCueNames.Length; i++) { if (len(default.TargetModCueNames[i]) <= 0) continue; AddonCue = SoundCue(DynamicLoadObject(default.TargetModCueNames[i], class'SoundCue', true)); if (AddonCue != None) { DefaultRemix.TargetSoundCues[i] = AddonCue; DefaultRemix.NeedsEdit = false; } } } } defaultproperties { HUDIcon = None; SupportsRoulette=false; ShouldShowInBackpack=false; NeedsEdit = true; }
class Ink_Collectible_ModRemix_Template extends Ink_Collectible_ModRemix_Base; defaultproperties { //Use these cues to have your music play during the desired round. I recommend having 1 for special and 1 for boss! //"CheezyRevenge_General.Sounds.NormalRound" //"CheezyRevenge_General.Sounds.specialround" //"CheezyRevenge_General.Sounds.BossRound" ItemName = "Ink_ModRemix_Template_Name" ItemDescription(0) = "Ink_ModRemix_Template_Desc0" //Your remix's icon. Maximum Metal will use its default icon if none is specified. HUDIcon = None; SupportsRoulette=false; ShouldShowInBackpack=false; //Format the same as targetsoundcues, but without the SoundCue'', and the rest in quotes. TargetModCueNames(0) = "CheezyRevenge_General.Sounds.NormalRound"; TargetModCueNames(1) = "CheezyRevenge_General.Sounds.specialround"; //The music to play on targetted rounds. Copypaste the path name in as per usual, no quotes needed. RemixSoundCues(0)=SoundCue'TemplateCueForNormalRound'; RemixSoundCues(1)=SoundCue'TemplateCueForSpecialRound'; }
class Ink_GameMod_ModRemixes_RENAME extends GameMod config(Mods); var() Array<class<Hat_Collectible_Remix>> RemixesToGive; defaultproperties { RemixesToGive.Add(class'Ink_Collectible_ModRemix_Template') } event OnModLoaded() { HookActorSpawn(class'Hat_Player', 'Hat_Player'); GiveItem(true); SetTimer(0.01, false, NameOf(EditDefaults)); } event OnModUnloaded() { GiveItem(false); ClearTimer(NameOf(EditDefaults)); } function GiveItem(bool b) { local Hat_Loadout loadout; local int i; loadout = Hat_PlayerController(GetALocalPlayerController()).GetLoadout(); if (loadout == None) return; for (i = 0; i < RemixesToGive.Length; i++) { if (b) loadout.AddBackpack(class'Hat_Loadout'.static.MakeLoadoutItem(RemixesToGive[i]), false); else loadout.RemoveBackpack(class'Hat_Loadout'.static.MakeLoadoutItem(RemixesToGive[i])); } } event OnHookedActorSpawn(Object NewActor, Name Identifier) { if (Identifier == 'Hat_Player') GiveItem(true); } function EditDefaults() { local class<Ink_Collectible_ModRemix_Base> ModClass; local class<Hat_Collectible_Remix> Remix; foreach RemixesToGive(Remix) { ModClass = class<Ink_Collectible_ModRemix_Base>(Remix); if (ModClass == None) continue; //Not a mod remix. ModClass.static.UpdateTargetCues(); } } static final function Print(const string msg) { local WorldInfo wi; wi = class'WorldInfo'.static.GetWorldInfo(); if (wi != None) { if (wi.GetALocalPlayerController() != None) wi.GetALocalPlayerController().TeamMessage(None, msg, 'Event', 6); else wi.Game.Broadcast(wi, msg); } }