ID:157399
 
I'm trying to get the picture of a variable into a turf. See, I made a variable, to randomly get an icon of an object, and then the objects of that variable view in a Tab called battle. But I also want that variable, let's say power1, out of the other 5, into a turf called power11. Any idea how I could do that?
That depends on how you're doing the stuff you described. You should explain it in terms that we can understand, which means preferably in code.

In general though, as long as the variable you are talking about references an icon and you just want the turf to look like that icon, then you can just do "theTurfInQuestion.icon = theVariableInQuestion"
In response to Loduwijk (#1)
Well I've come to another solution. If there was a way to place the variable on the map as a turf, I think it'd work.
In response to Ishuri (#2)
How would i get this to work?

turf
chip1
usr.chip1
In response to Ishuri (#3)
turf
var
chip1
In response to Sorgan (#4)
Still doesn't work. Maybe this will help.

mob
var
list/usedchips=new()

mob/var/OK = new/obj/OK


mob/proc
randomchips()
//picking random chips
var/list/randomchips=new()
var/chip1=pick(usr.contents)
usr.contents-=chip1
usr.usedchips+=chip1
var/chip2=pick(usr.contents)
usr.contents-=chip2
usr.usedchips+=chip2
var/chip3=pick(usr.contents)
usr.contents-=chip3
usr.usedchips+=chip3
var/chip4=pick(usr.contents)
usr.contents-=chip4
usr.usedchips+=chip4
var/chip5=pick(usr.contents)
usr.contents-=chip5
usr.usedchips+=chip5
var/select=pick(usr.OK)
usr.usedchips+=select
if(usr.chiplock())
usr.usedchips-=select
randomchips+=chip1
randomchips+=chip2
randomchips+=chip3
randomchips+=chip4
randomchips+=chip5
randomchips+=select
var/chip_pick = randomchips
//using chips and adding unused chips back to deck
if(chip_pick==chip1)
//use chip1
usr.contents+=new chip2
usr.contents+=new chip3
usr.contents+=new chip4
usr.contents+=new chip5
usr.contents+=new select
if(chip_pick==chip2)
//use chip2
usr.contents+=new chip1
usr.contents+=new chip3
usr.contents+=new chip4
usr.contents+=new chip5
usr.contents+=new select
if(chip_pick==chip3)
//use chip3
usr.contents+=new chip1
usr.contents+=new chip2
usr.contents+=new chip4
usr.contents+=new chip5
usr.contents+=new select
if(chip_pick==chip4)
//use chip4
usr.contents+=new chip1
usr.contents+=new chip2
usr.contents+=new chip3
usr.contents+=new chip5
usr.contents+=new select
if(chip_pick==chip5)
//use chip5
usr.contents+=new chip1
usr.contents+=new chip2
usr.contents+=new chip3
usr.contents+=new chip4
usr.contents+=new select


Is there a way to make the chip variables as a turf?







In response to Ishuri (#5)
I tried doing it your way like this, but it doesn't work.

turf/chip1.icon=usr.usedchips/chip1
Nvm, took me a while but I figured it out. The variable has to go first, so it'd be like.

chip1=/obj/chip1.icon

Thanks for those who tried to help ;D
In response to Ishuri (#5)
First of all, the method you're using for randomly selecting something is very wrong. There's no need to go through all that if you just want one random chip. Just use pick() and be done with it.

Second, nobody is able to understand what you are trying to do. What turf do you want to modify, how do you want to modify it, and what the hell does this have to do with chips?