Recover Mp = Variable (x) + item bonus to var (y)

Nol

Veteran
Veteran
Joined
Oct 22, 2016
Messages
91
Reaction score
7
First Language
english
Primarily Uses
I'd like to limit Mp regen in my world, by making it so that Mages only regenerate when sleeping, and 10% of their Mmp + (bonus from a stat) + (bonus from items)


I envision creating a variable :


Var 1 = Bonus from stat of Actor 1


Var 2 = Bonus from equipement of actor 1


Var 3 = Var 1 + Var 2 + 10% Mmp


Regen MP : Add Var 3


Etc for each actor, (probably the long and painfull way, but if it works...)


but i dont know how i could give items a bonus to a variable, while having this bonus be lost if said item is unequiped.


Also... Is there another more elegant way to do this ?


Thanks for reading


Nol
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,461
Reaction score
10,885
First Language
German
Primarily Uses
RMMV
Since that sleep is an event, you can simply set the regular MP regeneration to zero outside that event and give a calculated number of MP when the event is processed.


The only problem is the time of the equipped parts - it is simple if you only check what is equipped when the event is processed, but that would allow the player to use different equipment during day and only equip the special bonus item when planning to sleep. That way the equipment doesn't give a direct bonus but is checked and gives a bonus by the event.


It is possible to count the time the player has the items equipped when not sleeping, but that would require a bit more on mathematics and the use of a carefully designed parallel process.
 

Nol

Veteran
Veteran
Joined
Oct 22, 2016
Messages
91
Reaction score
7
First Language
english
Primarily Uses
Since that sleep is an event, you can simply set the regular MP regeneration to zero outside that event and give a calculated number of MP when the event is processed.

 Indeed my reasoning so far, the calculation is the part that has me thinking still ;

The only problem is the time of the equipped parts - it is simple if you only check what is equipped when the event is processed, but that would allow the player to use different equipment during day and only equip the special bonus item when planning to sleep. That way the equipment doesn't give a direct bonus but is checked and gives a bonus by the event.



Spoken like a true Munchkin lol


I'm tempted to let this one slide, the game is not an easy "hold my hand" type, but while that way of abusing the system wouldn't hurt it much, it does have some Lore-related problems..

It is possible to count the time the player has the items equipped when not sleeping, but that would require a bit more on mathematics and the use of a carefully designed parallel process.



Reading your post on debugging has made me warry of parralel processes !


In the home made table top game this project is derived from, it take 24h (or a sleep cycle) for an items effect to come into action ; but that feels impossible to replicate here, doesn't it ?


Do you know by any chance how i can add a variable modification to an item, and if said modification will, by default be linked to the equipped state ?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,461
Reaction score
10,885
First Language
German
Primarily Uses
RMMV
 Reading your post on debugging has made me warry of parralel processes !


Do you know by any chance how i can add a variable modification to an item, and if said modification will, by default be linked to the equipped state ?



You can't link a variable to an equipped item (or any other passive object) directly, that's why I said you'll need a parallel process. And while parallel processes can cause problems when used without thinking, they are in the engine for a reason - because sometimes you need them.


What you need to do is a combination of two parallel processes - one to create time, because without a time process the game has no time.


And the second parallel process needs to check everything that needs time to take action, counting the time cycles the equipment is worn and comparing it to the conditions for the effects. That is the process that needs to be written carefully, because you need one process checking everything (it would be very bad to have different parallel processes checking different items as that will cause confusion).
 

Nol

Veteran
Veteran
Joined
Oct 22, 2016
Messages
91
Reaction score
7
First Language
english
Primarily Uses
The only problem is the time of the equipped parts - it is simple if you only check what is equipped when the event is processed

Oh i thought that meant there was a "simple way" of doing it ?


Did you mean conditional checks by naming all the Mp regen items, and checking for their presence or not ?


I'm not up to the task of parralel processes yet, it feels daunting to someone who doesnt have the syntax for most basic damage formulas
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,461
Reaction score
10,885
First Language
German
Primarily Uses
RMMV
yes, if you ignore the time just use a conditional branch for checking which items are equipped, and add a bonus based on that.


That way is simple, but not short - you still need one conditional branch for each item and each actor.


Anything else requires a plugin or a combination of script commands.
 

Nol

Veteran
Veteran
Joined
Oct 22, 2016
Messages
91
Reaction score
7
First Language
english
Primarily Uses
Yeah that's impossible, with over 300 anticipated items, even if only 1/5 give a bonus, and with 30 actors... it's my life that will be conditionnal ^^


What about a stacking state added by the item ? and said state using a script line to add a Var ?


My worry is that those wont be removed with the item
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,461
Reaction score
10,885
First Language
German
Primarily Uses
RMMV
no, in such a case you should either ask for a small plugin handling that directly or look for a way to gain the same effect from existing plugins.


One possibility that comes to mind is using a passive state plugin. Those plugins activate states on notetags, and those notetags can (depending on the plugin) be placed on equipment. This is what you could try with such a plugin:


make your equipments give states to the actors, and have those states do nothing (and no icen etc).


Then in the event you only need to check the actors for states, and it doesn't matter from which item the states come.


Still a lot of work on eventing, and has the problem that each state can only be there once on the actor.


Another option is a plugin that runs a common event on equip - in that case the common event can count up or down the variable.


Again an indirect way, but possible.


A third way is requiring a bit of scripting knowledge: you can use the meta function (see help file) to access the tags you write yourself, and use a small script to add the values of the tags in your equipment. That might be the best option, but I don't know how the meta function handles several notetags of the same type, you'll probably need help writing that scripted loop.
 

Nol

Veteran
Veteran
Joined
Oct 22, 2016
Messages
91
Reaction score
7
First Language
english
Primarily Uses
I've asked for too many plugins already ; The State workaround is something that speaks to me, so i'll head that way for now, and possibily change it later when i understand more about coding.


As usual, this was very helpful, thank you.
 

Latest Threads

Latest Profile Posts

Does anybody want to get weirded out? If so, I have a weird fact for them in the top comments.
Creating the mood, coloring, and lighting for this gonna need a big brain moment.1685936069202.png
Someone in a facebook group just corrected something I said, by saying exactly what I said. The mind boggles.
Less than 20 tiles remain in Inside_B that I need some kind of analogue of in my in custom Inside_B, and a whole 39 tiles that I didn't use and can thus make my own custom tiles or my own flavors of from other tile sheets.

Forum statistics

Threads
131,651
Messages
1,221,871
Members
173,392
Latest member
iwantpog
Top