How to: Create a ContentPack

How to: Create a ContentPack

nilllzz

Kolben Developer
Administrator
P3D Developer
#1
nilllzz submitted a new resource:

How to: Create a ContentPack - A complete walk through on how to create a ContentPack.

1. What is a ContentPack?
At first, lets start with the basics: What is a ContentPack?
A ContentPack is a bundle of files stored in a folder in the Pokemon\ContentPacks\ directory that can change:
  • Music
  • Sounds
  • Textures
in the game.
One can have multiple ContentPacks activated and they replace the content that they find.
Content Packs are essentially a way to customize the game experience without altering any game features. All changes done by...
Read more about this resource...
 
J

jianmingyong

Guest
#3
The first time I did the font, I though it do not work since it do not change when you press apply but when I test it by closing and open again. It work :p
 

Tornado9797

Content Developer
P3D Developer
Global Moderator
#5
I tried adding a backdrop to my pack, but it ended up crashing my game:
Code:
Kolben Games Crash Log V 2.1
Pokémon 3D has crashed!
//Missingno.

---------------------------------------------------------------------------------

Game information:

Pokémon 3D Indev version: 0.46.2
Content Packs: {}
Active GameMode: Pokemon 3D
GameJolt Account: FALSE
Playing on Servers: FALSE
Game Environment: MainMenuScreen
Actionscript: No script running
File Validation: True

---------------------------------------------------------------------------------

System specifications:

Operating system: Microsoft Windows 8.1 [6.2.9200.0]
System time: 4/21/2014 7:02:52 PM
System language: English (United States)(ENU) / Loaded game language: en
Decimal separator: .

---------------------------------------------------------------------------------

Graphics Card information:

[CardName(s): "AMD Radeon HD 8570D"]
[CardRAM(s) : "805306368"]

---------------------------------------------------------------------------------

Error information:

Message: An unexpected error has occurred.
InnerException: NOTHING
BaseException: An unexpected error has occurred.
HelpLink: No helplink available.
Data: Items: 0
Source: Microsoft.Xna.Framework.Graphics

---------------------------------------------------------------------------------

Error solution:
(The provided solution might not work for your problem)

Error ID: -1
Error Type: NaN
Error Description: The error is undocumented in the error handling system.
Error Solution: NaN

---------------------------------------------------------------------------------

