Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,899
Reaction score
2,216
First Language
Portuguese - Br
Primarily Uses
RMMZ
KaUIPFD.png

Author: Hakuen Studio

Introduction

Keeping track of a lot of different variables can let you more sensitive to making a mistake. That's why self variables come in handy!
It works like self switches, but you can use numbers instead of just true/false(ON/OFF). And just use one variable in a lot of events!

Features
  • Add self variables to events.
  • These self variables are persistent across the map.
  • Can use plugin command to change the self variable of other events/maps.
  • Integration with the default event commands!
  • Work on the conditions tab of an event page.

Detailed tutorial on steam

How to use
After installing the plugin, the only thing you need to do is name a game variable like this:
SV: your variable name here.
Sv name.JPG

It must start with "SV:" (It is case sensitive, so set the SV upper case).

Now, you have three ways to manipulate the self variable values:

♦ Script Calls ♦

● Getting self variable values:
  • Current event -> this.selfVariableValue(varId) OR this.getSv(varId)
  • Other events/map -> $gameVariables.selfValue([mapId, eventId, varId])
● Changing self variable values:
  • Current event -> this.setSelfVariableValue(varId, value) OR this.setSv(varId, value)
  • Other events/maps -> $gameVariables.setSelfValue([mapId, eventId, varId], value)
♦ Plugin Command(MZ only) ♦

You can change the self variables value using the plugin command.
sv plugin command.JPG

NOTE¹: If you want to show the value of a self variable in a text like \v[id], you will need the Eli Escape Codes, where you set up an escape code of your choice to get their values. By default is \sv[id].

How to use the super integration feature
The super integration is a feature that lets you operate the self variables using the default event commands. In another word, using the editor.

♦ Default event command ♦

Self Variables are stored just like Self Switches. This means, that they mix Map Id, Event Id, and Variable Id to build a key that will hold the value of the self variable.
  • MapId, EventId, VarId = value
So, if Event Id 6 of Map Id 114 has a Self Variable Id 2 with a value of 345, the game will save this like that:
  • 114, 6, 2 = 345
So, with that in mind, if the variable has the "SV:" tag on their name, any event command that let you use a variable, will operate the self variable instead of the default game variable(Control Variable, Conditional Branch, etc.).

To do that, they will need a Variable Id, Map Id, and Event Id to access a Self Variable value.
The Var Id will get from the event command itself, by the user.
The Map Id and Event Id will be automatically got by the plugin and combined to find the value of a self variable.

But if in case you want to check the value of a self variable of another event? Or even in another map?

Then you must set a variable id into the Target Variables located on the plugin parameter.
sv parameter.JPG
These Target Variables will let you change the Event Id and Map Id that was being set automatically when you use the event commands.

You just need to change their values to something above 0 and they will set a Target Map Id and Event Id.
Set their value to 0 if you want to restore the normal behavior.
* They also must be set as Self Variables.
sv targets.JPG

They will work on any event command that uses variables!
Terms of Use
Update Log
 
Last edited:

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,899
Reaction score
2,216
First Language
Portuguese - Br
Primarily Uses
RMMZ
Version 3.0.0 - 08/11/2021
- Fixed the plugin command that was not giving the dropdown list to choose the self variable id.
- Add two new plugin parameters that let you control the target event/map Id for the self-variable operations on event commands.
- Code clean up.
- Need Eli Book 4.0.0 now.
 
Last edited:

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,899
Reaction score
2,216
First Language
Portuguese - Br
Primarily Uses
RMMZ
Version 3.0.1 - 11/25/2021
- Removed the full integration of the self variables with the event commands because it was not working properly when a parallel or autorun event was running and setting/checking a variable value.

Version 3.1.0 - 12/08/2021
- Added again the full integration of self variables with the event commands that use variables!

Special Thanks to @OktoberLove for testing the previous versions and letting me know about the bugs! :kaoluv:
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,899
Reaction score
2,216
First Language
Portuguese - Br
Primarily Uses
RMMZ
Version 3.1.1 - 01/09/2022
- Fixed a bug where it was not possible to change the target event id of an event more than one time.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,899
Reaction score
2,216
First Language
Portuguese - Br
Primarily Uses
RMMZ
Version 5.0.0 is not compatible with my plugins that are below the 5.0.0 versions.

Version 5.0.0 - 02/05/2022

  • [MV] Ported to MV!
  • Updated terms of use.
 

fallenlorelei

