ID:2609451
 
Code:
obj
Tile
DblClick()
if(src.icon_state=="Hovered")
walk_to(usr.SelectedUnit,src,0,5,0)
usr.SelectedUnit.TargetTile=src


Crossed(mob/Unit/M)
..()
if(M.TargetTile==src)
walk(M,0)
M.Owner.ChooseAction()

mob
proc
ChooseAction()
world<<src //this line works.
src.name = input("Choose a name for your character.","Your Name",src.name) //Just a dummy switch, but I can't see it.


Problem description: I am creating a turn based tactical game. When the selected Unit walks onto its target tile a switch menu should appear giving the unit's owner a choice of actions to take. For some reason this does not appear. I am sure the game recognizes the owner as I am able to output the Owner.Also I am able to see and use switch menus when I make independent verbs making me even more confused.

Where's the rest of the code? there is no switch() here.
The problem is that you didn't specify the recipient:

input(Recipient=usr,Message,Title,Default) as type in list


You left out the first argument, meaning it uses the default value which is usr.

Also, it's not necessary to write out src.variable every time:

name = input(src, "Choose a name for your character.","Your Name",name)
Thanks Magicsofa, I got bit hasty and used the code from BYOND's help file without looking properly at all the arguments.