Locking Character Scaling at a Specific Point.

  • #1, by DilatedSunday, 26. July 2015, 08:09 5 years ago
    Hey dudes/dudettes

    I was wondering if anyone has set anything up which locks character scale according to the point it is at?

    To be more specific of what I'm doing. My character is walking around on screen, being scaled according to its waypoints. I want to be able to press a button which then locks the character at that exact size. Then said character moves around without changing his size. When I press the button again, it reverts it back to its original waypoints.

    At the moment I have janky set up with action areas, but I'm wondering if anyone else has done anything like this?

    Forum Fan

    149 Posts


  • #2, by afrlmeSunday, 26. July 2015, 13:01 5 years ago
    Yes it's possible. I believe I provided an example in another thread a while back, but I don't remember which. The basic principal is that you store the current character scale > turn off character scaling > set character scale.

    http://www.visionaire-studio.net/forum/thread/scale-characte... -- example & script is on first page somewhere - my second reply to the thread.

    Imperator

    6842 Posts

  • #3, by DilatedSunday, 26. July 2015, 15:16 5 years ago
    Awww yiss, the second script you wrote on that page works perfectly, thanks again man <3

    Forum Fan

    149 Posts

  • #4, by afrlmeSunday, 26. July 2015, 15:36 5 years ago
    No problem mate. wink

    Imperator

    6842 Posts

  • #5, by DilatedSunday, 26. July 2015, 15:44 5 years ago
    Also as well, I want to set something up so when the characters scale is >50 it activates a condition.

    Currently trying writing something now, but not sure if it works yet.

    if game.CurrentCharacter.ScaleFactor = >50
    setCondition("Paradigm_Big_activated", true)

    Not sure if > is the correct syntax haha.

    Forum Fan

    149 Posts

  • #6, by afrlmeSunday, 26. July 2015, 16:20 5 years ago
    nope smile

    if game.CurrentCharacter.CharacterSize >= 50 then
    Conditions["Paradigm_Big_activated"].ConditionValue = true
    end
    1
    2
    3
    4


    P.S: I find the fastest way to script is to create some workflow functions beforehand, which you can use in any of your scripts to save time, such as: checking / setting a condition or value, setting animation frames, animation direction, animation position with tweening etc. etc.

    Quick example:

    #1: a function for getting a condition boolean.
    function checkCond(c)
    if Conditions[c].ConditionValue then return true else return false end
    end
    1
    2
    3
    4

    to use that in another script you would do something like this...
    if checkCond("test") then
    print("true")
    else
    print("false)
    end
    1
    2
    3
    4
    5
    6

    #2: a function for setting a condition.
    function setCond(c, v)
    Conditions[c].ConditionValue = v
    end
    1
    2
    3
    4

    Usage...
    setCond("test", true)
    1
    2

    Stuff like this really saves time in the long run as you are not having to type out the full thing each time you need to access or update one of the data structure tables or fields.

    Imperator

    6842 Posts

  • #7, by DilatedSunday, 26. July 2015, 16:23 5 years ago
    Woops, did not see this post haha.

    Forum Fan

    149 Posts

  • #8, by afrlmeSunday, 26. July 2015, 16:25 5 years ago
    It's not scale factor. Check the reply I wrote a minute or two ago. wink

    ScaleFactor is to do with the way system. For example: the scale factor is 100% which is 1:1 scaling to the way system scale values. If you change the scale factor then the character will scale to the way system plus or minus the scale factor percentage - or at least that is what it is supposed to do.

    Imperator

    6842 Posts

  • #9, by DilatedSunday, 26. July 2015, 16:30 5 years ago
    Haha yeah, I didn't refresh the page and I got the email late razz Alright sweet man thanks a bunch grin That script worked well too. Also yes that's a good idea to get my shit together on workflow. Slowly but surely understanding bit by bit how programming works haha.

    Forum Fan

    149 Posts

  • #10, by DilatedSunday, 26. July 2015, 16:48 5 years ago
    Ah damn this actually doesn't work. game.CurrentCharacter.CharacterSize changes the condition but according the character default scale, in this case 100. What I need it to do is react to the size of the character in the actual scene.

    So if this character on screen greater than >= 100, change this condition.

    What is the command for character on screen size. I tried to suss it out via the other script that locks the size, but doesn't work either.

    Forum Fan

    149 Posts

  • #11, by afrlmeSunday, 26. July 2015, 16:59 5 years ago
    What do you mean? You mean the size it would be if it wasn't being forced?

    Um there's the pointsize field, but I'm not sure how to access it or whether it would even be any use.

    I can think of a workaround though. Create a small npc character with transparent image files & have that follow the current character around the screen & you can check the scale value of that character instead seeing as it would be using the correct scale value.

    Imperator

    6842 Posts

Write post