ID:175181
 
Is that possible? I rigged up something to test it but I get cannot create objects of null type errors.
My test code:
var/t = "/mob/t"
var/i = 1
while(i != 10)
var/p = t + num2text(i)
new p (locate(1,1,1))
i++
Probably not, although I do seem to remember that Shadowdarke's Dynamic Area Lighting library created new types of areas. Areas are probably just special. =)
I am not totally sure on what you mean here, so, if I am wrong please correct me :)

When Spuzzum was working on EoE for me, as a mapper, he created a simple way to place all the trees on the map at run-time.

He created an "automatic-tree" generation procedure.

By that, I mean, he places a certain part of the tree onto the map, and the rest of the tree gets placed in the relevant places upon run-time.

This saved him alot of work which is good and I thought it was pretty nifty.

Anyhow, if you care to take a look at the source please don't threat to ask, I will post it but Spuzzum should be the one to take full credit if it is what you are looking for...

--Lee
DarkView wrote:
Is that possible? I rigged up something to test it but I get cannot create objects of null type errors.
My test code:
> var/t = "/mob/t"
> var/i = 1
> while(i != 10)
> var/p = t + num2text(i)
> new p (locate(1,1,1))
> i++
>


Im a newbie at coding my self. *chuckles* And I dont even know what an atom is. I would have to say yes and no. Depends on the way you look at it coding wise. All things such as a type must be created from the start you can never make your own type at run time. At least not to my knowledge. How ever you can make refrences of types using the new commands. To actually make a new type of your own at runtime you would have to Edit the code from runtime and then recompile it and reboot the world refreshing with the type information.

*shrugs* I dont know like I said before Im new.
In response to Green Lime
Green Lime wrote:
Im a newbie at coding my self. *chuckles* And I dont even know what an atom is. I would have to say yes and no. Depends on the way you look at it coding wise. All things such as a type must be created from the start you can never make your own type at run time. At least not to my knowledge. How ever you can make refrences of types using the new commands. To actually make a new type of your own at runtime you would have to Edit the code from runtime and then recompile it and reboot the world refreshing with the type information.

*shrugs* I dont know like I said before Im new.

ATOM stands for Area, Turf, Object, Mob. :)

--Lee
Nope, you can't create new atom types at runtime. But the reason you're having this dilemma is your approach is wrong.
var/p = t + num2text(i)
new p (locate(1,1,1))
Obviously DM isn't gonna know in advance what makes /mob/t3 any different than /mob/t7. It looks like you're expecting the number as part of the type path to be siginificant. But if that's the case, then what you really want to do is add an argument to New() and just pass the number that way.
new /mob/t(locate(1,1,1), i)
Then in New() you can use the number however you like.

Also, there's a big big big problem in your code--one that won't show up except in weird circumstances, but if it does it'll be tough to track down:
while(i != 10)
It's a lot safer, since i keeps increasing, to use < instead of !=. But better yet you can cut off three lines from your code just by making all this a for() loop.
for(i = 1, i < 10, ++i)

Lummox JR
In response to Lummox JR
whats run time?
In response to Nave
The moment your game/project is started up in the client. :)

--Lee
In response to Mellifluous
Mellifluous wrote:
The moment your game/project is started up in the client. :)

Actually no. Runtime is the entire time the game is running, not just the instant it starts.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
Actually no. Runtime is the entire time the game is running, not just the instant it starts.

Lummox JR

Ah... Thanks for clearing this up for me :)

As for the runtime, I only thought that is was to do with the project being started up only, but I guess that my guess on this was wrong :D

--Lee