ID:167594
 
can anybody give me some insight on how to make it so when your stratego piece attacks another it shows both parties what piece it is...if it is too difficult or impossible to reveal an image() than please give me some insite on how to do that? ihe other pirsons piece, but rihght now it just says what piece it is in the "TEXT" tab...also if i could maybe change it so the piece shows in the text tab that would be great!

EDIT::: my system where it told you what the other piece was does not work anymore...i relized if you put your mouse ove an opponents piece it said ,1,2,ect so ichanged names to "?" and now that is what it says :DMINGMAGE HAS A ? AND ARGORTH_OF_DILLEN HAS A ?

EDIT 2::: Also can some one help with my drag system...i want to makit so the only piece that can be graged in more than 1 tile is the 9 piece...every other piece can only move 1 space but i am using mousedrag so it can go just about anywhere on the map...can you fix that?
Dmingmage wrote:
can anybody give me some insight on how to make it so when your stratego piece attacks another it shows both parties what piece it is...if it is too difficult or impossible to reveal an image() than please give me some insite on how to do that? ihe other pirsons piece, but rihght now it just says what piece it is in the "TEXT" tab...also if i could maybe change it so the piece shows in the text tab that would be great!

If you are doing it like I showed you before then simply output the front image to the other player. I don't recall what the variable was, so I'll just say front_image.
mob/proc/reveal(obj/stratego_piece/O)
src<<O.front_image

Simple as that.

Also can some one help with my drag system...i want to makit so the only piece that can be graged in more than 1 tile is the 9 piece...every other piece can only move 1 space but i am using mousedrag so it can go just about anywhere on the map...can you fix that?

Set a variable to the turf it started on, then use get_dist to see how far away the new location would be.
proc/switch_turn()
turn = turn.enemy //or however you do that
for(var/obj/stratego_piece/O)
O.original_loc = O.loc
obj/stratego_piece
var/max_distance = 1
var/turf/original_loc
piece_9
max_distance = 4
MouseDrag(over_object, src_location, over_location)
if(get_dist(original_loc, over_location) <= max_distance)
loc = over_location

Of course, you also probably have to check for other things, such as direction and blocking units; but I assume you already have that and can work it in.
In response to Loduwijk
i actually did it like this

    proc
piece_owner()
var/A
if(src.color=="red")
for(var/obj/Pieces/red/_1/R1 in world)
A=image('1.dmi',R1,"red")
R1.owner = src.ckey
src<<A

it was easier to manipulate so i could redo it 12 times one for each piece...
In response to Dmingmage
Just give that A variable to the object instead of making it a local variable in the function. Then you can output it to the other player when you need to.