change cursor - item inventory

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

    Bažant

    31 Posts


  • #11, z afrlmeWednesday, 17. February 2016, 11:17 hodinky 9 years ago
    No problem. wink

    Imperátor

    7285 Posts

  • #12, z lyraWednesday, 24. February 2016, 13:45 hodinky 9 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

    Bažant

    31 Posts

  • #13, z afrlmeWednesday, 24. February 2016, 20:28 hodinky 9 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.

    Imperátor

    7285 Posts

  • #14, z lyraThursday, 25. February 2016, 11:12 hodinky 9 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

    Bažant

    31 Posts

  • #15, z afrlmeThursday, 25. February 2016, 11:58 hodinky 9 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.

    Imperátor

    7285 Posts

  • #16, z lyraThursday, 25. February 2016, 12:52 hodinky 9 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!

    Bažant

    31 Posts

  • #17, z afrlmeThursday, 25. February 2016, 13:13 hodinky 9 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
    

    Imperátor

    7285 Posts

  • #18, z stered86Monday, 24. July 2017, 11:50 hodinky 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.")

    Bažant

    62 Posts

  • #19, z sebastianMonday, 24. July 2017, 12:24 hodinky 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...

    Kapitán

    2346 Posts

  • #20, z EinzelkämpferMonday, 24. July 2017, 14:26 hodinky 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.

    Bažant

    81 Posts