ID:168217
![]() Nov 25 2005, 3:10 am (Edited on Nov 25 2005, 3:22 am)
|
|
im not sure how to make monsters drop items at random with very small chance of getting one. Can anyone do a tiny demo to show me how to?
|
![]() Nov 25 2005, 3:35 am
|
|
there are lots of video tutorials here and one covers this subject http://www.riddlersoft.com/ByondPage.htm
|
thaks riddler but thats not exactly what i need and i liiked i cant find any at all anywere in forum libs or demos and i need random drop not drop everytime a monster dies and diffrent drops for different monsters.
|
mob/monster/Death() That should help. |
thanks, that sorta helps but i need somthing to make my monster drop different items like... a slime and a lava slime droping different stuff
|
that's pretty easy here's what i use:
mob/monster/Del() //when the monster dies of course your DeathCheck() proc might be different, but this is similar to what mine looks like |
I'm almost 100% sure I've read something about that in a tutorial on BYONDscape. Which means you haven't read all the tutorials, which you should.
Although if I were you, I'd just skip to the DM Guide, it's more useful on basic things. But all that you have to do is to keep a variable for each monster storing how much gold it'll drop. |
once again thanks but it still wont work... i have one death check for all my monsters. look
mob/proc/Death() if(src.HP<=0) if(src.client) world << "[src] has died!" usr<<"You were killed,robbed and left in the wilderness" src.HP = src.maxHP usr.Gold += round(src.Gold/2) src.Gold -= round(src.Gold/2) src.loc = locate(180,83,1) LevelUp() return else usr.Exp += src.expplus usr.Gold += src.goldplus usr<< "you gain [src.expplus] exp and [src.goldplus] Gold from killing[src]!!" LevelUp() del(src) (indention errors dont exist) i saw a forum on here that used a list to do what i want but when i try to do that i get errors everywhere and dont see anything wrong with code |
here is a simple DeathCheck() modify it how you please.
mob it works fine, though sometimes the moster doesn't get deleted, so just make it so that when you atack, if it is already dead, the usr can't attack it again. |
ok thanks but i have a death check all i need is to use a list procedure to make monsters drop different items at random but the ones i try from other forums give me like 7-15 errors and i dont know how to fix them.
|
ok i made my own... can someone help me with the runtime error though?
proc/Drop(J) usr << "<font color = red>You just found a [J]!" proc/itemdrop(mob/Monster/M) if(M.Slime == 1) var B = rand(1,2) switch(B) if (1) var/obj/MPpot1/J usr.contents += new/obj/MPpot1 Drop(J) if (2) var/obj/Healthpot1/J usr.contents += new/obj/Healthpot1 Drop(J) else return (indention errors dont exist) runtime error: Cannot read null.Slime proc name: itemdrop (/proc/itemdrop) source file: Monster drops.dm,6 usr: Fireweilder (/mob/player) src: null call stack: itemdrop(null) Slime (/mob/Monster/Slime): Death() Fireweilder (/mob/player): Attack() |
here is what mines looks like. i have no idea what you're doing there so try this, it works perfectly. of course you need to change the name of the monster and its icon state. also change the prob. and put dm tags around your code. i also included making monsters drop random amounts of gold and picking up the gold.
mob this has no problems. |
Don't think of usr as the person playing your game in real life.
In a proper DeathCheck(), you should send an argument saying who did the killing (instead of using usr). mob The proper way of calling it would be to do: mob/verb/KillAnyone(mob/M in world) |