How to make an NPC walk and fallow the main character when it moves?

  • #1, by AkcayKaraazmakThursday, 13. November 2014, 23:21 6 years ago
    Hi mates, any ideas for how to make an NPC in a scene to fallow the main character when the main character moves? Also when main character gets into next scene how we can also have the same NPC in the next scene with the main character?

    Cheerssmile

    Great Poster

    437 Posts


  • #2, by afrlmeThursday, 13. November 2014, 23:28 6 years ago
    You could use the chase character action part. In an at begin of scene action of the next scene: set the npc to the scene & call another chase character action part.

    Leave the execute action on character catch (whatever it's called) empty so that no action is performed when npc reaches character based on radius set. I forget exactly how it works as it's a long time since I looked at that action part.

    P.S: it might be a good idea to wrap the set character to scene action part in a:
    -- action parts
    if character "character_name" is on current scene
    else
    set x character to x scene
    end if
    1
    2
    3
    4
    5
    6

    Imperator

    6842 Posts

  • #3, by AkcayKaraazmakThursday, 13. November 2014, 23:40 6 years ago
    THank you so much Lee! You are always been a life saver grin ... Ok I'll use chase function but how and where? On main character or npc's actions?

    Great Poster

    437 Posts

  • #4, by afrlmeFriday, 14. November 2014, 00:18 6 years ago
    hmm in a scene action or at begin of scene action under: character > chase character: specify which character should chase current character. use the range to stop npc from getting too close. leave the action empty.

    Imperator

    6842 Posts

  • #5, by AkcayKaraazmakFriday, 14. November 2014, 00:28 6 years ago
    It worked perfectly!!! Thank you so much mate! smile

    Great Poster

    437 Posts

  • #6, by MachtnixFriday, 14. November 2014, 16:18 6 years ago
    Verdammt. Ich hatte drei neue identische Folgecharakter angelegt, die jedesmal neu eingesetzt werden. Aber es geht ja sooooo einfach, rabäääh... :-(

    Machtnix

    Thread Captain

    1087 Posts

  • #7, by afrlmeFriday, 14. November 2014, 16:24 6 years ago
    Verdammt. Ich hatte drei neue identische Folgecharakter angelegt, die jedesmal neu eingesetzt werden. Aber es geht ja sooooo einfach, rabäääh... :-(

    Machtnix


    er... grin

    There's always a way! http://fc05.deviantart.net/fs10/i/2006/088/b/a/_shakeshark__by_Taimotive.gif

    Imperator

    6842 Posts

  • #8, by MachtnixFriday, 14. November 2014, 16:38 6 years ago
    Yes, of course. But: I did the experience that's my self-founded solution only worked for this one, only my special problem. Not a good style of programming. I created a down-counter (for a mini-game with a plant which eats flies). It works. But if I want more flies I have to build new actions and a lot of writing (every fly is an action and an object). This counter only works for 10 flies. I mean, that's why I will never be a good programmer... ;-)

    Thread Captain

    1087 Posts

  • #9, by afrlmeFriday, 14. November 2014, 18:00 6 years ago
    Hmm looks interesting. It's a shame we can't create destructive elements with Visionaire Studio, as it would make this a doddle to achieve.

    I believe you could do this with animations & a couple flies or so & have them randomly generate how many times the animation should loop etc.

    How does the mini-game work exactly? (mind we should probably be talking about this in another thread).

    Also, never say never. Bit of patience & effort. Hell when I joined vs forum 2 years back I had never even heard of Lua script. I hadn't programmed/scripted (other than a bit of web design) in over 10 years by that point. & within a couple months I picked up the basics of the language & look at all the crazy shit I've managed to write & share since - yes, even with my terrible terrible terrible memory!

    Imperator

    6842 Posts

Write post