RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[XP] [EVENT SYSTEM] Follow The Leader

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 87
[SIZE=8]Follow The Leader (Evented)[/SIZE]
By Shaz - Version 1.2
Introduction

This Follow the Leader event system has been made by shaz.
This is an experimental system that requires fine-tuning.
This system allows you to have any number of NPCs "following" the main character.
- they are not always in the same order
- they do not follow in the exact steps (they walk more as a "group")
- the demo shows how you can cater for the player going into buildings and have some/all of the group "follow"
- in the demo, the cat always follows, but the girl only follows once you have agreed to help her
- SHIFT makes a follower take a step backwards (if possible) in case you get stuck in a tight spot


Modifications
Version 1.1
Added ability to interact with followers

Version 1.2
Complete revamp of "follow" common event to follow PINEDAXP's MUCH simpler method
Removed use of variables to avoid one event interfering with another

Screenshots


Into a building, nobody following yet


Leaving the building, girl not following, still in her default position

To have the girl follow, talk to her and agree to help her find her dog.


Once she starts following you, she will follow you into buildings (these ARE separate events on each map)


Leaving the building, she is there and waiting to follow you.



Followers' order is not always the same.

Copy the cat and duplicate it a few times (change the graphic) and you will see they don't always walk in a straight line either.

Issues

As NPCs don't follow in a straight line and duplicate the player's footsteps exactly, they CAN get caught in places and left behind - you have to go back and collect them.
Events could probably be made more efficient
Sometimes events seem to get stuck in limbo - they do nothing when they should be following.  I'm still trying to nut this one out.

Credits & Thanks

Written by shaz
Thanks to PINEDAXP - for his much simpler "follow" process


Am happy to hear any ideas for improvement/enhancement.
« Last Edit: February 23, 2014, 04:18:30 PM by modern algebra »
Always remember you're unique.
Just like everybody else.

**
Rep:
Level 86
I like this! this is what I had been hoping for, except I still can't talk to them.... *sighs* I'll keep trying, if I do figure it out, I'll post it on here. Thanks

"Keep smiling, it makes people wonder what you're up to."

OK, so what's the speed of dark?
What happens if you get scared half to death twice?

Since there's a duck-billed platapus, is there just a plain platapus? If so... what does that look like?

*
Rep:
Level 87
Yeah, I think even taking the common event and putting it on each NPC wouldn't work, as you'd still have to make it a parallel process.  You COULD add a check in there for action button being pressed, but to make it apply to just one NPC and not all (as the SHIFT does), you'd have to check that the player is standing one step away from the current event AND facing in the direction of the event.  Of course that would be unnecessary if you only had one NPC following.


I did an experiment a week or two ago, to see if I could get the same effect as the above by just making the event move towards the player, and fiddling with the speed and refresh rate.  That allowed me to interact with them, and they GENERALLY went to where the player was (and had the same problems as this system in regard to getting stuck), but their movement was fairly erratic.


mmm - got an idea - let me experiment a bit...
« Last Edit: November 04, 2007, 04:21:46 AM by shaz »
Always remember you're unique.
Just like everybody else.

*
Rep:
Level 87
here you go.  Now you can talk to the people following you.

(sorry for double-post - is that a no-no?)


*sigh* - you better go and look at this - PINEDAXP has done it in a MUCH more simple way than I have.  His is definitely the better one to use.
« Last Edit: November 04, 2007, 08:13:30 AM by shaz »
Always remember you're unique.
Just like everybody else.

**
Rep:
Level 86
Thaks for the tip :) It sounds like he's figured it out, but..... *sheepish* I don't know how to urm.... use the .rar  files..... *groan* I'm going to go look and see if it's mentioned in the info section, before I acctually ask and possible break a newbie rule that all those stickies try to prevent ;)

Edit: Ok, I found out how to use them!! and....

HUZZAH!!! It works, *does a little dance*
« Last Edit: November 04, 2007, 02:37:28 PM by FruitBodyWash »

"Keep smiling, it makes people wonder what you're up to."

OK, so what's the speed of dark?
What happens if you get scared half to death twice?

Since there's a duck-billed platapus, is there just a plain platapus? If so... what does that look like?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Hmm, I took a quick look at the system. It's nice, but a few things seem redundant. The double loop, for instance. Neither the first nor the second loop is ever broken. And of course, the event itself is set on parallel process, so the thing will loop every frame regardless. Secondly, the use of scripting is a bit strange when you could use event variables to make it seem more penetrable by non-scripters. Further, checking the event position versus player position directly could be a mistake, since ideally, with a caterpillar, the following events are never on the same square as the player. It might be a little more difficult, as you would need to account really for player's last position rather then current position, but the benefit to it would be that the user could set the follow events to through, which effectively eliminates the problem of getting stuck. Of course, you account for that with character interaction. All in all, a nice event system. I'll leave it here to get a bit of traffic before I move it to the database.

*
Rep:
Level 87
The inside loop is so the event continues moving until they're next to the player, rather than take one step at a time.  Not sure why the outer loop - maybe when I wrote that I didn't realise parallel processes automatically loop.

Don't move it to the database for a while - PINEDAXP's method of movement is WAY simpler than what I have here, so I'm going to change mine.  Won't be exactly like his, but that one entire common event will be almost done away with.  I'll revamp it this evening.


Edit:  done.  Used PINEDAXP's method for movement.  Also removed all variables from the following/interaction events.  Scripting is still there, and is fully explained - because all variable dependency has been removed, this should not have to be changed if someone copies/pastes into their own project.
« Last Edit: November 05, 2007, 08:36:25 PM by shaz »
Always remember you're unique.
Just like everybody else.

***
Rep:
Level 86
I hate everyone except the ones I don't hate...
I think this might be a bit too much like the catterpillar script, just different with the NPCs. Nice, also the thing about being able to talk to them, is a good idea! :)
I wonder how many of my-reps are there for a reason, and not just because some jackass wanted to show off in front of some other jackasses...?
Probably a lot of them - and those people sure as hell don't deserve my pity, let alone my disgust.
That's right, let's see some more -Rep'ing! BOOYEAH!!

*
Rep:
Level 87
yes, it's JUST like the caterpillar script - almost.  Big difference is evented.  That was the point ;)  People who don't want to get into scripts can still have this kind of system.

The NPCs in this case don't have to be in your party.  The girl "joined", but didn't have to.  The cat didn't.  And yes, you can talk to them and have them stop following at any time.

Always remember you're unique.
Just like everybody else.

***
Rep:
Level 86
I hate everyone except the ones I don't hate...
;) Nice, great job! :D
I wonder how many of my-reps are there for a reason, and not just because some jackass wanted to show off in front of some other jackasses...?
Probably a lot of them - and those people sure as hell don't deserve my pity, let alone my disgust.
That's right, let's see some more -Rep'ing! BOOYEAH!!