Veteran
Veteran
Joined
Jul 8, 2013
Messages
315
Reaction score
366
First Language
English
Primarily Uses
Hi @Eliaquim ! I noticed a bug and narrowed it down to this particular plugin (that is, when I enable it, the bug exists, but when I disable it, everything is fine). In short, the "Get Location Info" command doesn't update after the first time it's been used.
EliRegionIssue.PNG
So in-game if I stand on 4 and the event tells me what region I'm standing on, using Get Location Info, it'll set the variable to 4. But when I move to regions 3 or 2 or 1, it'll still be stuck at 4.
When I turn off the plugin, the variable changes as expected.
Let me know if you need any more information! I would love a fix! :D
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,899
Reaction score
2,216
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi @Eliaquim ! I noticed a bug and narrowed it down to this particular plugin (that is, when I enable it, the bug exists, but when I disable it, everything is fine). In short, the "Get Location Info" command doesn't update after the first time it's been used.
View attachment 229604
So in-game if I stand on 4 and the event tells me what region I'm standing on, using Get Location Info, it'll set the variable to 4. But when I move to regions 3 or 2 or 1, it'll still be stuck at 4.
When I turn off the plugin, the variable changes as expected.
Let me know if you need any more information! I would love a fix! :D
Hi there!
I tried to replicate it here, but It worked.
How exactly are you doing this?
Can you show me your event, the one that is using the Get Location Info to collect the region Id?

Here I did the test two ways:

I created a player touch event above each region.
When the player steps on it, the Get Location Info stores the player region on the normal variable. And it works on what is supposed to do.
1655861579182.png
1655861719813.png

The second way, I created a parallel event that keeps storing the Player Region ID on a Self Variable. When I press OK, a show text command shows me the value of that self variable in the show text command.
1655861639103.png
index.php

Both ways are working!
 

Attachments

  • 1655861601216.png
    1655861601216.png
    85.3 KB · Views: 1
  • 1655861669217.png
    1655861669217.png
    101.6 KB · Views: 34
  • 1655861700007.png
    1655861700007.png
    98.4 KB · Views: 1

fallenlorelei

Veteran
Veteran
Joined
Jul 8, 2013
Messages
315
Reaction score
366
First Language
English
Primarily Uses
@Eliaquim Sorry for the late response, I was on vacation!

I am actually using a Common Event through a Skill. And to be more specific, I am using the skill through KagePhoenix's ABS plugin (so it is on a hotbar).

Here is a screenshot of the common event. I am basically trying to find the region ID in front of the player. If it's 10, it'll do the thing. In this case, if it's 10, it'll just tell me that it is 10.
EliRegionIssueCont1.PNG

Region 10 is the entire dirt space above the blue-haired girl. It shows 10.
EliRegionIssueCont3.PNG

But then I'll walk away and use the ability again and it's stuck at 10.
EliRegionIssueCont4.PNG

EliRegionIssueCont5.PNG

No matter where I move it'll be stuck at 10. But this doesn't happen with this plugin turned off. The region variable updates as expected (from 10 to 0).

Thanks for your help!!
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,899
Reaction score
2,216
First Language
Portuguese - Br
Primarily Uses
RMMZ
@Eliaquim Sorry for the late response, I was on vacation!

I am actually using a Common Event through a Skill. And to be more specific, I am using the skill through KagePhoenix's ABS plugin (so it is on a hotbar).

Here is a screenshot of the common event. I am basically trying to find the region ID in front of the player. If it's 10, it'll do the thing. In this case, if it's 10, it'll just tell me that it is 10.
View attachment 231145

Region 10 is the entire dirt space above the blue-haired girl. It shows 10.
View attachment 231146

But then I'll walk away and use the ability again and it's stuck at 10.
View attachment 231147

View attachment 231148

No matter where I move it'll be stuck at 10. But this doesn't happen with this plugin turned off. The region variable updates as expected (from 10 to 0).

Thanks for your help!!
Hi!
When you mean the plugin off, you mean my plugin?

As I can see on your screenshot, you are not using any Self Variable at all. Only the regular variables.

Any Self Variable, starts with their name as following:

SV: Variable Name...

And I don't see any SV: on the player coordinate variables or on the variable used to get the info location.

So the problem is not with self variables? Is with regular variables?

Can you try getting the region id on info location, of the player, instead of the front of the player? Just for we to see if there is any issue on the event itself.

Also, I don't know how the ABS plugin works by using the skill on the map... This is a free plugin? If yes try send me the link.

Also, did you try swapping plugin positions?
 

