ID:145133
 
mob
icon='person.dmi'
var
HP=30
wealth

bug/icon='bug.dmi'

Login()
icon_state=gender
..()

verb
attack(mob/M as mob in oview(1))
if (M.HP <= 0)
usr << "[M] is already dead!"
else
usr << "You attack [M]!"
oview() << "[usr] attacks [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M.HP -= damage
M.DeathCheck()

say(msg as text)
oview()<<"[usr]:[msg]"

proc
DeathCheck()
if (HP<=0)
world<<"[src] dies!"
Del()
var/obj/gold/G = new(loc)
G.amount=rand(1,100)
..()
obj
gold
icon='gold.dmi'
var
amount
verb
get()
set src in view(1)
usr<<"you pick up [amount] gold!"
usr.wealth += amount
del(src)

turf
grass
icon='grass.dmi'

world
turf=/turf/grass



im really new at this as u can tell im doing a tutorial and i need help making gold spawn after the bug dies, if you could help me id appreciate it

[EDIT; gave the bug some wealth.]


I really should suggest reworking this a bit; to have a /mob/Monster and a /mob/Player; but I would assume that is covered in a later example.
obj/gold/
icon//Make sure to give it an icon so the players can see it!
var/goldgive
verb/Get()
src<<"You got [usr.goldgive] gold!"
src.wealth+=usr.goldgive
mob
icon='person.dmi'
var
HP=30
wealth
Monsters/
bug/
icon='bug.dmi'
wealth=200
Del()//when the monster is deleted.
var/obj/gold/G=new
G.goldgive=src.wealth//a variable on the gold, is equal to the monster's wealth.
G.loc=src.loc//sets the Gold's location to the monster.
..()//continues to delete process.


Untested; but is the most generic thing; you really should try to be more specific (ex; should it automaticly be added to the player's gold count, or be dropped?)

Remember to use DM tags, (DM inside of a < and a >)
Just post in this thread if it doesn't work, and I will fix it for you. (remember to be specific.)


I havn't been with a Dream Maker compiler in a while. ;)
In response to Flame Sage
thnx ill try, it works now, thanks everybody.
Everything stops after Del()
In response to Flame Sage
Your Del() proc needs one more indent, if you want that to apply to only the mob/monsters. :)

O-matic
In response to Flame Sage
Flame Sage wrote:
[EDIT; gave the bug some wealth.]


I really should suggest reworking this a bit; to have a /mob/Monster and a /mob/Player; but I would assume that is covered in a later example.
> obj/gold/
> icon//Make sure to give it an icon so the players can see it!
> var/goldgive
> verb/Get()
> src<<"You got [usr.goldgive] gold!"
> src.wealth+=usr.goldgive
> mob
> icon='person.dmi'
> var
> HP=30
> wealth
> Monsters/
> bug/
> icon='bug.dmi'
> wealth=200
> Del()//when the monster is deleted.
> var/obj/gold/G=new
> G.goldgive=src.wealth//a variable on the gold, is equal to the monster's wealth.
> G.loc=src.loc//sets the Gold's location to the monster.
> ..()//continues to delete process.
>

Untested; but is the most generic thing; you really should try to be more specific (ex; should it automaticly be added to the player's gold count, or be dropped?)

Remember to use DM tags, (DM inside of a < and a >)
Just post in this thread if it doesn't work, and I will fix it for you. (remember to be specific.)


I havn't been with a Dream Maker compiler in a while. ;)



When I tried this it gave me 4 errors of Iconstenant indention or something like that
In response to Gaara Uchiha
You copy/pasted off forums. Never copy/paste from these boards. They'll error you.

Replace the spaces with tabs.
In response to Mysame
but that means everything will be all squished like this
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I thought it would mess up if u do that.
In response to Gaara Uchiha
That ain't a tab, is it?

Tab is above shift lock.

PS; They don't display on forums.
In response to Mysame
Okay I did everything right now but it still says I have 1 error
In response to Gaara Uchiha
Then why won't you show us the code and the error? We're not mindreaders.

Though, this might.
In response to Mysame
This is the code I have in

obj/gold/
icon//Make sure to give it an icon so the players can see it!
var/goldgive
verb/Get()
src<<"You got [usr.goldgive] gold!"
src.wealth+=usr.goldgive
mob
icon='person.dmi'
var
HP=30
wealth
Monsters/
bug/
icon='bug.dmi'
wealth=200
Del()//when the monster is deleted.
var/obj/gold/G=new
G.goldgive=src.wealth//a variable on the gold, is equal to the monster's wealth.
G.loc=src.loc//sets the Gold's location to the monster.
..()//continues to delete process.

And it says inconstant indetiton or something like that, its just 1 error though
In response to Gaara Uchiha
In the Del() proc, the last 2 lines seems to be awkward.
In response to Mysame
That dude just lied it dosnt work
In response to Gaara Uchiha
In response to Justin Knight
I didnt copy and paste