- Joined
- Jul 28, 2015
- Messages
- 141
- Reaction score
- 43
- First Language
- czech
- Primarily Uses
- RMMV
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:
Then I made 9 guilds from Guild object - with imported GuildName and GuildTitles for each guild1-guild9
and merge all together inside array guilds.
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.
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..
};
and merge all together inside array guilds.
Code:
var guilds = [guild1, guild2, guild3, guild4, guild5, guild6, guild7, guild8, guild9];
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.
Last edited:
