ID:174178
 
As stated in my previous message...

I have various "units" that the player can control...I am storing them in the following code;

mob
Unit // Units players can control
MenSoliders
icon = 'mensoldier.dmi'
name = "Men Soldiers"
var
attack = 4
arch = 0
def = 4
moral = 23
move = 4
Wargs
icon = 'warg.dmi'
name="Wargs"
var
attack = 4
arch = 0
def = 2
moral = 26
move = 4

Thanks to some help from JackGuy among others, I am using the following line to call the variables;

for(var/mob/Unit/MenSoliders/MU in Select)
world << "
Attack [MU.attack]"
world << "
Archery [MU.arch]"
world << "
Defend [MU.def]"
world << "
Moral [MU.moral]"
world << "
Movement [MU.move]"

This works great! But how can I now call the Wargs for example. In other worlds, is there any way to make the MenSoldiers in the for line a variable that will look for the proper variable clicked.

Whole section of "call up code" follows;

Click(atom/movable/object,location,turf/A)

// if something is selected
if(Select.len)
// give it/them a destination

world << "Selecting [object] at [object.x],[object.y]"


for(var/mob/Unit/U in Select)
U.destination = object
for(var/mob/Unit/MenSoliders/MU in Select)
world << "
Attack [MU.attack]"
world << "
Archery [MU.arch]"
world << "
Defend [MU.def]"
world << "
Moral [MU.moral]"
world << "
Movement [MU.move]"
else
if(!isturf(A)) // click in statpanel; T is a string here
usr << "[object]"
return ..()

Thanks again,

Mark
OK, figured it out on my own LOL.

DM is so easy, I am trying to make some things harder than they are :)

Mark