Dynamic Maps

08/21/2013 13:33 Aceking#1
I have spent the last couple days on this and just don't seem to be getting anywhere.
I am using the Albetros 5518 source, and forgive me for not posting it in there but I feel there are numerous people around who could help so creating a new thread will get the exposure from them.

I have dynamic maps working, I can create one, teleport to it, even add an NPC there.
But I am having a terrible time trying to add spawns, and also modifying the portals.

I cant do Map.Insert(new Monster(monster info)) because it generates object reference not set errors.
And Monster.Generate doesnt work either.

So can anyone give me any pointers or ideas on what needs to be done here?

Much appreciated
08/21/2013 14:16 Super Aids#2
[Only registered and activated users can see links. Click Here To Register...]

Contains a full implementation of Dynamic Maps.
08/21/2013 23:58 Aceking#3
Quote:
Originally Posted by Super Aids View Post
[Only registered and activated users can see links. Click Here To Register...]

Contains a full implementation of Dynamic Maps.
I havent looked at it yet, but i definitely will pretty quick here when i get some time hopefully this evening.
Just wondering how much of the map classes and system is based off of the Albetros source and how easy it would be to implement it into the Albetros source I am using.
08/22/2013 00:04 pro4never#4
It should work just fine with dynamic maps. You have an instance of a map and you then need to create (and track) the isntance of a monster spawn.

The issue will be disposing of the spawns when the map is no longer needed but that's all pretty simple if you just query spawns by map ID and then remove them when you're done with the map.


Look in the source about how it creates new monster spawns from the spawn database. You will have to come up with a way to handle adding these spawns as you create the maps and NOT via the spawn database (as these spawns are ONLY used when that specific dynamic map is in use)

Best of luck!


<edit>

Albetros had a fully working dynamic map system. The issue is just you needing to create a new spawn (while creating the new dynamic map) and then tracking/removing it as needed.
08/22/2013 04:19 Aceking#5
Quote:
Originally Posted by pro4never View Post
It should work just fine with dynamic maps. You have an instance of a map and you then need to create (and track) the isntance of a monster spawn.

The issue will be disposing of the spawns when the map is no longer needed but that's all pretty simple if you just query spawns by map ID and then remove them when you're done with the map.


Look in the source about how it creates new monster spawns from the spawn database. You will have to come up with a way to handle adding these spawns as you create the maps and NOT via the spawn database (as these spawns are ONLY used when that specific dynamic map is in use)

Best of luck!


<edit>

Albetros had a fully working dynamic map system. The issue is just you needing to create a new spawn (while creating the new dynamic map) and then tracking/removing it as needed.
I managed to figure quite a bit out, eventually managed to spawn a single monster which would have been problematic to create 100+ monsters.

My problem came in the Generate function of the spawn class, with the dmaphandler.check location section.
I think I was creating the dynamic map wrong anyways as I didn't see where I could change the portal information.

I was just attempting to create a dynamic map for the basilisk/alien serpent map.
So rather than creating and managing a dynamic map, I simply copied the AC2 dmap and smap files and gave it a new ID. This works just fine as these maps are going to always be needed and not disposed of so it would be easier to track spawns through the database.

I have code that creates dynamic maps incase i want to have PK tournaments or special maps with limited monsters/bosses

I appreciate the info tho pro4never, im getting the source close to a very early 2.0 classic server and making alot of progress. Though I am sure I will have many more questions, I can think of a couple off the top of my head but I will wait until I start to code those things before I ask any questions.

Thanks again
08/22/2013 09:05 pro4never#6
I wouldn't suggest using it if you want a more classic feel.

5065 or 5095 are ideal if you want an 'early co2 experience'. Redux is a very basic but stable 5065 source I posted and there's a TON of 5095 resources (if a bit messy).

Something to consider if you're already planning to do significant work. If not albetros should work as a fine base (assuming you fix up some of the... inefficiencies in it. Mostly the threading ahaha)
08/22/2013 12:35 Aceking#7
Quote:
Originally Posted by pro4never View Post
I wouldn't suggest using it if you want a more classic feel.

5065 or 5095 are ideal if you want an 'early co2 experience'. Redux is a very basic but stable 5065 source I posted and there's a TON of 5095 resources (if a bit messy).

Something to consider if you're already planning to do significant work. If not albetros should work as a fine base (assuming you fix up some of the... inefficiencies in it. Mostly the threading ahaha)
Im not going for a truly authentic classic server, there are some things id like to keep and some I wouldnt, so I think the albetros source should work just fine, but I may check out Redux and see what it has and what it is missing.

Honestly im just looking to branch out from my native VB.net, so C# seemed like a good idea and working on a private server keeps me interested :)