I need help adding custom dungeons. I know i supposed to add the map, make it an embedded resource and make a worldclass which i thought i did right but when i try to enter the portal it says it cant load the worldclass. A little help plz.
Obviously it can't load the world class, show us your code or your screenshots or something. We can't just work off of text, you know?
Originally Posted by DevilRotMG
Obviously it can't load the world class, show us your code or your screenshots or something. We can't just work off of text, you know?
I just wanted to add all the prod dungeons like manor and the epic ones, it looks like all the other dungeons.
namespace wServer.realm.worlds
{
public class Manor : World
{
public Manor()
{
Name = "Manor of the Immortals";
ClientWorldName = "{dungeons.Manor}";
Background = 0;
AllowTeleport = true;
}
public override bool NeedsPortalKey => true;
public override World GetInstance(Client psr) => Manager.AddWorld(new Manor());
Furthermore, I am not sure why you have 'public override bool NeedsPortalKey => true' there... Once a player uses the key it should open the dungeon...
Remember to check if when you 'Rebuild' your server that your dungeon files are indeed correct and up to date!
PS: I have only started working with pservers since 3 days ago, but I really want to help where I can
Originally Posted by FlashFlyyy
You have forgotten to give the manor method a 'Dungeon' attribute...
>> Dungeon = True
You really should use a current dungeon cs file as a template, for example using OceanTrench.cs https://prntscr.com/k0m5dhⓘ
Furthermore, I am not sure why you have 'public override bool NeedsPortalKey => true' there... Once a player uses the key it should open the dungeon...
Remember to check if when you 'Rebuild' your server that your dungeon files are indeed correct and up to date!
PS: I have only started working with pservers since 3 days ago, but I really want to help where I can
Improve your knowledge please.
Dungoen = true won't affect whether the dungeon is loading or not.
He already created the map and set it as an embedded resource if you put the effort to read the thread.
NeedsPortalKey is also necessary to point out whether the dungeon is temporary (meaning that once a specific time passes, or someone leaves, it will delete), or it will stay forever. Anyways, try this code.
Code:
#region
using System.Threading;
using System.Threading.Tasks;
using wServer.networking;
#endregion
namespace wServer.realm.worlds
{
public class ManoroftheImmortals : World
{
public ManoroftheImmortals()
{
Name = "Manor of the Immortals";
ClientWorldName = "Manor of the Immortals";
Dungeon = true;
Background = 0;
Difficulty = 4;
AllowTeleport = true;
}
public override bool NeedsPortalKey => true;
protected override void Init()
{
LoadMap("wServer.realm.worlds.maps.Manor.jm", MapType.Json);
}
public override World GetInstance(Client psr) => Manager.AddWorld(new ManoroftheImmortals());
}
}
Obviously, I just wrote this up offline, but try to change it if it gives some errors (most likely with the name). Also, check your portal XML, and what is the dungeon name on that, and match it with the class.
Just hit up a rebuild.
I don't quite know what you did differently but it worked thanks! //solved
Originally Posted by Gnarish
I don't quite know what you did differently but it worked thanks! //solved