Dragged items scaling

  • #10, by afrlmeMonday, 17. November 2014, 21:11 10 years ago
    Whatever you named the cursor? grin

    But good point as there is both active & inactive animations for each cursor. The names have a prefix on the end. cursor_name (active) or cursor_name (inactive)

    -- function to be added as a definition script
    function setCF(n, f)
     if ActiveAnimations[n .." (active)"]:getBool(VAnimationActive) then
      ActiveAnimations[n .. " (active)"].AnimationFirstFrame = f
      ActiveAnimations[n .. " (active)"].AnimationLastFrame = f
     elseif ActiveAnimations[n .." (inactive)"]:getBool(VAnimationActive) then
      ActiveAnimations[n .. " (inactive)"].AnimationFirstFrame = f
      ActiveAnimations[n .. " (inactive)"].AnimationLastFrame = f
     end
    end
    

    -- example usage
    setCF("default", 1) -- will set frames of currently active animation of cursor "default" to 1
    

    ...the function I have just written queries if cursor names animation you just entered is currently the active or inactive animation; if neither then do nothing.

    Hopefully you understand what I just did? I would have made it simpler but there's no tables in the data structure for returning currently active game cursor or cursor state, hence why I used the AnimationActive query instead.

    Quick note: as soon as the cursor state changes the animation will reset back to normal. So it might be an idea to create a value which will be used to determine which frame should play & then add the ActiveAnimation... first/last frame scripts to the first frame of the animations themselves.

    Imperator

    7278 Posts


  • #11, by EldarionIITuesday, 18. November 2014, 10:34 10 years ago
    Thanks A LOT! smile

    Yes I got it now. There was an extra problem (I used Cyrilic alphabet to name cursors) but now it's OK!

    Yes I've already created special value for items and frames.

    I am polishing our demo right now. I'll show it quite soon. Hope you'll enjoy it!

    Newbie

    18 Posts

  • #12, by afrlmeTuesday, 18. November 2014, 11:52 10 years ago
    Nice one. smile

    Ah I take it that the scripts/engine weren't too keen on Cyrillic?

    Imperator

    7278 Posts

  • #13, by EldarionIITuesday, 18. November 2014, 14:48 10 years ago
    Yes, as soon as I renamed cursor it began to work. smile

    Btw, I have enother scripiting problem now.

    Upon right clicking on any item our hero gives comment about it. Right now it is above her (green).
    I'd like to force it to red zone every time she gives comment about itmes in inventory. There are way to do so without scripting but it's too complicated!

    P.S What do you think about visual style? =P

    Newbie

    18 Posts

  • #14, by afrlmeTuesday, 18. November 2014, 16:12 10 years ago
    Looks pretty nice to me, albeit the character texture/line-art is a little bland/smooth in comparison to the background & scene objects - personal observation/preference.

    The simplest method is to use the registerHookFunction. There are loads of examples around the forum & on the wiki for this.

    Alternatively you could use the narration text, which won't trigger character talking but can be easily placed anywhere on the screen. If you don't need the character to talk then probably better to use the narration text action part. If you do then I suggest the hook function & maybe using a value to determine if text should be displayed above characters head or inside of a specific box/position.

    http://wiki.visionaire-tracker.net/wiki/RegisterHookFunction

    Imperator

    7278 Posts