fallenlorelei

Veteran
Veteran
Joined
Jul 8, 2013
Messages
315
Reaction score
366
First Language
English
Primarily Uses
@Eliaquim Sorry, I should have clarified! The SV: variables work great, I'm using them in other events. I didn't expect this plugin to interfere, but when I turn it off (this plugin specifically) it all works but when it's on, it does not. Regular variables.

I moved your plugins to the top and the bottom. And I removed the additions to x/y coordinates.

I recorded it happening and put it in a gif so I could show it here, but it might be hard to follow due to the quality...


First half shows the plugin on and the region getting stuck at 10 despite the x/y coordinates changing. And then I turn off the plugin, and the region updates as expected.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,899
Reaction score
2,216
First Language
Portuguese - Br
Primarily Uses
RMMZ
@Eliaquim Sorry, I should have clarified! The SV: variables work great, I'm using them in other events. I didn't expect this plugin to interfere, but when I turn it off (this plugin specifically) it all works but when it's on, it does not. Regular variables.

I moved your plugins to the top and the bottom. And I removed the additions to x/y coordinates.

I recorded it happening and put it in a gif so I could show it here, but it might be hard to follow due to the quality...


First half shows the plugin on and the region getting stuck at 10 despite the x/y coordinates changing. And then I turn off the plugin, and the region updates as expected.
Holy moly!!
I will never see this coming by myself. I made some tests here and I found the problem!
Lucky, is not a compatibility issue. I already fixed it, will update in a few hours!
Thank you so much for noticing and reporting it! :kaoluv:

Version 5.0.1 - 06/29/2022
  • Fixed a bug on the command Get Location info, that was permanently changing the event command list, making all the events with the Get Location Info have the same command setup.

thanks @fallenlorelei !
 
Last edited:

fallenlorelei

Veteran
Veteran
Joined
Jul 8, 2013
Messages
315
Reaction score
366
First Language
English
Primarily Uses
Holy moly!!
I will never see this coming by myself. I made some tests here and I found the problem!
Lucky, is not a compatibility issue. I already fixed it, will update in a few hours!
Thank you so much for noticing and reporting it! :kaoluv:

Version 5.0.1 - 06/29/2022
  • Fixed a bug on the command Get Location info, that was permanently changing the event command list, making all the events with the Get Location Info have the same command setup.

thanks @fallenlorelei !
You are awesome for figuring it out!! Such a relief it wasn't a compatibility issue! I downloaded the new version and everything works great. Yay!!
 

pavelbieniasz

Warper
Member
Joined
Jul 24, 2022
Messages
1
Reaction score
1
First Language
Polish
Primarily Uses
RMMZ
Hey. I'm total newbie:p What should I write in plugin command if i would like to add to variable value from variable instead of number?
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,899
Reaction score
2,216
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hey. I'm total newbie:p What should I write in plugin command if i would like to add to variable value from variable instead of number?
Hi there!
I didn't understand your question. But, I believe this tutorial I made on steam can help you understand the plugin better.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,960
Reaction score
2,334
First Language
Dutch
Primarily Uses
RMMV
I never kinda understand Target event ID and Target Map ID,
but it is indeed easier this way, also the link MV & MV should
be probably MV & MZ :p

but well you have also selfSwitches, why are those 2 seperated?
and not combine into 1 plugin?

as I know what the target does, after reading that small tutorial,
I might switch over from YEP_SelfVarSw which works good too.

yours gives just a bit more usefriendly to target other maps and
events easier.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,899
Reaction score
2,216
First Language
Portuguese - Br
Primarily Uses
RMMZ
I never kinda understand Target event ID and Target Map ID,
but it is indeed easier this way, also the link MV & MV should
be probably MV & MZ :p

but well you have also selfSwitches, why are those 2 seperated?
and not combine into 1 plugin?

as I know what the target does, after reading that small tutorial,
I might switch over from YEP_SelfVarSw which works good too.

yours gives just a bit more usefriendly to target other maps and
events easier.
Hi there!
Thanks for reading!
I will do it, I will put all of them together in one plugin. I'm just delaying this a little bit xD
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,960
Reaction score
2,334
First Language
Dutch
Primarily Uses
RMMV
no worries, because I think combining them makes usefull for
the both them, seperate is possible if you only need one of them.

keep up the good work though =)
 

Latest Threads

Forum statistics

Threads
124,331
Messages
1,162,836
Members
163,133
Latest member
Fake_Annouji
Top