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++
ID:175181
May 31 2003, 6:09 pm
|
|
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" |
May 31 2003, 7:43 pm
|
|
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. > var/t = "/mob/t" 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. 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 /mob/t(locate(1,1,1), i)
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)
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. 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 |