Scale character enable/disable or lock at will in a scene?

  • #1, by OcttoManFriday, 21. November 2014, 12:44 10 years ago
    Hi,

    Is there any mode to lock the scale-proportion of one character in a scene?

    I have 2 or more characters in a scene, the scene have a scale-change way system to adapt to the scene´s perspective, when one action is activated, one of the character move in his vertical axis (as if it were flying). I need to keep that character scale and move it around the scene without changing his scale, and without change the other character´s size.

    I can't change the way system because it would change the other character size

    With Lua code?
    Somethink like http://www.visionaire-studio.net/forum/thread/objects-size/

    I thought about creating a clone with scale disabled for this action, but i would like a better way to do it directly.



    This is the scene, Fry, Bender or Leela can use the tubular but now, the character goes up but it shrinks and slows, is a Shrinking Machine



    Thanks for having read

    __

    PD: Sorry for my english

    Newbie

    16 Posts


  • #2, by afrlmeFriday, 21. November 2014, 13:35 10 years ago
    Let's see...

    I would recommend creating a new character for this, if it has to move along a way system path & disable character scaling & define the scale in the properties tab for the character, then swap current character for new character when character reaches destination.

    You can also disable this with lua & define the scale factor.

    game.CurrentCharacter.Scale = false -- disable way system scaling for current character
    game.CurrentCharacter.ScaleFactor = 50 -- set character scale factor to 50%
    

    ...I don't know if I've got the shorthand lua code correct here as I've not tested it.

    game:getLink(VGameCurrentCharacter):setValue(VCharacterScale, false)
    game:getLink(VGameCurrentCharacter):setValue(VCharacterScaleFactor, 50)
    

    ...same as above, but with old longhand code. (should work)

    I still think that swapping the characters is the better method though as you can give the new character a new walk cycle etc that will better reflect him being sucked up the tube, which is what I'm assuming you are planning to do?

    Imperator

    7278 Posts

  • #3, by OcttoManFriday, 21. November 2014, 14:11 10 years ago
    Thanks ARFLme,

    game:getLink(VGameCurrentCharacter):setValue(VCharacterScale, false)
    game:getLink(VGameCurrentCharacter):setValue(VCharacterScaleFactor, 50)


    Works fine, but you're right, maybe i should make a clone, anyway, you saved me, thanks again!

    Yes, the tube should aspire and send it off the screen.

    Newbie

    16 Posts

  • #4, by OcttoManFriday, 21. November 2014, 15:38 10 years ago
    confuse still having problems, the cloned character scale, if i disable de scale option, it maintains the original 1:1 scale, and the original character in this point is smallest than the original (87:100), i need to reduce the cloned character to the same size and let fixed, because i have more scenes with that tube system with differents sizes.

    Can´t let a fixed scaled sized?

    If i use the lua script, when i change vCharacterScale to false, it make the same problem, it change to 1:1.

    Newbie

    16 Posts

  • #5, by afrlmeFriday, 21. November 2014, 17:08 10 years ago
    The scale factor should adjust the scale. Hmm just tested it's not working...

    Ok we'll use a loop as it seems that I can force character size but it resets on animation change so if we use a loop then it will keep character size until we end the loop.

    local scale, char, state = 0, nil, false
    
    function beginFCS(c)
     if state == false then
      char = Characters[c]
      scale = char.CharacterSize
      char.Scale = false
      state = true
     end
    end
    
    function endFCS()
     state = false
     char.Scale = true
    end
    
    function loopFCS()
     if state == true then
      char.CharacterSize = scale
     end
    end
    
    registerEventHandler("mainLoop", "loopFCS")
    

    .. add above as definition script.

    begin force character scaling...
    beginFCS("Tom") -- set character as Tom, with current scale value of Tom.
    


    end force character scaling...
    endFCS()
    


    I've tested it & it seems to be working ok.

    Imperator

    7278 Posts

  • #6, by OcttoManFriday, 21. November 2014, 19:09 10 years ago
    I think i do something wrong.

    1.- created a definition script with this:
    local scale, char, state = 0, nil, false

    function beginFCS(c)
    if state == false then
    char = Characters[c]
    scale = char.CharacterSize
    char.Scale = false
    state = true
    end
    end

    function endFCS()
    state = false
    char.Scale = true
    end

    function loopFCS()
    if state == true then
    char.CharacterSize = scale
    end
    end

    registerEventHandler("mainLoop", "loopFCS")


    2.- In the object action (use-tube executed)
    i have my orders.
    -Hide cursor
    - Send character ´currennt character to blabla´
    - etcetc
    I need to insert a "Execute script" with "beginFCS(mycharatername)" ??


    I do it but nothing, you say you've tried it, can you send me the ved file?
    Need to do with the original character name? the cloned character name?....(i try both)


    EDIT:
    Is needs to be enabled the "Scale Character" check, no?

    Newbie

    16 Posts

  • #7, by afrlmeFriday, 21. November 2014, 19:19 10 years ago
    No I can't send you the .ved as I tested it in a game I'm currently helping develop.

    You can use the current character if you like.

    in an execute a script action part
    beginFCS("character_name")
    


    Character names are case sensitive. The character name has to be inputted into the function as a string thus it must be wrapped in "speech marks" or 'apostrophes'.

    Quick question: are you using the latest public build of Visionaire Studio? Visionaire Studio 4.1. This script will not work in versions before 4.0.1 at the minimum, as I've written it in new shorthand lua script. I recommend using the latest build though.

    Script explanation: you execute the beginFCS() function which automatically stores the linked characters size, turns off the way system scaling for the character & activates the loop which will force the character to that scale while loop is active.

    endFCS() will automatically disable the loop & enable way system scaling for the character.

    Imperator

    7278 Posts

  • #8, by OcttoManFriday, 21. November 2014, 19:39 10 years ago
    Ook! I have de 3.7.1 versión.confuse i would like to have the version 4, but having to pay again kills me...

    Thanks again for all!

    Newbie

    16 Posts

  • #9, by afrlmeFriday, 21. November 2014, 20:05 10 years ago
    hmm... I'm afraid then that it's not possible as VCharacterScale was introduced into Visionaire 4 data structure. Sorry.

    €45 to upgrade to vs4.

    Imperator

    7278 Posts

  • #10, by OcttoManFriday, 21. November 2014, 20:49 10 years ago
    If were the first time i would buy sure. I'm only an amateur making a free fan-game, a game that maybe never ends.

    I'll try another approach to the problem

    Newbie

    16 Posts

  • #11, by afrlmeFriday, 21. November 2014, 20:55 10 years ago
    There is another approach I can think of, but it's also not an easy solution.

    It involves on character reach destination, make playable character invisible but move along the intended tube path. You would need to create a scene object which contains an animation of the character that you want to use while it is moving along the pipe & on character invisible we enable the scene object containing the animation & then we activate a lua loop which updates the animation position to the character position...

    Here's where things get tricky though as character position is based on where you set the character animation center for each character animation whereas normal animation positions are based on the top left pixel of the animation, which means you would need to calculate the offset required to position the animation correctly.

    All in all: this is not something I can write off the top of my head as it involves maths & other stuff. & as you can probably gather from my reply, it's not the most simple approach.

    You could just create it as an animation? It would require quite a few frames to make it look smooth but that would probably be the simplest approach in your case with 3.7.1.

    Imperator

    7278 Posts