ID:264719
 
Code:
obj
Bubble_Breath
icon = 'Player.dmi'
icon_state = "bubble"
mob
verb
Bubble_Breath(mob/M as mob in get_step(src,src.dir))
set category="Attacks"
if(istype(M,/mob/))
var/damage= rand (1-25)
if(damage <= 0)
damage = 1
M.hp-=damage
range()<<"[usr] blew a mouthfull of bubbles on [M] inflicting <font color=red>[damage]</font> damage!"
else
return


Problem description:

It doesn't show the icon, please help. I'll try a brand new code if I have to. Thanks. :]
If I'm reading right. I believe your wanting the Bubble_Breath icon to appear on M? If this is the case then you forgot to tell it to show it.

You can't just expect the icon to show up without you inviting it to the party.
In response to Nate1123
Yeah, but what's the code to make it show, sorry I'm very new to this. How do you make it show?
In response to Typical Tylur
That would depend on how you want it to act. If you want it to spawn on their location or look like a projectile then you could create a new instance of the obj at the specified loc, or if you want it as an overlay it would stay on top of the player until you decide to delete it. I'm going to guess that you want the latter and for that look up overlays in that neat-o help file they give you.

//The object that is getting shot/added w/e
obj
projectile
icon='projectile.dmi'
density=1
Bump(A) //This is done whenever the obj hits something
if(ismob(A)) //If it is a mob
var/mob/M = A
var/damage = rand(1,25) //Tells how much damage to do
M.hp -= damage //Subtracts the damage from the health
del src //Tells the obj to delete itself

//Verbs do stuff when clicked
mob
verb
Shoot_Projectile() //Shoots the projectile in the direction of usr
var/obj/projectile/A = new(usr.loc) //Creates a new obj on the shooter's location
walk(A,usr.dir,2) //Moves the obj in the direction of the usr (obj, dir, lag)


mob
verb
Add_Projectile_Overlay(mob/M in view()) //Adds the projectile to the target's overlays
M.overlays += 'projectile.dmi' //Add the overlay
var/damage = rand(1,25) //Random damage
M.hp -= damage //Subtracts health
sleep(50) //Waits 5 seconds
M.overlays -= 'projectile.dmi' //Remove the overlay


Sorry if this contains errors I'm not at a computer in which I can install BYOND at the moment.

*Edited to contain code, please don't copy-pasta then ask why it isn't working in your game try to understand it.
In response to Nate1123
Instead of having extra /obj's that aren't needed, use plain overlays. As in overays += 'ThisIcon.dmi' .
In response to Maximus_Alex2003
Yes you could do plain overlays for the second part, but I don't think you can do projectiles like that. I was just reusing the obj since I had already made it.
In response to Nate1123
Nate1123 wrote:
Yes you could do plain overlays for the second part, but I don't think you can do projectiles like that. I was just reusing the obj since I had already made it.

The thing he wants doesn't even involve projectiles.
It appears that he wants just straight up visual affects since he specifies
mob/M as mob in get_step(src,src.dir)
, thus why would you want to create a useless projectile obj to appear if it's only going to travel 1 step?

Remove the need for projectiles and objects completely. Stick with JUST overlays as .dmi's.
Oh and, why would you even add a movable /obj to their overlays?
Overlays is a list of images tagged onto the atom. They don't serve any purpose except visual, so having said projectile go into an image list is again, useless.
In response to Maximus_Alex2003
I shall escort myself out of this forum, no need to call the security guard. I can see my attempted help is not wanted.

=)
In response to Nate1123
No, it's very nice to have helping hands.
I'm just helping you help them. ;)
In response to Maximus_Alex2003
It was a pretty bad joke. I can see the mistake, and good thing you caught it before he used it.