Plugin for self-variables in common events

Nachorl250

Veteran
Veteran
Joined
Oct 30, 2015
Messages
34
Reaction score
2
First Language
Spanish
Hi everyone! How are you? 


So I released an action rpg game about a year ago, and after a lot of updates I decided that the most intelligent thing to do was move each type of enemy to a common event so that I don't have to manually make every update in every single event in every single map. I figured the best way to do this would be to change variables to self-variables that only apply to the current common event, making copy-pasting really easy. 


The thing is I already tried various self-variables plugins (Yanfly's, himework's,  u'ki's) and they all have one of two problems:


-They only work with map events, having to specify the map ID in the scriptcall/plugin command used. I need the plugin to set self-variables for each common event. 


-They crash if not on a new savedata. I need the plugin to work with already created savedatas as the game was already released and I don't pretend every player to start over for the update to work. 


Does anybody know or can make a plugin that meets my needs? 


Thank you all for the attention and hope you have a great New Year! 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,251
Reaction score
7,136
First Language
German
Primarily Uses
RMMV
Unfortunately, there are reasons for those limitations - and making something without them is a lot more difficult than you think. Otherwise a lot of people would already do things otherwise. And those limitations are caused by general programming logic that requires a lot of work to get around.


You might get lucky, but I don't think so, especially not with the requirement to keep the old savedata compatible. Unless someone redirects error handling (which would cause other problems) you'll need a versioning system to detect which kind of data was not available in old savefiles and redirect that. Not something likely in a free request...
 

Nachorl250

Veteran
Veteran
Joined
Oct 30, 2015
Messages
34
Reaction score
2
First Language
Spanish
Well, that sucks :/ I'll have to think of a better way of making it work without self variables then. I just supposed if self-switches worked without a problem, self-variables would be the same. 


Thanks a lot for the quick response!!! You sure saved me a lot of useless searching. 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,251
Reaction score
7,136
First Language
German
Primarily Uses
RMMV
 I just supposed if self-switches worked without a problem, self-variables would be the same.


Exactly - but common events don't have self-switches either, the self-switches only work on the map events. If a map event calls a common event, then those commands get transferred back to the map events (and it would probably be the same with map-based self-variables), but the common events themselves can have neither self-switches nor self-variables.
 

Nachorl250

Veteran
Veteran
Joined
Oct 30, 2015
Messages
34
Reaction score
2
First Language
Spanish
Wow,  I'll have to check then. I have the enemy's HP defined in the common event with a self switch and it works flawlessly. I guess I'm setting the HP somewhere else too and the common event isn't doing anything? 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,251
Reaction score
7,136
First Language
German
Primarily Uses
RMMV
it depends on how you do something, and how the plugin controlling the variables work.


If the self-switches work in that case, then you're calling the common event from the map event - they will not work if the common event is called from a skill or triggered as a paralel/autorun.. It's based on object hierarchy, but that will probably go too far into programming logic to explain.


You can try to have a plugin made that gives event self-variables and enable them to be called from a common event if that common event is part of the map event - that will work. But that is something different from your original description in the first post.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,317
Reaction score
12,801
First Language
English
Primarily Uses
RMMV
Do you mean your enemies are map events, and you are just calling the common event?  With a Call Common Event command, the common event behaves as if it's a part of the map event, so 'self' is the map event.  This means you can use Control Self Switches in a common event, and the event that calls it is the one whose self switches will be changed.


There are workarounds for both of the problems you mention above.


1. this._mapId and this._eventId can be used in script calls (and possibly plugin commands) to refer to the current map and current event.  You don't have to hardcode the map id in your calls.


2. The plugin can be modified to check a game on loading and create the structures required if they don't exist in the saved game.


I suggest you decide which plugin you want to use, and then make a request for the changes you need.
 

Nachorl250

Veteran
Veteran
Joined
Oct 30, 2015
Messages
34
Reaction score
2
First Language
Spanish
it depends on how you do something, and how the plugin controlling the variables work.


If the self-switches work in that case, then you're calling the common event from the map event - they will not work if the common event is called from a skill or triggered as a paralel/autorun.. It's based on object hierarchy, but that will probably go too far into programming logic to explain.


You can try to have a plugin made that gives event self-variables and enable them to be called from a common event if that common event is part of the map event - that will work. But that is something different from your original description in the first post.

Do you mean your enemies are map events, and you are just calling the common event?  With a Call Common Event command, the common event behaves as if it's a part of the map event, so 'self' is the map event.  This means you can use Control Self Switches in a common event, and the event that calls it is the one whose self switches will be changed.


There are workarounds for both of the problems you mention above.


1. this._mapId and this._eventId can be used in script calls (and possibly plugin commands) to refer to the current map and current event.  You don't have to hardcode the map id in your calls.


2. The plugin can be modified to check a game on loading and create the structures required if they don't exist in the saved game.


I suggest you decide which plugin you want to use, and then make a request for the changes you need.
Thank you for all the help guys! The common event is a parallel process, not being called, so I guess there's something setting the enemy's HP somewhere and that's why the self-switch is 'working', or rather another event is doing its work. 


I guess my best bet will be to change the way I'm doing this stuff, as my plan explicitly needed self-variables. 


In case anyone is curious:

My abs is event based, and it tracks all the enemies' position, direction, knockback when hit, etc by their event ID in whatever map it is. There are 5 events assigned to enemies per map, so assuming they are all in use there's a maximum of 5 enemies working at the same time


I want to have 5 common events, one per enemy (all being the  same event except for one variable that sets what event ID or enemy in the map the common event is referring to) that execute commands (setting the enemy's stats, drops, move routes and attacks) depending on another variable that  what type of enemy that event of the 5 per map is (say a soldier would be 1 and a dinosaur would be 2, if the variable is 1 the enemy will have less health than if the variable is 2).


Here comes the need for local variables.


As I said, the 5 common events would be almost the same, only being separated to ensure they work simultaneously without a problem, and I want to be able to make changes and then copying-pasting the whole block of commands from a common event to another, without having to change, for example, the moveroutes from referring to event ID01 to referring to event ID03, instead having those move routes refer to a self variable that just tells them what event ID they are playing with. 
If you want to know and didn't fully understand my explanation above, I can make and post a more graphical explanation of my idea with screenshots. 
 

Nachorl250

Veteran
Veteran
Joined
Oct 30, 2015
Messages
34
Reaction score
2
First Language
Spanish
Maybe you can try my plugins. They haven't any of the problems you said in first post. You can check if it works with common events.


You'll need latest versions found in my blog.





I hope these will be usefull.
I will try them and let you know! 
 

Nachorl250

Veteran
Veteran
Joined
Oct 30, 2015
Messages
34
Reaction score
2
First Language
Spanish
Maybe you can try my plugins. They haven't any of the problems you said in first post. You can check if it works with common events.


You'll need latest versions found in my blog.





I hope these will be usefull.
Wow. Just checked your blog. You're from Argentina? I am too!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,251
Reaction score
7,136
First Language
German
Primarily Uses
RMMV
@Nachorl250, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Additionally, please don't quote entire posts for simple and direct answers, it makes the topic difficult to read. If you have to reference someone, use the @username shortcut like I did above.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Hiatus; Still doing my best to get employed. :hwink:
Finally took the plunge and got myself MV. Time for some productivity!
Not more Goblins but variations of the Irish Merrow this time...

Okay so now you can prepend a JS library to your Haxe plugin. You can also prepend your attribution information to every compiled plugin.

:3c here's a thing i made a while while while back

Forum statistics

Threads
99,166
Messages
962,563
Members
130,744
Latest member
slatlift
Top