View Single Post
  #1  
Old 08-18-2008, 10:43 AM
TrashcanPatrol TrashcanPatrol is offline
Member
 
Join Date: Aug 2008
Posts: 43
Two definitions?

Hello, I am wondering how one can get something like this to work... there's a dropdown list, and when the player selects an item from the dropdown and clicks on an avatar, he 'uses' it on that avatar. I've been having a bit of trouble with this, as I'm using a code similar to this:

Code:
def onList(e):
	if e.object == DropDown and e.newSel == 4 and button == viz.MOUSEBUTTON_LEFT:
	viz.message('You beat the game!')
(Also, should it be 'e.oldSel'?)

Or something like that.
My problem is that I can't get it so that once the player selects something from the list, that he/she can USE it on the enviroment/on avatars. I can get it to print anything if the player selects something from the dropdown, but in order to use in collaboration with the left click, I'd need a different definition for it (i.e. if something is selected and the player clicks with it, then x action happens). Is this the only way to accomplish this, or do you advise something else?
Reply With Quote