RPG Maker Forums

Hello.
I am fighting with JS in MV. I made plugin with guild system.

GuildName is defined by string - (name defined by plugin parameters)

In each guild you have 12 titles you can achieve (starting from newbie to grandmaster) - you are tagged by highest one - so for Smith guild you can be apprentience smith

So - GuildTitles is array of 12 strings.

Basic object structure (prototype?) for Guild is:

Code:
  function Guild (GuildName, GuildTitles) {
            this.name = GuildName;        // name of Guild - string from plugin parametters
            this.titles = GuildTitles;          // array - set of ranks/titles within guild
            this.member = false;             //  Check if actor is already member - each actor can be member of each guild as long as he pays guild fee. He can also lost membership if act against guild
            this.reputation = 0;                // Actor reputation points for guild
            this.level= 0;                          // Actor level inside guild
            this.titleID= 0;                          // Actor title ID inside guild

// +few methods for check reputation needed for next level in guild, for set level, set title, etc..
        };
Then I made 9 guilds from Guild object - with imported GuildName and GuildTitles for each guild1-guild9

and merge all together inside array guilds.
Code:
  var guilds = [guild1, guild2, guild3, guild4, guild5, guild6, guild7, guild8, guild9];
Inside game it works (as well as methods)


First issue: As you can see object properties this.member this.reputation this.level and this.titleID are actor values for each actor for each guild. (so array of values unique for array of actor) while this.name and this.titles are strings - same for any actor.
What is right approach here? Should be this.member this.reputation this.level and this.titleID part of object guild or rather part of object actor ? Because of related methods for change values of these I am not sure.

Second issue: I was not able to include array of guilds to be part as actor properties. I am lost there. In rpg_object is prototype of actor, which is made from Game_Battler, which is made from Game_Battler_Base. There are functions for initialize, setup, init members,... I duno how and where include my array guilds. In fact, each actor needs only array (block of 9 guilds) made from this.member this.reputation this.level and this.titleID as name and titles are static strings forwarded from plugin parametters

Third issue: Changes made during play in reputation, level, etc.. are not saved while I save game. Yes, they are not part of actor which is probably reason. Possible approach is include them into actor (as they are related) or made save/load method for my guild plugin. Depends what is better approach?


Thank you for advices.

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,476
Members
137,824
Latest member
dobratemporal
Top