I was wondering if you can make an object so, when clicked, will start producing random monsters. I was thinking this:
obj/thingy
icon = the icon
icon state = the iconstate
Click()
loopthingieproc()
mob/proc/loopthingyproc()
sleep(20)
var/pie
var/whatever = rand(1,20)
if(whatever == 1) pie = new /mob/monsterone
if(whatever == 2) pie = new /mob/monstertwo
loopthingyproc()
I think I've got the right idea, as long as I make twenty "if(whatever == ...)" things, but I'm not sure. if this is at all possible, then reply, obviously, and if it's impossible, tell me and don't call me names and say "Haha. you idiot. that doesn't work" or I'll have to do something really bad to you!
ID:175561
Apr 7 2003, 11:19 am
|
|
In response to Gughunter
|
|
If I wanted to give a random name to it, where would I put the text line? I know the line should be sort of like:
MonsterType.name = pick("Bob","Jim","Alfredo") I'm just not sure where the line goes, nor what I put instead of MonsterType, because I got an error whereever I put that. (on't worry, I made sure I don't have 50 monsters with 3 differant names, I have more like 54 names) |
In response to CoWdUdE7
|
|
CoWdUdE7 wrote:
If I wanted to give a random name to it, where would I put the text line? I know the line should be sort of like: Hmm maybe you could include AD's Name Gen. to make random names that would be cool thats what Im doing for my rpg :). Also with the name thingys in my game I havent gotten this far but If I had to guess which I am :) I think u need to use an arg list with an index values and give the type a value like a name. |
In response to Green Lime
|
|
I have the names I want to use, but I just needed to know where to put them in the code. I basically used the code that the other guy gave me, but I deleted the "If(active)" thingamajiggers and changed the sleep(300) to sleep(100) (though I know that's not a problem).
|
In response to CoWdUdE7
|
|
Change pie.name. And also, change var/pie to var/mob/pie.
|
turf/generator
var/active = 0
var/monsters = list(/mob/skeleton, /mob/zombie, /mob/rat)
New()
spawn Generate()
Click(mob/M)
//toggle the generator when clicked
if(active) active = 0
else active = 1
proc/Generate()
while(src)
if(active)
var/monsterType = pick(monsters) //pick a random type from the list
new /monsterType(src)
sleep(300) // sleep 30 seconds