DE EN FR ES IT CZ
Back Back to top

Change Waysystem

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  • #1, by raule 14 years ago Quote
    Hello,

    i change the waysystem in my scene via action areas. i have to do it for scaling the character right.
    it already works fine. the only thing is, that the character stops when the Waysystem changes.

    is there a possiblity that the character wont stop`?

    thx for any answer!

    raul
  • New to Visionaire Studio?

    Create point and click adventures without coding. The free version covers up to 25 scenes per project. For more scenes or to earn money with your game, you need a license.

    See the Indie Bundle Try it for free
  • #2, by Alex 14 years ago Quote
    I don't think so. The character is stopped because the way points of the waysystem are needed for the path finding algorithm.
  • #3, by raule 14 years ago Quote
    yeah i thought so.
    is there a better way to solve my problem?

    i have different sizes of the character on same y-choords

    thx and thx
  • #4, by afrlme 14 years ago Quote
    it's better to only set up 2 scale sizes than multiple ones...

    did you see what Mowren posted in another thread about adding the actual scaling points on the outside of your way borders? he wrote a few other tips too & explained how the scaling system works.

    http://www.visionaire-studio.net/forum/thread/way-point-scal...

    near bottom of the thread.
  • #5, by raule 14 years ago Quote
    yeah usually i do it like this but in this case i have different sizes of the character on same y-choords.

    If this is my scene the character is bigger on position 1 than on position 2
    Position 1 is still foreground (balcony), position 2 is background.

  • #6, by afrlme 14 years ago Quote
    hmm I was musing over the idea of using lua to save the character destination into a variable with just before you change the way system & then using said variable with the VCharacterDestination to set the character walking to that destination again.

    I don't know if it would work but...

    first you need to create a definition script which we can use to add 2 simple functions one for setting the current destination & the other for setting it going again.

    local char_dest -- create a blank variable that we can use for both of the functions
    
    -- let's create the function that stores the character destination
    function saveDest()
     char_dest = game:getLink(VGameCurrentCharacter):getPoint(VCharacterDestination)
    end
    
    -- let's create the function that resets character destination
    function getDest()
     game:getLink(VGameCurrentCharacter):setValue(VCharacterDestination, {x = char_dest.x, y = char_dest.y})
    end
    


    to use this:
    1. just before you add the change way system action part, create an execute a script action part & add...
    saveDest()
    

    2. then after the way system as been changed add another execute a script action part & add...
    getDest()
    


    I haven't tested this code, but it should probably work & it says that CharacterDestination is scriptable, so I assume it should set the character walking again but hmm I'm not sure it will execute whatever action you told it to do on x object or character... I think we would need to add some additional code to check if destination is an object or character etc & whether you told it to execute an action on it but the code should resume the character walking.

    We also have a choice of using these scriptable commands too:
    CharacterDestination -- general x,y destination
    CharacterDestinationObject -- if character destination is an object or character
    GameDestinationCommand -- the command you used on the object, character
    GameDestinationEvent -- a normal mouse event such as left/right click or hold etc
    GameDestinationItem -- if you used an item on the object or character
    GameDestinationItemPicked -- same as above but is for if you have used a dragged item
    
  • #7, by raule 14 years ago Quote
    looks pretty good right now!

    i will test it with some other actions then just "goto" and give some feedback if its working as well for other situations.

    thank you very much!!
  • #8, by raule 14 years ago Quote
    hi there,

    yes its like u said.
    its working with just "walking" to an object. but if i execute an specific command like "take" it doesn't work.
    so i have to add the function (CharacterDestinationObject , aso.) into the lua script?

    greetings
  • #9, by afrlme 14 years ago Quote
    yeah but I think the best method would be to use an if query to determine if the character should be walking to an object/character & then save the destination object & the command to be used & if not then default back to destination only method.

    hmm I think you could probably query "VGameDestinationEvent" & "VGameDestinationCommand" to check what is supposed to happen when the user reaches the destination & then use that to determine what you need to save to the saveDest function & what should be returned in the getDest function.

    I'll have a wee think on it & get back to you later on the day or the week sometime.
  • #10, by raule 14 years ago Quote
    thank you very much!