Item dropped triggers left click action

  • #1, z ke4Sunday, 31. July 2016, 11:04 hodinky 8 years ago
    Hi,

    I have a NPC that is outside of wayborders, therefore i had to use IMMEDIATE left click action instead of Execution at destination, but while i want to use an item at the NPC ( also IMMEDIATE action ) it always triggers the left click action and not the Item dropped action.
    Is there something i can do about it?
    Thanks.

    Zabiják klíčů

    810 Posts


  • #2, z afrlmeSunday, 31. July 2016, 12:26 hodinky 8 years ago
    You can actually specify a custom interaction position for characters. Inside of the properties tab under characters is an option called: position for executing an action, which allows you to specify a custom position the active character should walk to before executing an executed at destination command / item drop, which means you can set the execution at destination position inside of the way border.

    P.S: you should refrain from using "left click (immediate)" actions inside of your objects & characters as it seems to take precedent over all over actions. Instead use a command "whatever your default command is called" executed (immediate) action, but only if it's not possible to use an at destination command type.

    Imperátor

    7285 Posts

  • #3, z ke4Sunday, 31. July 2016, 12:47 hodinky 8 years ago
    Oh, nice. I had no idea about that. Thanks.

    I'm ussing the left click immediate actions only exceptionally.
    It's always left click command executed at destination + double click immediate that only set character to the object and calls the left click action.

    It remainds me is there some way to have a double click ( skiping the walking ) for using an item?

    Zabiják klíčů

    810 Posts

  • #4, z afrlmeSunday, 31. July 2016, 12:56 hodinky 8 years ago
    Probably... You could probably check if an item is currently held, store said item inside of a variable, save the object you clicked on to memory, teleport the character to said object, set the item you stored in the variable back into your hand & then drop said item on saved object - well in theory anyway... I've not tested it out before.

    What I do is teleport the active character to an objects execution position whenever I double click on an object or npc character & then I have it execute my "left_click" executed at destination command for said object.
    startAction(game.SavedObject.ObjectActions["'left_click' executed"])
    

    hmm, I guess you should be able to execute anything then, but I don't know how it would react if you tried executing an action that doesn't exist in the actions associated with saved object. Would be interesting to see if it returns an error in the log or returns a unsuccessful comment from your active characters comment set instead.

    Imperátor

    7285 Posts

  • #5, z ke4Sunday, 31. July 2016, 13:26 hodinky 8 years ago
    Well it's exactly the same for me. Only thing is that i'm doing it manually for each object like that.

    Set character "Current character" to object "object name"
    Call action "leftclick" executed
    



    I guess you put this line of code inside of the double click action under the mouse properties in the main game menu? + the teleporting thing.
    That's where i have my regular teleporting to any position inside of wayborders.
    And i suppose that would be solution for not having to doing it manually fo each object.

    Well i'll try that and i'll see what's about to happen.

    Zabiják klíčů

    810 Posts

  • #6, z afrlmeSunday, 31. July 2016, 13:37 hodinky 8 years ago
    No... I added it inside of a double click immediate action for each object. I then have it execute a called by other action which saves the object to memory & then teleports character to scene object / character interaction position then executes the "left_click" action associated with the saved object.

    I only wanted it to be executed when I want it to be executed. Adding it to the double click action under mouse properties tab was a bit too global.

    All I do is copy/paste in the double click action whenever I create a new scene object / character, so it's not that much work really.

    Imperátor

    7285 Posts