ID:153677
 
I'm currently working on a way to dynamicaly load item into byond games after the server has already been intialized.

Has anyone else done anywork in this area?

-Salarn
Salarn wrote:
I'm currently working on a way to dynamicaly load item into byond games after the server has already been intialized.

Has anyone else done anywork in this area?

I'm not aware of any such projects, but it's been discussed before that for MMORPGs and such it makes sense to dump off as much data into dynamic files as possible.

The simplest way is to have a standard monster type, load it up with every var your system will ever need for monsters, and then create a savefile (or savefile-formatted text file) with modifications for the various monsters:
goblin
strength = 4
dexterity = 3
intelligence = 1
maxHP = 20
nymph
gender = "female"
strength = 2
dexterity = 7
maxHP = 16
skill = list(/mob/proc/M_MoveItem, 0, /mob/proc/Random, 1)
That last bit is just an example of a rudimentary dynamic code system; you could come up with others much more sophisticated.

You should be able to loop through a savefile formatted like this and load up data for any monster type you want to spawn. (Naturally the same idea works for weapons, armor, etc. You could even adapt it to include instructions for dungeon or town building algorithms.) The proc might look something like this:
mob/monster
proc/Generate(savefile/S, monstertype)
S.cd = monstertype // for example, "/ghost"
for(var/V in S.dir)
S[V] >> vars[V]
Initialize() // perform other tasks, like HP=maxHP and so on

Lummox JR
Salarn wrote:
I'm currently working on a way to dynamicaly load item into byond games after the server has already been intialized.

Has anyone else done anywork in this area?

The XML library is for just this sort of thing:

http://www.byondscape.com/ascape.dmb/Deadron.2003-0517/
In response to Deadron
I really need to get 10 dimes so i can subscribe to byond so i can download that XML lib.
In response to Jinjo21
Make a submission...I did.
In response to Jotdaniel
What are the things you need to do for your lib to be eligible for submission?
In response to Deadron
Ah XML, a bitter mistress.

Thanks Deadron, I'll give it a read through.

-Salarn
In response to Jp
It has to be good... and useful... and stuff. =)

These links might help a bit more than my inane comments:

http://www.byondscape.com/ascape.dmb/Staff.2002-0210/

http://www.byondscape.com/ascape.dmb/Gazoot.2003-0116/