ID:151129
 
1)OK, I got bump working, but i was wondering, say I have stats like HP and stuff, would this work?
mob/Pirate3
Bump(obj/O)
switch(O.type)
if(/obj/Booie) icon = 'Boat.dmi'
AddHP += 5
this won't work but the idea is that when you bump into this object, it adds to yer stats.
2)Also is there a way I can make it so when you pay a mob, he moves then moves back in say 3 seconds?
3)For some reason my stats bar wont' work, I used code from my other game where it works fine and it all compiles fine, but when I run the game it says stats in white for a second, then inventory appears over it and stats is no where to be found!!! Anyone know how this could have happened?
Thanks, Thanks, and Thanks
Gilser
1)OK, I got bump working, but i was wondering, say I have stats like HP and stuff, would this work?
mob/Pirate3
Bump(obj/O)
switch(O.type)
if(/obj/Booie) icon = 'Boat.dmi'
AddHP += 5
this won't work but the idea is that when you bump into this object, it adds to yer stats.

This looks more or less correct. Remember that since setting the icon and incrementing AddHP are both results of the "if", they should both be indented under the "if" like so:

if(bla)
icon stuff
hp stuff


2)Also is there a way I can make it so when you pay a mob, he moves then moves back in say 3 seconds?

One way to do it would be to give the mob a "wander" mode. Sort of like this (warning: untested!):

mob
var/mode = "none"
var/stopWanderingTime
var/turf/returnLoc

New()
. = ..()
spawn Think()

proc/StartWandering()
stopWanderingTime = world.time + 300
returnLoc = loc
mode = "wander"

proc/Think()
while(src)
if(mode == "wander")
if(world.time >= stopWanderingTime) mode = "return"
else step_rand(src)
if(mode == "return")
step_toward(src, returnLoc)
if(get_dist(src, returnLoc) <= 1) mode = "none"

sleep(4)



3)For some reason my stats bar wont' work, I used code from my other game where it works fine and it all compiles fine, but when I run the game it says stats in white for a second, then inventory appears over it and stats is no where to be found!!! Anyone know how this could have happened?

Don't know about that one!
2)Also is there a way I can make it so when you pay a mob, he moves then moves back in say 3 seconds?

think you can do this, when he is payed a proc is called wich makes him walk away a little bit, then use Spawn() to have him wait there for some time, and then have him walk back.

doesn't that work?