hi. i want to know how to make it so that when i attack someone it will add an over lay showing the damage.
i have icons for 0 - 9 in 4 diff posistions. so
0--- 1--- 2--- 3--- 4--- 5--- 6--- 7--- 8--- 9---
-0-- -1-- -2-- -3-- -4-- -5-- -6-- -7-- -8-- -9--
--0- --1- --2- --3- --4- --5- --6- --7- --8- --9-
---0 ---1 ---2 ---3 ---4 ---5 ---6 ---7 ---8 ---9
so where do i go from here? im not sure how to set it up so that it checks the damage them shows the appropriate icons
ID:165868
![]() Oct 22 2006, 4:23 am
|
|
Spawning for no reason, mr. Conj? |
There is a reason, it lets the loop continue through so it can add the rest of the digits for the damage, afterwards it removes the overlay. If sleep was used it would delete each overlay before adding the next.
[EDIT] Unless I missed an indent there, I never was sure if you needed to indent anything you want Spawn to affect, I tested it and it worked so I figured it would be ok with that indentation. |
i tinkered with the code a lil (when i attacked the hud damage appeared on me) so i change src.overlays to M.overlays. rounded the damage and it works great :). thanks for that.
also while we are on the subject of HUD can i ask something else? how do i make an ingame hud? that stays on screen all the time? my mate asked a while back and was given this code client howver whenever we tried to add another piece of the hud it never showed up. |
Cant help ya' there, haven't delt with on-screen stuff for a few years now. Give me a couple of minutes to test the screen commands out and I might have something, though from the sounds of things the reason it didnt show up is because you either
A) Used an invalid icon state, resulting in an invisible icon B) Gave it a screen location that the user cant see. IIRC, by default the screen size is 11x11, that gives you possible positions from 1,1 to 11,11, or maybe it was 0,0, to 12, 12, I forget. |
client this is the code i tried but only the 1st one shows up. |
The Conjuror wrote:
There is a reason, it lets the loop continue through so it can add the rest of the digits for the damage, afterwards it removes the overlay. If sleep was used it would delete each overlay before adding the next. Yep, <code>spawn()</code> requires identation. =) |
obj/Character This is what i use and it works great. |
Assuming you've got that, and the icons are in an icon file called "damage.dmi", try this out;
Most of that is comments so dont be scared by the size. As usual, dont just paste it in and hope for it to work, learn from it.
- Conj'