How to get an actor name the mouse was pressed on?

Yur4uk

  • Posts: 97
Hi all,

I've created 5 different players, so the user could pick one to play with. I used code for that, not scene editor.
But now I don't know how to get the name of an actor the user clicked the last time. Any ideas on how to do that?

tigerteeth

  • Posts: 733
Create an attribute called "characterselected" and when mouse is pressed on "ben" set actor to "ben".

t4u

  • Posts: 418
Create an attribute called "characterselected" and when mouse is pressed on "ben" set actor to "ben".

+1 but wont work if players are overlapping
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

Fool

  • Posts: 88
Thats more of a design issue. First you have to ask..
   Should I allow overlap?
        -> Yes
              -> Problem solved. Implement given solution
        -> No
             -> Solutions
                   -> 1. Setup the system to return all actors in a given space
                   -> 2. Have actors keep a variable like "MeFirst".  Each time they move reset MeFirst. Have the given
                             actor check for any other actors on the tile they are moving on to.
                              If no actors are present, set MeFirst to true.  Otherwise leave it false.