Say i was to have an icon on the screen that would tell me how much a weapon is upgraded. So far i have;
obj/hud
axe
icon='weaphud.dmi'
if(axelevel=0)
icon_state="axe0"
if(axelevel=1)
icon_state="axe1"
if(axelevel=2)
icon_state="axe2"
if(axelevel=3)
icon_state="axe3"
if(axelevel=4)
icon_state="axe4"
if(axelevel=5)
icon_state="axe5"
if(axelevel=6)
icon_state="axe6"
if(axelevel=7)
icon_state="axe7"
New(client/C)
screen_loc = "6,13"
C.screen+=src
With each different level of axe, the picture on the hud would change depending on what level it is.
How would i do this?
ID:268128
![]() Mar 20 2004, 12:10 pm
|
|
![]() Mar 20 2004, 12:15 pm
|
|
You can't put if statements out in the open like that. They must be inside of a proc or verb. First you need to add the obj to a persons screen, then you call the proc that updates the obj in their screen.
|
ok let me update the code with all the stuff that i have for it.
var axelevel obj/hud axe icon='weaphud.dmi' if(axelevel=0) icon_state="axe0" if(axelevel=1) icon_state="axe1" if(axelevel=2) icon_state="axe2" if(axelevel=3) icon_state="axe3" if(axelevel=4) icon_state="axe4" if(axelevel=5) icon_state="axe5" if(axelevel=6) icon_state="axe6" if(axelevel=7) icon_state="axe7" New(client/C) screen_loc = "6,13" C.screen+=src client/New() ..() new/obj/hud/axe(src) Basically, what i want it to do is change the icon state when the actual weapon has been upgraded. |
To give you a hint of how you need to do this:
mob/proc/Upgrade(obj/O) This is not exactly what you need to do, but its a good example. You should look up the different parts that I used here, and understand what its doing. |