ID:155092
 
hi im trying to make a game sort of like AOE, im having problems with movement, i want the usr to be able to only click on the mob they want to move and then click on the turf they want to move it to. this is my current code:
turf
grass
icon = 'grass.dmi'
Click()
src.move(/mob/mob1)
proc
move(mob/M)
if(M.selected == "yes")
walk_to(M,src,0,5)
mob
var
selected in list("yes","no")
Click()
if(selected == "no")
selected = "yes"
else
selected = "no"
mob1
icon = '1.dmi'
selected = "no"
Click()
if(selected == "no")
src.selected = "yes"
icon = '1s.dmi'
else
src.selected = "no"
icon = '1.dmi'
this code checks out when I compile but when I try to use it in the game it gives me a bunch of error messages, Please help!
first of all use dm tags and next
var/list/SelectedMobs=list()
mob/Army//new mob directory
Member1//First Person
icon='Commander.dmi'//icon
Member2//second person
icon='Person.dmi'//icon
//now for selecting
Click()//Click
if(!(src in SelectedMobs))//checks if src in SelectedMobs
SelectedMobs+=src//if not Add it to SelectedMobs
src.overlays+=new/obj/Overlays/SelectedCharacter//Add Overlays
else
SelectedMobs-=src//if yes then remove it
src.overlays-=new/obj/Overlays/SelectedCharacter//Removes Overlays
//now for move
turf
Click()
for(var/mob/M in usr.SelectedMobs)
M.Move(src)
//you can add Overlay like
obj/Overlays/SlectedCharacter
icon='Select.dmi'
pixel_y=-10//adds it under player icon
In response to Hassanjalil
Thank you so dang much!