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
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.
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.
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
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.
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.