change cursor - item inventory

  • #10, by lyraWednesday, 17. February 2016, 09:28 8 years ago
    Really Thanks!!! it works :3

    Newbie

    31 Posts


  • #11, by afrlmeWednesday, 17. February 2016, 11:17 8 years ago
    No problem. wink

    Imperator

    7278 Posts

  • #12, by lyraWednesday, 24. February 2016, 13:45 8 years ago
    I have another problem roll
    when I click an object, the character will walk to the object, and if I click anywhere else action is canceled (this is okey)

    but with the characters this don't happens;
    I have to put to go to a position created
    and I have to put the character's alignment I need

    but if I click anywhere the action isn't canceled when the character go to the location,
    just skip this action and conversation is activated with the character misplaced

    How I can do to cancel the action when you click on either side before it gets to talking with the character?

    Thanks again AFRLme

    Newbie

    31 Posts

  • #13, by afrlmeWednesday, 24. February 2016, 20:28 8 years ago
    Did you create an execute destination or immediate action type for the character interaction actions? immediate will try to force the active character (best used with cut-scene or hide cursor actions, to prevent player from interacting with other things on the screen). Execute at destination will only trigger when character arrives at the designated or auto-generated interaction position of said object or npc character.

    Imperator

    7278 Posts

  • #14, by lyraThursday, 25. February 2016, 11:12 8 years ago
    initially i have execute destination, but i change to immediate action and so does the same.

    I put a screenshot so if you see that I do wrong

    Newbie

    31 Posts

  • #15, by afrlmeThursday, 25. February 2016, 11:58 8 years ago
    Quick question: did you remember to close the if queries off with end if action parts? I can't see in the screenshot. You seem to have used 2 if queries, so you need to add 2 end if action parts to the bottom of the last action part in the final if query.

    Quick note: if there are only 2 if queries & they don't need to be specific queries, then you could simply use the else action part instead adding the if value = 2 after the else action part. If the initial query isn't met it will automatically trigger the actions in next.

    Right, onto the interaction stuff...

    Inside of the properties tab for the character, you should be able to specify the interaction position in the scene where the npc is placed - this might be useless though if you plan on having the npc in multiple scenes, or the npc is programmed to walk around the scene it's in pr something. If you don't specify the interaction position then the engine should actually generate an interaction position itself.

    If you are using execute at destination actions you shouldn't need to add any actions to tell the active character where to go, to wait until destination or what alignment to face as it should be automatically taken care of by the engine. Only immediate actions require those things because the actions inside of an immediate action block are executed immediately from wherever the character is currently standing.

    Imperator

    7278 Posts

  • #16, by lyraThursday, 25. February 2016, 12:52 8 years ago
    I had not remembered to close the If
    I put a picture for you to tell me if I closed well


    I didn't know this is there:
    "Inside of the properties tab for the character, you should be able to specify the interaction position in the scene where the npc is placed"

    I have introduced the position and it works! :3 Thaaaanks!

    Newbie

    31 Posts

  • #17, by afrlmeThursday, 25. February 2016, 13:13 8 years ago
    No problem & yes it looks more or less correct, I think. I don't often create complex if queries inside of the editor itself as I find them a little confusing & limiting in comparison to writing them out in Lua script.

    With Lua I have access to and, or & elseif operators which means I don't have to use loads of endif action parts to close off my if queries. Plus they look neater on the whole. wink

    if Values["values-pesc-boton"].Int == 1 then
     -- do something
    elseif Values["values-pesc-boton"].Int == 2 then
     -- do something else
    else
     Values["value-pj-norandom"].Int = math.random(20, 60) -- I can't see what you set in the screenshot
     if Values["value-pj-norandom"].Int == 1 then startAnimation("Animations[Anim-no]")
      elseif values["value-pj-norandom"].Int == 2 then startAnimation("Animations[Anim-no2]")
      else startAnimation("Animations["Anim-no3]")
     end
    end
    

    Imperator

    7278 Posts

  • #18, by stered86Monday, 24. July 2017, 11:50 7 years ago
    Hi! I really like the idea of having custom cursors for every item, so I tried to set this system. 

    Everything works fine, except for one thing I personally don't know how to do: using the classic item dragging method we have the action "on item dropped / [any]" that we can use to set standard reactions (the classic sentences the main character says when the interaction is useless).

    With this particular system, however, I should set an action for every command associated to an item I created, and I think is very unpractical since I have a lot of items in my game. Is there a way I can create a single action telling the engine to use standard reactions for all the commands that shouldn't produce an effect? (for standard reactions I mean the actor saying something like "I don't know how to use that.")

    Newbie

    62 Posts

  • #19, by sebastianMonday, 24. July 2017, 12:24 7 years ago
    yep, thats also possible. Thats how i setup my game. 

    You can use one command, name it e.g. "leftclick", set it as an combinable command . No cursor defined

    Then when executing "leftclick" action on an item use "set item" action part to use the item. 

    Then on items/objects/chars use "execute command 'leftclick' with item XXX. to handle the dropping. 

    So its more it less configured like a classic scumm interface with a specific "drag"action. 

    As for the cursor changing you need a bit lua, which tracks if you have an active item. For this i have to put you on hold a bit... i can post my code this afternoon when im back home again. 
    This code will check at runtime if you are holding an item at the cursor and setting the cursor accordingly to it...

    Thread Captain

    2346 Posts

  • #20, by EinzelkämpferMonday, 24. July 2017, 14:26 7 years ago
    I haven't read through all the posts of this thread, but looking at the initial request - having the dragged item (cursor) looking different than the item in the inventory - there is a very easy way to achieve this (and I believe, it hasn't been mentioned already).

    For your item create two different graphics: one for the inventory, one for the cursor when dragged. Add the first one as a 1-frame animation to your item and the second one as the image file. That should do the trick. No further messing with commands or scripts necessary.

    Newbie

    81 Posts