A random sentence for a random mind.

RvMp3Player

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar Raven
Skaarj Warlord Skaarj Warlord
Posts: 807
Joined: 12 Nov 2007, 09:39
Location: Nørresundby
Contact:

Subject: RvMp3Player

Post Posted: 09 Feb 2008, 13:48

It's mp3player for UT v.436. It handles both ogg and mp3. Links:

http://turniej.unreal.pl/mp3player/RvMp3Player.zip - player code
http://turniej.unreal.pl/mp3player/RvMp ... Source.zip - source

ReadMe:

RvMp3Player is simple mp3 and ogg player for UT. It's open source so feel free to modify it, but if you want to release modified version, you have to compile it with different name, so it won't conflict with main version. I've a plan to port it to Unreal 1 as well.
Installation

Copy:

* RvMp3Player.dll
* RvMp3Player.int
* RvMp3Player.u
* RvMP3PlayerGame.u

to your UnrealTournament system directory. If you don't have newest fmod.dll (3.74!!), copy it too. Otherwise mp3player won't work.

Usage

In editor open RvMp3Player.u (in Actor Browser), then add RMp3PlayerController (as many as you wish). Then configure RMp3PLayerController:

* MusicDirectory - music directory (not used)
* bMuteModMusic - will mute original UT music if true
* Song - mp3 name (with extension e.g. 01.mp3)
* Action - action (used only when triggered):
o AC_PlayOnStart - will play music on startup
o AC_Stop - will stop music
o AC_Play - will play music (important, if mp3 is loaded, use AC_Switch action)
o AC_Switch - will switch to new track
o AC_ShutDown - will shutdown mp3player (not used)
* PlaType - should music be...
o PT_Loop - looped
o PT_PlayOnce - or played once

RvMp3Player comes with new gametype, to handle save/load actions. But if you want to create your own, here's code which has to be in event PostLogin( playerpawn NewPlayer ):

Code: Select all

      local RMp3PlayerController Mp3PlayerController;
      local RSaveController RCon;
      local RMp3Player JB;
      local bool bMp3Initialized;

      foreach NewPlayer.GetEntryLevel().AllActors(class'RMp3Player',JB)
      {
             JB.StopSong();
             JB.ReadPlayerPawn(NewPlayer);
      }
      foreach AllActors(class'RSaveController', RCon)
      {
             if(RCon.ToPlay != none)
             {
                  Mp3PlayerController=RCon.ToPlay;
                  break;
             }
      }
      Mp3PlayerController.LoadAction();

for incstance:

Code: Select all

event PostLogin( playerpawn NewPlayer )
{
      local RMp3PlayerController Mp3PlayerController;
      local RSaveController RCon;
      local RMp3Player JB;
      local bool bMp3Initialized;

      foreach NewPlayer.GetEntryLevel().AllActors(class'RMp3Player',JB)
      {
             JB.StopSong();
             JB.ReadPlayerPawn(NewPlayer);
      }
      foreach AllActors(class'RSaveController', RCon)
      {
             if(RCon.ToPlay != none)
             {
                  Mp3PlayerController=RCon.ToPlay;
                  break;
             }
      }
      Mp3PlayerController.LoadAction();
      Super.PostLogin(NewPlayer);
}
Madness, as you know, is like gravity…all it takes is a little push!
Image
http://turniej.unreal.pl/portfolio

User avatar Creavion
Skaarj Warlord Skaarj Warlord
Posts: 745
Joined: 12 Nov 2007, 09:43

Subject:

Post Posted: 09 Feb 2008, 21:51

Good job, dude. Nice update with that save and load thing. Seems to work without problems.

I noted one small bug. The Controller spawns ingame some WU over itself a visible dinohead sprite. Well, I don't give a shit, I just wanted to say it.

Well, if you next try to fix that lodmesh bug with your render, it would be really fine. Thanks for the update. :wink:

User avatar Raven
Skaarj Warlord Skaarj Warlord
Posts: 807
Joined: 12 Nov 2007, 09:39
Location: Nørresundby
Contact:

Subject:

Post Posted: 09 Feb 2008, 21:57

Dunno how to fix it. I'm really lame in C++ :P. I'm glad you like it. I'll try to make more optimized version. Delete all unused functions, make Controller better etc.
Madness, as you know, is like gravity…all it takes is a little push!
Image
http://turniej.unreal.pl/portfolio


Who is online

Users browsing this forum: No registered users and 34 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited