[RGSS3] Random Encounter Events

redcachalot

Veteran
Veteran
Joined
Sep 30, 2015
Messages
37
Reaction score
7
First Language
English
Primarily Uses
RMVXA
Hi,
This is a neat script that lets you CANCEL RANDOM ENCOUNTERS!
The script can be obtained from Himeworks: Random Encounter Events
It says that it can be done with a message from a common event with the variable in the script being the same as the ID of the common event. As much as I could learn from the comments, you need to use the script call in the common event's condition:
$game_troop.troop.id == 1

Forgive my noobiness, but after I set the Variable in the script to 1, I set up a common event in a new project with the common event conditional being the script call. I playtested and yet nothing happens when I encounter a slime as a random encounter battle. What am I doing wrong? And how can I get to set up the choice of engaging the random encounter OR fleeing it, as seen in the video on the Himeworks page?
 

Attachments

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,660
Reaction score
563
First Language
English
Primarily Uses
RMVXA
common event conditional being the script call.
It's a little wrong.
The variable, first of all needs to have a value. The number in the VARIABLE in the script is just the variable you are using. You then need to use the command control variables to set the value of the actual variable. In your case set to 1. You could have put 59 in the script and set it to 32. CE 32 would be called.
Then the script will call common event 1.
By default the value of variables are 0.
Then in the logic of your common event is where you can decide how to cancel.
Which for your common event will never happen as you are saying if the troop is troop 1, then do battle.
There is no choice to not battle troop 1.
What you also have is if the troop is not troop 1, then cancel battle.
Should be more like this if you want to have a choice.
1585086279979.png
 

redcachalot

Veteran
Veteran
Joined
Sep 30, 2015
Messages
37
Reaction score
7
First Language
English
Primarily Uses
RMVXA
Should be more like this if you want to have a choice.
View attachment 137742
I did everything as in the screenshot, yet the random encounter slime in my new project still ignore the common event.

I am using the same unmodified Hime script copy-pasted into the script editor of my new project.
i.e. in the script:
Ruby:
  module Random_Encounter_Events
    
    # The number stored in this variable is the ID of the common event that
    # will run when you encounter an enemy.
    Variable = 1
  end
Yet I don't think the Hime script is properly calling this Common Event ID: 001 for Troop ID 001: Slime*2 in a random encounter. And I don't know how to get it to work.

There is simply no pre-battle message being displayed when a random encounter with Troop ID 001: Slime*2 occurs on the overworld during playtesting.

Please help!
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
281
Reaction score
106
First Language
English
Primarily Uses
RMXP
Create an event on the starting map, an Autorun, that sets Game Variable ID 1 to a value of 1. This is telling the script that you want to use CommonEvent ID 1. That is what Roninator was telling you to do.

Though the screenshot he provided is a bit misleading since it sets Game Variable 1 again. Use a different variable ID instead.
 
Last edited:

redcachalot

Veteran
Veteran
Joined
Sep 30, 2015
Messages
37
Reaction score
7
First Language
English
Primarily Uses
RMVXA
Could I get a couple of screenshots about how its done? Both concerning the event on the map and the Common Event because I'm just running into Game Interpreter errors at this point in my new project.
 

redcachalot

Veteran
Veteran
Joined
Sep 30, 2015
Messages
37
Reaction score
7
First Language
English
Primarily Uses
RMVXA
It Works!

But does this mean that to cancel each kind of Troop's random encounter I have to set up a separate common event for each Troop? Or can I have multiple troops, each with their own unique pre-battle message, within a single common event?

I think I'll need more space for Common Events that do other things than only using them all for evading Random Encounter Troops throughout the game...

Let's say I'd like to have:
Troop ID: 001 Slime*2
Troop ID: 002 Bat*2
Troop ID: 003 Hornet*2 all in a single common event and to be able to cancel each Troop's random encounter.

How would I do it?
Screenshots please.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,660
Reaction score
563
First Language
English
Primarily Uses
RMVXA
How would I do it?
Mostly up to you. That's what Hime was referring to when saying "the opportunity to run some extra logic "

It will be all about conditional branches and how you structure them.
You can put the choice box inside the conditional branch or at the end. Maybe something else. Totally up to you.
1585169779420.png
 

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top