hey guys i am having trouble when it comes to monsters stats
i was wondering is there a way set general stats per creature "speices" and is there a way for a user to see them when in a few spaces of the creature?
any advise is always appreciated
ID:158837
Jun 22 2009, 6:14 am
|
|
Jun 22 2009, 6:56 am
|
|
Use variables and a verb.
|
In response to Kaiochao
|
|
thanx
|
In response to Kaiochao
|
|
Kaiochao wrote:
Use variables and a verb. I'll give the TC a week before he ditches BYOND after getting too frustrated at helpful advice like this In all seriousness though, read the Guide |
Here's something I used, altered for your specific problem, although it may not be very efficient; I'm quite new myself.
/mob/slime // Define the individual monster icon = 'slime.dmi' // So you can place on map. var/strength = 10 //Vars that only apply to /mob/slime var/defense = 10 var/HP = 10 verb/Monster_Stats set src in oview(1) // Can only use when 1 square away. usr << ("Slime's HP is [HP]!") usr << ("Slime's Str is [strength]!") usr << ("Slime's Def is [defense]!") So, we basically defined the individual monster, assigned it an icon so it can be placed on the map, defined its own individual variables (in this case, stats) and then made a verb that only appears when you are nearby that allows you to "scan" it. You may have to alter it a bit if you copy/paste it. Also, you can categorize it in a "monster" drop-down in your map editor by doing this: "/mob/monster/slime" or the like. If you want to include any variables that are usable by more than just this monster, you have to define them OUTSIDE /mob/slime so they apply to your whole code (a good idea would be to define your player's hp outside, for instance.) ~ Hope it works! |
In response to Ryanzorz
|
|
thanx Ryanzorz thats easy to understand and was very helpfull :)
|
You could also make this part of the AI-system for the monsters. I'm guessing you already have something that checks for a player in range and then reacts to it. use the same method for this. If you want it to show up graphically on the map i.e having a health bar pop-up above the monster etc.. rather than having it as text in whatever output.
This could be something to look in to: http://www.byond.com/members/?command=reference&path=image It probably is more work, but looks better in return. |