Khas Pathfinder script - NPC arrives at destination and reacts...

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
Hello everybody,

I'm currently toying with the Khas Pathfinder script and it's pretty neat little script to automate your cities NPCs to give them a little more "life", I was wondering if any of you have figured out a way for an NPC to react once they get to their destinations on the map (besides a wait command + self switches).

I was thinking of using a conditional branch to do this and use the script command but I have no idea what i'd need to put in here to accomplish this. Is this possible?

Thanks for taking the time to have a look.

Greg
 

Eurgh

Lord of the Reapers
Veteran
Joined
Oct 6, 2012
Messages
172
Reaction score
34
Primarily Uses
I would love to help, however could you please provide more information on what it is you want to achieve?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,098
Reaction score
11,439
First Language
English
Primarily Uses
RMVXA
'Game Mecanics Design' is for discussing aspects of game play at the more conceptual level. This needs to go into either Script Support or Plugin Support, as it is a question of "How do I implement [X]?"

I need to move this thread, but you do not specify which engine you are using.
Please post with that information. You might like to consider including it in the info under your avatar, as that will help if anything else ever has to be moved.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,614
Reaction score
13,208
First Language
English
Primarily Uses
RMMV
Also a link to the script.
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
Hey guys,

Apologies that I posted this in the wrong place, my bad. It's VX Ace script.

Source: https://forums.rpgmakerweb.com/index.php?threads/khas-pathfinder.4912/

I'm looking to run a conditional branch with a script call so that when an Event arrives at a certain point (for instance the door of their house) to activate a switch lets say it's called "NPC GO INSIDE". I'd prefer to do this with a conditional branch/script call as it allows me more powerful options for later use.

I'm not sure if it's possible with this particular script and any help would be appreciated.

Cheers,

Greg
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,098
Reaction score
11,439
First Language
English
Primarily Uses
RMVXA
[move]JavaScript/Plugin Support [/move]

Sorry, my bad.

[move]RGSSx Script Support[/move]
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,402
Reaction score
499
First Language
English
Primarily Uses
RMVXA
I don't see any way to specify from the script how to activate a switch or use a script function to check for a conditional branch.
Of course I'm no expert.

What I do believe you can do is two parallel events.
1. Check event X location x and y and save them to variable xx and yy
2. Conditional branch variable xx is equal to value x, and yy is equal to value y. Then when both are true - turn switch X on.
3. Run your enter house event by switch X now on.
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
Hey Roninator,

Yeah I was looking through the different options for eventing and that one did pop up and its a possibility but it would mean setting up a parallel process and creating a new conditional branch for each event I decide to pathfind and it could get crazy big if my cities feature a lot of walking to and from their homes. etc

I'll keep tinkering with the script and see if I can create a script call using the calls in the script. I'm no coder but I can tweak stuff most of the time as long as there's a function in the script that can check it.

Cheers for your help dude.
 

vFoggy

Veteran
Veteran
Joined
Nov 3, 2012
Messages
71
Reaction score
30
Primarily Uses
What kind of reactions do you have in mind?
I mean a series of events or just one?
Basically what you want is to skip the manual activation/deactivation of the (self)switches and event pages, right?
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
So I've managed a way to keep my NPC's moving about the map etc during my day cycle but that involves many wait commands and having everything run via parallel processes (I fear this may cause lag if too many are on screen at once) but what I'm trying to do is when my switch "NIGHT" is activated I want the event to walk back to their front door, I want the game to check if the event is at position x,y (front door) and once the game knows the npc is at said x,y location i can activate another switch.

I've been checking out the Script Call functions for VXAce (https://forums.rpgmakerweb.com/index.php?threads/script-call-collection-for-vxace.25759/#entry247437) and have come across these:

# X and Y's
# ----------------------------------------------
$game_player.x
$game_player.y

$game_map.events[n].x
$game_map.events[n].y
# n = Event ID


# Check Terrain Tag
# ----------------------------------------------
$game_map.terrain_tag(x, y)
$game_player.terrain_tag
$game_map.events[event_id].terrain_tag

# Check Region ID
# ----------------------------------------------
$game_map.region_id(x, y)
$game_player.region_id == n
$game_map.events[event_id].region_id == n

# Check Map Name and Map ID
# ----------------------------------------------
$game_map.name
$game_map.map_id

# Check if Event is Near Player
# ----------------------------------------------
$game_map.events[n].near_the_player?
I've been fiddling with these:

$game_map.events[n].x
$game_map.events[n].y
# n = Event ID

I'm struggling to implement this in any successful way to make the process smooth and simple without lagging my game right down.

Any ideas are welcome!!
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
811
First Language
Hungarian
Primarily Uses
RMVXA
I used Napoleon's "MoveRoute Wait" snippet for this, worked pretty well for me.
It lets you use a script call to wait for any kind of movement commands before it runs the next event command.
It works for movement commands made on events only, but with a little edit it can be made to work for the player's movement commands too.

You can get the script from this demo:
http://www.mediafire.com/file/7cost18bcc58b77/Napoleons+Master+Demo.zip
The demo is uploaded by cabfe (Napoleon isn't active anymore, and his demo upload was taken down).
Install the script, and whenever you want to make the event wait for a moveroute to be completed before executing the next event command, use the provided script call somewhere after the moveroute command. Note that you can have other event commands between your moveroute command and this script call if needed.
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
Thanks Sixth I'm checking that out now as I was getting a lot of lag using the Khas script and my computer is pretty decent!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

In other news, my new computer is now ordered, and I'll have it in my hot little hands by the end of the week! CAN'T WAIT!!!
I've said my cat's names in such a baby-talk manner over the years, Biggs is now Biggoro, Bella is now Bellllyyaah, and somehow.....somehow Tessa is Sessashan
Did a massive ****up in my code that would have caused the game to crash on most computers and almost released an update without noticing it.
I keep thinking today is Thursday.
And I look forward to the next preview thread coming this afternoon.
And then I realise it's not Thursday at all.
And then I get sad :(

Forum statistics

Threads
100,449
Messages
976,080
Members
132,082
Latest member
nwr
Top