Hi everyone. I'm only just starting out with both JS and programming in general, and as you might expect, I have run into some difficulties. Namely, I want to create a feature whereby:
1, An ability deals damage, as well as drains a portion of that damage. I have that down, as it is easy to create such an ability with the Damage Type -> Hp Drain feature in the editor. My problem is how to point to that data? Where is the number that is the amount of damage dealt or the amount drained?
2, The damage/amount drained persists in a variable which is subsequently added to via
bloodPool += subsequent draining attacks;. I.e. we're talking about a 'blood pool' if you will, which the player fills by using draining attacks. My problem, indeed shortcoming, is that I understand how to modify a feature through
var _Eat_Sirlion_Steak = Eating.prototype.eatOnlyCelery = function() {};but that's modifying something - I want to introduce the a new variable which will correspond to the amount of blood the 'blood pool' has. I suppose I could tack a var or this. statement onto something pretty much unrelated, but that seems to me, even with my barely rudimentary understanding of js or programming, to be a butchery of the code and most inelegant and very confusing in the long run. So I was wondering if there is a clean and elegant way of introducing new code and thereby variables through plugins?
3, Finally, and I guess this is a very tall order, I want to commit that variable to persistent storage. I was hoping of storing it in Actors.JSON via assigning to
$gameActors(1).bloodPool;but to no avail. Am I just out of luck on this last one?
I realise that I'm asking a lot of questions, I'm sorry for the wall of text and thanks in advance!
1, An ability deals damage, as well as drains a portion of that damage. I have that down, as it is easy to create such an ability with the Damage Type -> Hp Drain feature in the editor. My problem is how to point to that data? Where is the number that is the amount of damage dealt or the amount drained?
2, The damage/amount drained persists in a variable which is subsequently added to via
bloodPool += subsequent draining attacks;. I.e. we're talking about a 'blood pool' if you will, which the player fills by using draining attacks. My problem, indeed shortcoming, is that I understand how to modify a feature through
var _Eat_Sirlion_Steak = Eating.prototype.eatOnlyCelery = function() {};but that's modifying something - I want to introduce the a new variable which will correspond to the amount of blood the 'blood pool' has. I suppose I could tack a var or this. statement onto something pretty much unrelated, but that seems to me, even with my barely rudimentary understanding of js or programming, to be a butchery of the code and most inelegant and very confusing in the long run. So I was wondering if there is a clean and elegant way of introducing new code and thereby variables through plugins?
3, Finally, and I guess this is a very tall order, I want to commit that variable to persistent storage. I was hoping of storing it in Actors.JSON via assigning to
$gameActors(1).bloodPool;but to no avail. Am I just out of luck on this last one?
I realise that I'm asking a lot of questions, I'm sorry for the wall of text and thanks in advance!