Bug Catching Challenge

grem333

Veteran
Veteran
Joined
Apr 25, 2014
Messages
141
Reaction score
85
First Language
English
Primarily Uses
RMVXA
Hey all,


I am trying to implement a bug catching mini game. This is what I want to happen: Basically, when the player gets close to the bug (like 3 spaces away), the bug starts to flee the player and then disappears 300 frames later if the player doesn't catch it (the event erases). I am using Yanfly's event chase/flee player plug-in, however, I do not know how to get the bug to disappear after 300 frames. Have you guys got any idea how to do this?


This is what I was trying to do, but it doesn't work.

Untitled.png
 
Last edited by a moderator:

Marsigne

Veteran
Veteran
Joined
Sep 7, 2013
Messages
1,834
Reaction score
4,642
First Language
No
Primarily Uses
N/A
You could set a switch and have the bug disappeared on another page. :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
make it a self switch, unless you're only going to have one bug.  That means you'd need to use a script command to turn it on.


Also, you say "it doesn't work" the way you've got it, but you don't say what actually does happen instead.  Does it not flee at all?  Does it not disappear after 300 frames?  


If you need help getting it to flee, you need to provide a link to the plugin/script.  Looking at your screenshot, it looks like you've got it in a Set Movement Route event command, on a page with an Action Button trigger.  This means the movement route won't be activated at all until the player is right beside the event and interacts with it, and that's probably not what you want.  Without seeing the plugin, I don't even know if you're meant to use a script call to set the flee range - surely the plugin would have an example or a video showing how it's meant to be set up - Yanfly's pretty good with explaining how to make the plugins work.
 
Last edited by a moderator:

grem333

Veteran
Veteran
Joined
Apr 25, 2014
Messages
141
Reaction score
85
First Language
English
Primarily Uses
RMVXA
make it a self switch, unless you're only going to have one bug.  That means you'd need to use a script command to turn it on.


Also, you say "it doesn't work" the way you've got it, but you don't say what actually does happen instead.  Does it not flee at all?  Does it not disappear after 300 frames?  


If you need help getting it to flee, you need to provide a link to the plugin/script.  Looking at your screenshot, it looks like you've got it in a Set Movement Route event command, on a page with an Action Button trigger.  This means the movement route won't be activated at all until the player is right beside the event and interacts with it, and that's probably not what you want.  Without seeing the plugin, I don't even know if you're meant to use a script call to set the flee range - surely the plugin would have an example or a video showing how it's meant to be set up - Yanfly's pretty good with explaining how to make the plugins work.


Right. More details-sorry! The way I have it now, the bug senses you and starts to flee when you are 3 steps away. And then it continues to flee without disappearing. I have no problem with the bug catching part. I have a problem with the bug disappearing if you are too slow. For this plug-in, you are supposed to use the script call within the custom autonomous movement route area.


This is the plug-in I'm using, by the way: http://yanfly.moe/2015/10/21/yep-20-event-chase-player/


It's very straightforward, just doesn't seem to mesh well with what I'm trying to accomplish.


However, if there is another way to do this without a plug-in or with another plug-in, I'm open to it!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Love Yanfly's videos :)


I think putting the wait and erase in the movement route is where you've gone wrong.  Instead, create a common event, put the commands in there, and use the this._alertCommonEvent = id option that comes with the plugin (@3:09 on the video) to make it call the common event when the alert is triggered.  Hopefully using eventId() will give you the current event's id when called from that option - it may not - that might be the next hurdle to overcome.  If it's only one bug on one map you can hardcode the id.
 
Last edited by a moderator:

grem333

Veteran
Veteran
Joined
Apr 25, 2014
Messages
141
Reaction score
85
First Language
English
Primarily Uses
RMVXA
I've been experimenting with using the common event script call, and I think I'm getting somewhere. My problem is utilizing self switches with common events. This is what I have. It works when I use Switches instead of Self-switches, obviously, but I don't want to have individual common events and switches for every single bug that will be in the game. Any ideas?

1.png

2.png

3.png

4.png
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Can you get the event's id from within the common event?  If not, perhaps modify the plugin so that, at the time it calls the common event, it also sets a variable to the current event's id.


Then you can use $gameSelfSwitches.setValue([$gameMap.mapId(), $gameVariables.value(x), 'A'], true) where x is the variable id you're using to hold the event id.  I'm not sure if $gameMap.mapId() is the correct syntax - you might need to check that.


The plugin would probably have a call to $gameTemp.reserveCommonEvent...something - if you can find that, insert the variable update on a line immediately above.


In fact, I'll do it for you ... let's assume you want to set variable 15 to the current event's id, when this plugin sets up a common event alert.  Go to line 334 in the plugin:


Game_Event.prototype.playAlertCommonEvent = function() {
if (this._alertCommonEvent <= 0) return;
$gameTemp.reserveCommonEvent(this._alertCommonEvent);
};


and insert the new line:


Game_Event.prototype.playAlertCommonEvent = function() {
if (this._alertCommonEvent <= 0) return;
$gameVariables.setValue(15, this._eventId);
$gameTemp.reserveCommonEvent(this._alertCommonEvent);
};




then in your common event, to turn on self switch B:

Code:
$gameSelfSwitches.setValue([$gameMap.mapId(), $gameVariables.value(15), 'B'], true)
 
Last edited by a moderator:

grem333

Veteran
Veteran
Joined
Apr 25, 2014
Messages
141
Reaction score
85
First Language
English
Primarily Uses
RMVXA
It works! Thank you for your help!!! :)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top