ID:180094
Aug 25 2001, 6:43 pm
|
|
this has more than likly been asked before... but i couldn't find it (i searched back 300 days). I need to know who i could let the user create an obj, only from a certain list of course. all i really need to know is where to begin. i could figure out the rest of what i want, i just need the creation thing i looked at the creat verb in s_admin, and i don't know if that's what i need... please reply if this message is not making sense... i'm tired. |
In response to Alathon
|
|
Alathon wrote:
Nebathemonk wrote: doesnt work, atom types are read only, and must be hard coded |
In response to FIREking
|
|
FIREking wrote:
Alathon wrote: Oh, well, In any case spuzzums GM_Create does most of what youd want Alathon |
In response to Alathon
|
|
Alathon wrote:
FIREking wrote: Well, he could just create a little list, an input, and an action for each item in the list but im sure he doesnt know how to do that yet. and i dont feel like showing him =) |
In response to FIREking
|
|
FIREking wrote:
Alathon wrote: input and lists? like a login class choosing? i could do that, i just don't know how the obj would be created out of nothing... or maybe just moved... |
In response to FIREking
|
|
FIREking wrote:
Alathon wrote: Im just saying, he can look at some of Spuzzums code. You just need to change the M = /mob/[WhichMonster] to this : switch(WhichMonster) // Were now looking at the vars of WhichMonster if("Bat") // If you chose Bat from the list M = new/mob/bat if("Cat") M = new/mob/cat etc etc Also, in the list (var/list/Monsters) change the stuff in list frm mob/bat etc to "Bat", "Cat" so it would look like this var/list/Monsters = list("Bat", "Cat", "etc") Hope that helps |
In response to Nebathemonk
|
|
Easy
just put new /obj/apple(usr) or new /obj/apple(usr.loc) or if you need to change vars of the obj, put var/obj/apple/A = new(usr) A.something = something or var/obj/apple/A = new(usr.loc) A.something = something and you can even go way more into depth with it, those are just some simple ways. |
In response to FIREking
|
|
FIREking wrote:
Easy thanks |
In response to Alathon
|
|
Alathon wrote:
Try this: This is very close but not quite. The creation part would be like this: M = new WhichMonster() This is completely untested, it may or may not work (Note you have to make the mobs in the Monsters list like you do any other mob for it to work |
In response to Alathon
|
|
Alathon wrote:
FIREking wrote: No, you don't. Creating a whole action for each item is a complete waste of time and code. Just do M = new WhichMonster() FireKing is right when he says that atom types are hard-coded, but that has nothing to do with the new command and in no way means that you can't pass a variable value to new. |
In response to LexyBitch
|
|
LexyBitch wrote:
Alathon wrote: Then I was right the first time, as Deadron indicated before, sorry. I almost had it :P i had M = new/[WhichMonster] instead of new WhichMonster() hehe Alathon |
Try this:
// Create a global list of all monsters you want to be able
// To create
var/list/Monsters = list(/mob/bat, /mob/cat, /mob/yeuch)
mob
verb
Create(mob/M)
var/tmp/WhichMonster = input(src,"What monster do you wish to create?", "Pick a monster!") in Monsters // Ask which monster they wish to create by referring to the Monsters list
M = new/[WhichMonster] // Create the monster (the [WhichMonster] has the path)
M.loc = src.loc // Set its location
oview() << "[M] materializes"
This is completely untested, it may or may not work (Note you have to make the mobs in the Monsters list like you do any other mob for it to work
Alathon