ID:138663
 
I seem to be having some problems with using this correctly... maybe I'm doing something wrong, or maybe its just BYOND.

Here are my problems:

In my Generator objects, there is a var that containts the thing to generate. For example, I can do /obj/pileofgold or /mob/littleevilthingthatkillsyou and both work if I set it to that in the code, but if I try to change it through the instance editor, it says it "contains invalid characters" no matter what I change it to... Actually, I can change it to a number, but thats not what I want.

My second problem, also related, is creating a list that is editable through the instance editor. No matter what I do here, I also get the "contains invalid characters" message. Note that I can change mob.contents and lists like that through the instance editor just fine. There shouldn't be any difference here. Is there?
I assume I'm just doing something wrong and don't know about it...

-AbyssDragon
On 4/1/00 7:32 pm AbyssDragon wrote:
I seem to be having some problems with using this correctly... maybe I'm doing something wrong, or maybe its just BYOND.

Here are my problems:

In my Generator objects, there is a var that containts the thing to generate. For example, I can do /obj/pileofgold or /mob/littleevilthingthatkillsyou and both work if I set it to that in the code, but if I try to change it through the instance editor, it says it "contains invalid characters" no matter what I change it to... Actually, I can change it to a number, but thats not what I want.

Oops. This is a bug. I put in some stronger checking to make sure that the instance editor wouldn't accept invalid entries, but I forgot that paths are often valid. Will fix.

My second problem, also related, is creating a list that is editable through the instance editor. No matter what I do here, I also get the "contains invalid characters" message. Note that I can change mob.contents and lists like that through the instance editor just fine. There shouldn't be any difference here. Is there?

Yes, but it's something we should fix. Right now you can edit lists of objects through the instance editor, but not lists of things in general. Well, actually I'm not certain about the latter restriction; I will check. To make an object list, declare the var in the code as:

var/somelist[0] as list

You can specify the other types as well, eg:

var/sometext as text
var/somenum as num
var/somefile as file
var/somechoice in list("A","B","C")

This just puts the appropriate type checking in the instance editor.

I've been meaning to do some real tests on the instance editor, so I'll resolve this and get back to everyone.
In response to Tom H. (#1)
var/somelist[0] as list

You can specify the other types as well, eg:

var/sometext as text
var/somenum as num
var/somefile as file
var/somechoice in list("A","B","C")

Hmmm... I can't seem to get this to work. What I'm trying for is a list of strings (not really necessary for them to be in a list, but it makes things easier for me) to be a mob variable. When I tried
somelist[0] as list
it says "Bad parse type: list".

-AbyssDragon
In response to AbyssDragon (#2)
Hmmm... I can't seem to get this to work. What I'm trying for is a list of strings (not really necessary for them to be in a list, but it makes things easier for me) to be a mob variable. When I tried
somelist[0] as list
it says "Bad parse type: list".

You are right. I gave bad advice! Wait until the next update for this one, as you will then be able to just enter things like list("string1","string2") for the mob var.