ID:155671
 
This is what I am wanting to do.

If you have played any of the fallout games you will get this example, when you create a character you can add or subtract from char points and what not. I am having a hard time figuring this out in byond.

Here is a picture of what I hope to somewhat achieve.
http://firsthour.net/screenshots/fallout/ fallout-character-creation-bloody-mess.jpg

So, how can you have separate atoms--in my case objects--alter the icon state of another obj.

Example of how far I get in the code:

obj
test
var/currentNum=3
icon='number.dmi'
numbers

icon_state="3"
proc/updateNum()
switch(currentNum)
if(1)
icon_state="1"
if(2)
icon_state="2"
if(3)
icon_state="3"
if(4)
icon_state="4"
if(5)
icon_state="5"

arrows
Up
icon_state="up"
Click()
currentNum++
updateNum()

Down
icon_state="down"
Click()
currentNum--


The icon states are all numbered, if you notice in the Up arrow object the proc updateNum() and nothing to refer to.

I can't figure out how to get it to talk to the numbers object. I would figure something like

Click(obj/o as obj/test/numbers) // Does not work

I feel I am rambling, please let me know if I need to re-word my question for better comprehension.
I think you would want to do something like this:

client/Click(obj/O) //if they click an obj, and name it O
if(O == /obj/test/arrows/Up/) //if O is the up arrow
var/tmp/obj/test/numbers/N //make a temporary variable named N that is /obj/test/number
N.currentNum++ //add one (N.currentNum++) to N's currentNum variable
N.updateNum(N.currentNum) //call N's updateNum proc and give it N's currentNum variable


This wont work, and I forget how to make N the numbers object...unless you make a new /obj/test/numbers/ at world/New():

world/New()
..()
new/obj/test/numbers //something like this...


Hope this help! :D
In response to Hi1
Haha, you know I never even thought to make it a client Click() function, thanks for the help. This should be what I need to get this part of my program working.

About the only problem I have now is to get the click function to realize what I am clicking on. This is something I am wanting to figure out on my own though.

Once again, thanks for the help.