ID:138297
 
I just posted: "If I need a new feature to make my game the way I envision it, by and large it is implemented."

That reminded me of my desire for more power when altering objects during runtime. Specifically, the ability to write new procs and verbs for objects during runtime, and save them in a special kind of file.

My dream was that I could write procs and verbs (with the Dream Maker, or with a new window in the Dream Seeker) that might be derived from ATOMic types but wouldn't be inherited by any of those types in the original .dmb code. These procs and verbs would be in a a .dmx file that I could edit in-game, while it was on the server. Then I could create objects while in-game and attach these "DM extra" procs and verbs to them. Right to the particular object instead of to the type.

Right now, if I want a special room that only allows mobs of a certain weight to enter (for instance), I have to edit my .dm files to create a new /area type, recompile, enter the game, create a new room of that type, save it, then upload the big new .dmb and .sav files to the server.

Not impossible, but not very conducive to pleasing players with special rooms, mobs and items. Plus, it swells the .dmb with a whole new type I'm only going to use once. I can only imagine Cerulea after it's been public for a year... 300 object types used for one item or room each, with their attendant procs and verbs, taking up space in the files. And me with a nervous breakdown from re-uploading a 5meg .dmb every time I want to give a player something like a sword that detects nearby critters when you wave it.

If there were some way to write new procs and verbs during runtime and save them in a separate file, to be easily searched through and attached to objects at will!

There must be some new way of looking at .dm and .dmb files that would allow this. Failing that... is there some new way of looking at DM that would allow me to hack out an approximation in my own code?

Z
If there were some way to write new procs and verbs during runtime and save them in a separate file, to be easily searched through and attached to objects at will!

There must be some new way of looking at .dm and .dmb files that would allow this. Failing that... is there some new way of looking at DM that would allow me to hack out an approximation in my own code?

Well, I don't know about how they could make it work when attaching it directly to a specific reference (despite DM being "untyped" it still does have its limitations), but I asked for attaching it to a specific type a long time ago and haven't heard a word since. Besides which, they'd probably have to make BYOND 3.0 before they could do that. If only they could, though... either that or runtime compiling and updating.

On the subject of customizability, though, s_admin2 is coming out. It lets you edit all variables in an easy-to-read form that displays its current contents, and the current assumed type. If you click the [...] button after a variable, you'll get a new browser window, the edit window. Then clicking the [...] button again brings you back to the variable view window, and updates the variable appropriately. Thus, click, edit, click, view, click, edit, click, view, click, edit, etc.
In response to Spuzzum
On 11/20/00 12:46 pm Spuzzum wrote:
On the subject of customizability, though, s_admin2 is coming out.

What is it?
Anyone? Anyone? Dan?

I'm unsure how much effort I want to invest in Cerulea without some tool of this sort.

Z
In response to Zilal
On 11/24/00 10:19 pm Zilal wrote:
Anyone? Anyone? Dan?

I'm unsure how much effort I want to invest in Cerulea without some tool of this sort.

I've actually given this quite a bit of thought, but haven't come up with a suitable response.

In short, you won't see runtime proc editing in BYOND for some time, because it is, at the very least, a challenging problem and we aren't making even minor changes (aside from bug fixes) at this point.

But that doesn't mean that you can't accomplish this-- at least on a simple scale-- in DM. I'm envisioning a sort of "meta language" done through savefiles. You could start storing vars representing basic properties (much as Dan does in his MUD system) and create new objects by manipulating these properties. You could then move on to managing procs to some degree by having flag vars to associate with the hard-coded events-- is_enterable, etc. I have a somewhat vague notion of how this could be used to make a fairly powerful room generator. I will try to give it some more thought and possibly come up with a prototype.

I think that in general storing objects as tweaks of a few basic prototypes (/obj, /obj/weapon, etc) is probably the way to write the guts of a massive world of this sort. That way your .dmb file can be fairly static while you could add in rooms and objects through savefiles. You give up the full flexibility of custom procs, but perhaps that isn't so bad: a lot can be accomplished with access to simple properties (description) and events (text output).

On the other hand, you'll probably still want things like quests and other complicated procs to be done through DM. Still, updating the binary isn't a major problem, and with the Reboot() event and savefiles you should even be able to do so without interrupting the flow of the game (too much).
In response to Zilal
What is it?

It's a canned Administrator function for debugging your world and handling unruly players, all in one, essentially.

I might add a save feature that adds stuff to a savefile, too.
In response to Tom H.
On 11/25/00 12:22 am Tom H. wrote:
In short, you won't see runtime proc editing in BYOND for some time, because it is, at the very least, a challenging problem and we aren't making even minor changes (aside from bug fixes) at this point.

Well. I will keep it in mind if you will keep it in... uh, yours. I wish I knew more about how compiling worked.

But that doesn't mean that you can't accomplish this-- at least on a simple scale-- in DM. I'm envisioning a sort of "meta language" done through savefiles. You could start storing vars representing basic properties (much as Dan does in his MUD system) and create new objects by manipulating these properties.

Can you give me an example?

I have thought a lot about the possibility of using another language on top of DM... but I haven't made much headway. The idea would be that when a proc was used, Cerulea would search through the src's trigger_list for that proc's name.

obj/verb/kick()
if (trigger_list.Find("Kick"))
Trigger(trigger_list["Kick"])
else Kick()

obj/proc/Kick()
if (!usr.hidden) Desc13("You kick [src]!","[usr] kicks [src]!")
else Desc1("You kick [src] from hiding, alarming everyone!")

obj/proc/Trigger(script)

This proc would search through text files for something like the following, assuming script = "$Kick-Sherrif-1"...

$Kick-Sherrif-1;
{if}(usr-hidden==0) {Desc13}(@You try to kick [src-name], but he cuffs you and drags you to jail!@^@[usr-name] tries to kick [src-name], but he cuffs [usr-name] and drags \him to jail!@);
{if}(usr-hidden==1) {Desc1}(@But he can't even see you!@);
$END


...and obviously there would be a very complicated proc that would read all this, separate everything between the ;'s into different members of a list, go through each one and figure out what it does:

for (i=1,i<=scriptline.len,i++)
var/theline = scriptline[i]
if (findtext(theline,"{if}"))
var/startif = findtext(theline,"{if}") + 5
var/endif = findtext(theline,")")
var/thestatement = copytext(theline,startif,endif)
if (findtext(thestatement,"=="))
var/leftside = copytext(thestatement,1,findtext("=="))
//and so on

I'm not too keen on writing something like this, and anyway it'd be terribly useless if it didn't include the ability to create vars, generate random numbers, and, uh, do everything else DM can do. But a language-on-top-of-a-language is always a possibility, I suppose. Something, something that allows one to "compile" in new bits to a program that's already running. I must get more info on how other systems do this.

Z

[edited] I finally remembered the title of my old posts about this, and went back to look at the "A GM's grail" thread in the General folder. There's a lot of good stuff in there, though I still don't understand it all.