CallStack: 

   at Microsoft.Xna.Framework.Graphics.Texture2D..ctor(GraphicsDevice graphicsDevice, Stream stream, Int32 width, Int32 height, XnaImageOperation operation)
   at Microsoft.Xna.Framework.Graphics.Texture2D.FromStream(GraphicsDevice graphicsDevice, Stream stream)
   at _2._5DHero.MainMenuScreen.ButtonPackInformation()
   at _2._5DHero.MainMenuScreen.UpdatePacksMenu()
   at _2._5DHero.MainMenuScreen.Update()
   at _2._5DHero.Basic.Update(GameTime gameTime)
   at _2._5DHero.DGame.Update(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.Tick()
   at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
   at Microsoft.Xna.Framework.GameHost.OnIdle()
   at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
   at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
   at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at Microsoft.Xna.Framework.WindowsGameHost.Run()
   at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
   at Microsoft.Xna.Framework.Game.Run()
   at _2._5DHero.Program.Main(String[] args)

---------------------------------------------------------------------------------

You should report this error.

Go to "http://pokemon3d.net/forum/forums/6/create-thread" to report this crash there.
 

nilllzz

Kolben Developer
Administrator
P3D Developer
#6
I tried adding a backdrop to my pack, but it ended up crashing my game:
Code:
Kolben Games Crash Log V 2.1
Pokémon 3D has crashed!
//Missingno.

---------------------------------------------------------------------------------

Game information:

Pokémon 3D Indev version: 0.46.2
Content Packs: {}
Active GameMode: Pokemon 3D
GameJolt Account: FALSE
Playing on Servers: FALSE
Game Environment: MainMenuScreen
Actionscript: No script running
File Validation: True

---------------------------------------------------------------------------------

System specifications:

Operating system: Microsoft Windows 8.1 [6.2.9200.0]
System time: 4/21/2014 7:02:52 PM
System language: English (United States)(ENU) / Loaded game language: en
Decimal separator: .

---------------------------------------------------------------------------------

Graphics Card information:

[CardName(s): "AMD Radeon HD 8570D"]
[CardRAM(s) : "805306368"]

---------------------------------------------------------------------------------

Error information:

Message: An unexpected error has occurred.
InnerException: NOTHING
BaseException: An unexpected error has occurred.
HelpLink: No helplink available.
Data: Items: 0
Source: Microsoft.Xna.Framework.Graphics

---------------------------------------------------------------------------------

Error solution:
(The provided solution might not work for your problem)

Error ID: -1
Error Type: NaN
Error Description: The error is undocumented in the error handling system.
Error Solution: NaN

---------------------------------------------------------------------------------

CallStack:

   at Microsoft.Xna.Framework.Graphics.Texture2D..ctor(GraphicsDevice graphicsDevice, Stream stream, Int32 width, Int32 height, XnaImageOperation operation)
   at Microsoft.Xna.Framework.Graphics.Texture2D.FromStream(GraphicsDevice graphicsDevice, Stream stream)
   at _2._5DHero.MainMenuScreen.ButtonPackInformation()
   at _2._5DHero.MainMenuScreen.UpdatePacksMenu()
   at _2._5DHero.MainMenuScreen.Update()
   at _2._5DHero.Basic.Update(GameTime gameTime)
   at _2._5DHero.DGame.Update(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.Tick()
   at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
   at Microsoft.Xna.Framework.GameHost.OnIdle()
   at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
   at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
   at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at Microsoft.Xna.Framework.WindowsGameHost.Run()
   at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
   at Microsoft.Xna.Framework.Game.Run()
   at _2._5DHero.Program.Main(String[] args)

---------------------------------------------------------------------------------

You should report this error.

Go to "http://pokemon3d.net/forum/forums/6/create-thread" to report this crash there.
Just tried it with a random .png file and it works fine. Are you sure its a .png file that you didn't rename from for example a .jpg?
 

nilllzz

Kolben Developer
Administrator
P3D Developer
#10
I used that term very loosely... I just changed the extension through renaming it. It appeared to work, as I opened a png viewer and it worked perfectly in there.
Exactly what I expected.
File extensions don't define the file type. They are just used by operating system so they know which program to use when you want to open the file.
It works with the image viewer you used because they can open both, png and bmp.
But internally, the file is still a bitmap file.
That is why P3D crashed trying to load it: It cannot load bitmap files.
 

Tornado9797

Content Developer
P3D Developer
Global Moderator
#11
Exactly what I expected.
File extensions don't define the file type. They are just used by operating system so they know which program to use when you want to open the file.
It works with the image viewer you used because they can open both, png and bmp.
But internally, the file is still a bitmap file.
That is why P3D crashed trying to load it: It cannot load bitmap files.
Okay, maybe I'll find some other way to make a png...though I don't want to make my background again: it took a long time to make.

You might want to add my issue to the guide in case others encounter it.
 

nilllzz

Kolben Developer
Administrator
P3D Developer
#12
Okay, maybe I'll find some other way to make a png...though I don't want to make my background again: it took a long time to make.

You might want to add my issue to the guide in case others encounter it.
I'll actually add an exception thrower in the program itself. And you can just open it in Paint (or any other image editing program) and export it as .png. As I said: Internally, the file stays the same when you rename it. Image files have headers that define their file type and content inside the file, and because P3D expects a .png header when it opens the bitmap file, it crashes.
 
#14
Hi everyone! I want to create a custom content pack but when I try to convert the original xnb files to png with xnb exporter it crashes, do you have any suggestions?
PS I used other tools and they didn't work either
 
Top