emelian65

Veteran
Veteran
Joined
Sep 13, 2015
Messages
195
Reaction score
65
First Language
Spanish
I planning to make the spells from my game be single Target or aoe target by using some of Yanfly plug ins, for some strange reason the <Disperse Damage> is now working, but I fear that is only temporarily so I want to know if there is a way to do it directly in the damage formula.


FFX-2 handled the spells that way, they only give you Single Target spells but you could make them aoe but deal less damage. that's what I want to do instead of making one spell for each tier and then for each single or multi, although it seems I'll need to do that for foes as they CANNOT make use of the single aoe feature.
 

SergeX

Veteran
Veteran
Joined
Nov 25, 2012
Messages
64
Reaction score
15
First Language
Portuguese
Primarily Uses
Let's see if anyone can help me...


In my game, elemental spells are tied with variables, and the damage output is influenced by these variables. In my game, this is made so according to the environment, the elemental spell can get a bonus (ex: a water spell used on a beach place would have a 50% boost) or a deboost (a water spell used in the dry desert would do -50% damage).


In VXA I used to have this formula, which doesn't work on MV.


(100 + a.mat* 4 ) * ( 1 + ( v[x] / 10) )


I'm using the Armor Scaling plugin from Yanfly. How can I translate this formula and make it work on MV?


The logic behind the formula is:


if [v] < 0 = damage nerf (ranges from -10% at [v] = -1 to -50% at [v] = -5)


if [v] = 0 = normal damage


if [v] > 0 = bonus damage (ranges from +10% to +50% at [v] = 5)


Thanks in advance!
 
Last edited by a moderator:

Aethers

Villager
Member
Joined
Feb 17, 2015
Messages
9
Reaction score
1
Primarily Uses
New to RMMV and the coding in general, and I want to ask if it is possible to assign Variable to the enemies in battle (or anything with ID for example?) for easier calculation?


In the project, enemies have [Natural Defense] (Read: Defense Stat) and [Armor] (read: a variable).


Basically it comes down to [Attacker's Total damage] - [Enemy's Natural Defense + Armor] in the end.


However, some abilities allows to bypass (pierce) or chip the [Armor] (Bash).


Basically, the variable isn't always constant and is required in the damage formula.


Using the script function/Notetags, is is possible to assign variable [x] to say enemy 1;2;3 and so on? So I can assign the formula in calculation for each enemies independently.


How should I go around this in custom script so I don't have to work with battle events? I assume it is possible to call enem(ies) ID and go from there? 


Sorry if I am being unclear, I am still quite unsure about starting on the whole JS Function thing.


EDIT: To clarify, what I had in mind is to use battle event (condition: Turn 0) to assign all the required variables into the Enemies as well as players and let the custom calculation in Skills note tags to do the job for the rest of the battle. Is there a way to do so?


EDIT2: After some researching, it seems enemy's note can be used as Script function. I am just guessing, but Is there a way to attach or create a variable for the enemy from here?
 
Last edited by a moderator:

KeeganKLM

Noobish Adventurer
Veteran
Joined
Jun 16, 2016
Messages
30
Reaction score
9
First Language
English
Primarily Uses
RMMV
New to RMMV and the coding in general, and I want to ask if it is possible to assign Variable to the enemies in battle (or anything with ID for example?) for easier calculation?


In the project, enemies have [Natural Defense] (Read: Defense Stat) and [Armor] (read: a variable).


Basically it comes down to [Attacker's Total damage] - [Enemy's Natural Defense + Armor] in the end.


However, some abilities allows to bypass (pierce) or chip the [Armor] (Bash).


Basically, the variable isn't always constant and is required in the damage formula.


Using the script function/Notetags, is is possible to assign variable [x] to say enemy 1;2;3 and so on? So I can assign the formula in calculation for each enemies independently.


How should I go around this in custom script so I don't have to work with battle events? I assume it is possible to call enem(ies) ID and go from there? 


Sorry if I am being unclear, I am still quite unsure about starting on the whole JS Function thing.


EDIT: To clarify, what I had in mind is to use battle event (condition: Turn 0) to assign all the required variables into the Enemies as well as players and let the custom calculation in Skills note tags to do the job for the rest of the battle. Is there a way to do so?


EDIT2: After some researching, it seems enemy's note can be used as Script function. I am just guessing, but Is there a way to attach or create a variable for the enemy from here?



I couldn't understand you very well, but I think I know what you're trying to do.


Are you trying to make Armor kind of like an extra Health bar so that you have to take out the armor first, then you can deal damage to the actual Health?


If that IS what you're looking for, I'm pretty sure this will solve your problem:


http://yanfly.moe/2016/02/13/yep-70-absorption-barrier-rpg-maker-mv/

Let's see if anyone can help me...


In my game, elemental spells are tied with variables, and the damage output is influenced by these variables. In my game, this is made so according to the environment, the elemental spell can get a bonus (ex: a water spell used on a beach place would have a 50% boost) or a deboost (a water spell used in the dry desert would do -50% damage).


In VXA I used to have this formula, which doesn't work on MV.


(100 + a.mat* 4 ) * ( 1 + ( v[x] / 10) )


I'm using the Armor Scaling plugin from Yanfly. How can I translate this formula and make it work on MV?


The logic behind the formula is:


if [v] < 0 = damage nerf (ranges from -10% at [v] = -1 to -50% at [v] = -5)


if [v] = 0 = normal damage


if [v] > 0 = bonus damage (ranges from +10% to +50% at [v] = 5)


Thanks in advance!

That's a very nice concept, having some spells work better/worse in certain areas!


I'm 98% sure that the formula (100 + a.mat* 4 ) * ( 1 + ( v[x] / 10) ) works on MV.


After all, my formula ( a.atk - b.def ) * a.mat / b.mdf * 13 / 3 * ( v[5] - 1 ) works totally fine, so I don't know why yours wouldn't...


And I actually use the same defence formula(basically but not literally) as Yanfly's Armor Scaling Plug-In, but I prefer to keep that inside the formula rather than having the plug-in do it for me, cause I like to see everything that's happening to my formula.


The only few problems I can think of that you may be doing are...


1. You might not be setting the variable(s) correctly before the battle. (be sure to do battles on (Playtest) rather than (Battle Test...) if you want to use that formula, since variables most likely won't change before the battle starts, unless you manually set them to do so)


2. The Armor Scaling Plug-in is affecting the formula unexpectedly.


3. You may be leaving v[x] as literally v[x] in the coding instead of replacing x with a number.


By the way, you never specified why/how it doesn't work. You should specify what it does after you (insert verb here).


It helps if you specify exactly what doesn't work about it. Even if it's the generic, well-known "only returns as 0," it's just always better to have more information.
 
Last edited by a moderator:

SergeX

Veteran
Veteran
Joined
Nov 25, 2012
Messages
64
Reaction score
15
First Language
Portuguese
Primarily Uses
That's a very nice concept, having some spells work better/worse in certain areas!


I'm 98% sure that the formula (100 + a.mat* 4 ) * ( 1 + ( v[x] / 10) ) works on MV.


After all, my formula ( a.atk - b.def ) * a.mat / b.mdf * 13 / 3 * ( v[5] - 1 ) works totally fine, so I don't know why yours wouldn't...


And I actually use the same defence formula(basically but not literally) as Yanfly's Armor Scaling Plug-In, but I prefer to keep that inside the formula rather than having the plug-in do it for me, cause I like to see everything that's happening to my formula.


The only few problems I can think of that you may be doing are...


1. You might not be setting the variable(s) correctly before the battle. (be sure to do battles on (Playtest) rather than (Battle Test...) if you want to use that formula, since variables most likely won't change before the battle starts, unless you manually set them to do so)


2. The Armor Scaling Plug-in is affecting the formula unexpectedly.


3. You may be leaving v[x] as literally v[x] in the coding instead of replacing x with a number.


By the way, you never specified why/how it doesn't work. You should specify what it does after you (insert verb here).


It helps if you specify exactly what doesn't work about it. Even if it's the generic, well-known "only returns as 0," it's just always better to have more information.



It's like you said: damage only returns as 0, I don't know why. Maybe it's a syntax problem? My coding skills are poor, so I can't pinpoint the exact cause neither fix it.


I've tried with Armor Scalling off and even so I kept getting 0, so I don't think that the problem is the plugin, but rather the formula itself.


Thank you very much!
 

Crimson Dragon Inc.

Crimson Dragon
Veteran
Joined
Aug 8, 2012
Messages
921
Reaction score
134
First Language
english
Primarily Uses
RMMV
so if i'm reading this right.......i can use variables in damage formula using the code v[x] where x is the chosen variable?
 

KeeganKLM

Noobish Adventurer
Veteran
Joined
Jun 16, 2016
Messages
30
Reaction score
9
First Language
English
Primarily Uses
RMMV
.

so if i'm reading this right.......i can use variables in damage formula using the code v[x] where x is the chosen variable?

yup.


Wanna know a TON of other stuff you can also do?


Go here and have your mind explode: http://www.rpgmakercentral.com/topic/36290-damage-formulas-101-mv-edition/

It's like you said: damage only returns as 0, I don't know why. Maybe it's a syntax problem? My coding skills are poor, so I can't pinpoint the exact cause neither fix it.


I've tried with Armor Scalling off and even so I kept getting 0, so I don't think that the problem is the plugin, but rather the formula itself.


Thank you very much!

You're welcome!


But that is very odd...


I can't think of much else, other than checking the Variable, making sure you spelled a.mat right (I speak from experience), and maybe check b.mdf, even if it's not in your formula. Since you're using Yanfly's Armor Scaling, that just might effect it, but I can't tell right now, as I do not have it installed, but I noticed on Yanfly's page for it that it had some note tags saying  <Magical Armor Penetration: x%>  and  <Magical Armor Penetration: x>  so I'd check that in the plug-in and your game.


Other than that, I'm not sure what you'd be doing wrong... Sorry if I can't help ya.
 

Mahoken

Veteran
Veteran
Joined
Nov 24, 2013
Messages
41
Reaction score
3
First Language
English
Primarily Uses
Probably a simple question that's been answered before, but how do I make this skill deal double damage if the enemy is affected by a state (or multiple states)?


This is the formula I have at the moment, but it keeps giving me 0 damage when I use it, so I know something is wrong (I have no idea how to code):


b.isStateAffected(5) ? ((a.level*14)+(1.3*a.mat))*(100.0/(100+b.mdf)) : ((a.level*7)+(0.65*a.mat))*(100.0/(100+b.mdf));end
 

BodkinsOdds

Villager
Member
Joined
Jul 26, 2014
Messages
8
Reaction score
2
First Language
English
Primarily Uses
And then he promptly forgot about it, and didn't write anything up when he got home from work. Sorry.


I just remembered an amazing guide I found a while ago, which might even be worth asking @Shaz to add to the OP. It can be found here: https://rpgmakermv.co/threads/damage-formulas-101-mv-edition.2172/


Sadly, it wasn't able to provide a simple solution. When I tried the formula (a.mp);(a.setMp(0)) it dealt 0 damage. I think it was running everything at once, then animating, then recalculating the damage, because a.mp and a.setMp(0) both worked individually. So we're going to have to go back to the plugin method.



Actually, you're overthinking it. The final statement in the formula is the damage, so all you need to do for this is:


var d = a.mp; a.setMp(0); d


And done.

Probably a simple question that's been answered before, but how do I make this skill deal double damage if the enemy is affected by a state (or multiple states)?


This is the formula I have at the moment, but it keeps giving me 0 damage when I use it, so I know something is wrong (I have no idea how to code):


b.isStateAffected(5) ? ((a.level*14)+(1.3*a.mat))*(100.0/(100+b.mdf)) : ((a.level*7)+(0.65*a.mat))*(100.0/(100+b.mdf));end



This one is easy. First, if you get rid of the ;end it'll work fine, secondly you don't need to type in the damage formula twice:


var d = ((a.level*7)+(0.65*a.mat))*(100.0/(100+b.mdf)); b.isStateAffected(5) ? d * 2 : d


This way is easier to maintain if you change the damage formula later. If you really meant it to be double damage before defenses then:


var d = ((a.level*7)+(0.65*a.mat)); b.isStateAffected(5) ? d * 200 / (100 + b.mdf) : d * 100 / (100 + b.mdf)
 
Last edited by a moderator:

emelian65

Veteran
Veteran
Joined
Sep 13, 2015
Messages
195
Reaction score
65
First Language
Spanish
Probably a simple question that's been answered before, but how do I make this skill deal double damage if the enemy is affected by a state (or multiple states)?


This is the formula I have at the moment, but it keeps giving me 0 damage when I use it, so I know something is wrong (I have no idea how to code):


b.isStateAffected(5) ? ((a.level*14)+(1.3*a.mat))*(100.0/(100+b.mdf)) : ((a.level*7)+(0.65*a.mat))*(100.0/(100+b.mdf));end



Try this one, but the only problem I see with yours is the 100.0 why are you adding that?

Code:
b.isStateAffected(5) ? ( (a.level * 14 ) + ( 1.3 * a.mat ) ) * ( 100 / ( 100 + b.mdf ) ) : ( ( a.level * 7 ) + ( 0.65 * a.mat ) ) * ( 100 / ( 100 + b.mdf ) )
 

Mahoken

Veteran
Veteran
Joined
Nov 24, 2013
Messages
41
Reaction score
3
First Language
English
Primarily Uses
Actually, you're overthinking it. The final statement in the formula is the damage, so all you need to do for this is:


var d = a.mp; a.setMp(0); d


And done.


This one is easy. First, if you get rid of the ;end it'll work fine, secondly you don't need to type in the damage formula twice:


var d = ((a.level*7)+(0.65*a.mat))*(100.0/(100+b.mdf)); b.isStateAffected(5) ? d * 2 : d


This way is easier to maintain if you change the damage formula later. If you really meant it to be double damage before defenses then:


var d = ((a.level*7)+(0.65*a.mat)); b.isStateAffected(5) ? d * 200 / (100 + b.mdf) : d * 100 / (100 + b.mdf)



Seems to be working very well, thank you! Only thing I'm having an issue with is adding more than one affected state to that formula, so another noob issue.


var d = ((a.level*7)+(0.65*a.mat)); b.isStateAffected(5,6,7) ? d * 200 / (100 + b.mdf) : d * 100 / (100 + b.mdf)


Does adding numbers in states affected work if you add commas like that?
 

Crimson Dragon Inc.

Crimson Dragon
Veteran
Joined
Aug 8, 2012
Messages
921
Reaction score
134
First Language
english
Primarily Uses
RMMV
hey um trying to write a damage formula for a skill that grows stronger with every use...........any ideas on how to implement this?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,090
Reaction score
15,504
First Language
English
Primarily Uses
RMMV
Seems to be working very well, thank you! Only thing I'm having an issue with is adding more than one affected state to that formula, so another noob issue.


var d = ((a.level*7)+(0.65*a.mat)); b.isStateAffected(5,6,7) ? d * 200 / (100 + b.mdf) : d * 100 / (100 + b.mdf)


Does adding numbers in states affected work if you add commas like that?



That's because isStateAffected receives ONE argument, not as many as you want to throw at it.  Try [5,6,7].some(function(state) { return b.isStateAffected(state); })


@Crimson Dragon Inc. you'd probably have to use a variable in the damage formula, and make the damage formula increment it as well.
 
Last edited by a moderator:

Aethers

Villager
Member
Joined
Feb 17, 2015
Messages
9
Reaction score
1
Primarily Uses
@KeeganKLM


Yeah, I was too absorbed with my initial idea I didn't realize the armor scaling and absorption already do what I wanted. My bad. ALSO, THANKS for that Damage101 link. That sure helps me to understand how lunatic coding works.


I still have a bit of question about variables though! Please bear with my question a bit longer (even if my questions sounds...stupid/ignorant)


Can Variables be used as INDEPENDENT Parameter?


Okay, this is actually two question. Is it possible to establish a brand new parameter for the actors (and in extension, enemies) without exchanging the pre-existing ones (MATK/ ATK/TRT/PHA/etc) ? For example, if I want to make a parameter for everyone like, uhh, (for example) [FATIQUE (FTQ)] or something like that; would it be possible?


However, would this brand new parameter :


1. Useable in damage formula or ANY formula in general? BUT


2. Also treated independently for each actor?


It might be a bit confusing but let's say I set var001 as [FTQ]. If I only reference this variable for each actor, the damage will be all messed up because even if everyone start or have different [FTQ], it overwrites the same variable. Which is bad. ALTERNATIVELY, if I make [FTQ1],[FTQ2] and so on for every actor, it makes the formula full of conditions - check which user it is before using which VAR. Which is doable, but also tedious.


I am looking at user.Matk kind of reference/parameter call during damage calculation which makes it a lot easier (I think?) and neater script. In addition, I am also looking at the new Self Variable plugin, which sounds promising, but I am not sure how and if it is possible to.


Bottom line, making a user.stat (I guess, I don't know if this is even the correct way of saying this) ?


Can the above example applied to enemies


Right, it gets more confusing for me too. So can it be done/set up for enemies too. The VAR will rise and fall as the battle goes on; which makes me a bit more concerned about it. Let's say I used Variable again - since that's all I know because I never use any RM after 2003 - and make [E-FTQ] and set it for a monster - maybe in notetag.


What happens if there are multiple enemies of the same ID in the enemy Troops? I am pretty sure it gets all messed up since it is a single variable that gets overwritten by multiple same IDs. Not to mention the calculations required for each battle event would probably be ridiculously long/complicated.


This is why I am interested about attaching it as an individual stat for each combatant/actor/enemy instead. Please tell me it is possible lel.


Last but not least?


In some JS example, I see sometimes a new variable being defined. For example, in one of Yanfly's tips and trick


<Custom Apply Effect>
target._deathMarkDmg = 0;
</Custom Apply Effect>

<Custom React Effect>
if (value > 0 && attacker === origin && this.isHpEffect()) {
target._deathMarkDmg += value;
}
</Custom React Effect>


That target._deathmarkdmg is something brand new I think (?). So the question is, we can define a variable via JS? How is it different from using VAR001 and so on? Does this value stick forever (I have seen codes that end it as =undefined to clear the value)? Does it only apply for that battle? 


Basically I want to know if it works differently than normal SETVAR function Rpgmaker have.


Sorry if it drags on too long, but I am really looking forward to see what I can (and not) do with all these possibilities.
 
Last edited by a moderator:

Bob7

Veteran
Veteran
Joined
Oct 22, 2015
Messages
30
Reaction score
10
First Language
English
Just a quick question, is there anyway to introduce the variable from another character?


I'm trying out some multi-character skills (skills that use two actors for joint attack.) In this example, I want to use the initial user's attack and the 2nd character's magic attack for the calculation.  (2nd character's special attack + (2 x 1st character's attack))


Is there a way to target a specific actor's stat (not merely the actor in Slot 2, but the specific character in question)?
 

KeeganKLM

Noobish Adventurer
Veteran
Joined
Jun 16, 2016
Messages
30
Reaction score
9
First Language
English
Primarily Uses
RMMV
Just a quick question, is there anyway to introduce the variable from another character?


I'm trying out some multi-character skills (skills that use two actors for joint attack.) In this example, I want to use the initial user's attack and the 2nd character's magic attack for the calculation.  (2nd character's special attack + (2 x 1st character's attack))


Is there a way to target a specific actor's stat (not merely the actor in Slot 2, but the specific character in question)?



I do not currently have access to RPG Maker MV, but I'll try to help you the best I can.


How I would do this, is I'd make a skill that does absolutely nothing except call a common event. (Only because common events happen after the actual attack) You can call a Common Event through a skill in the Effects section.


For this example, we'll call the common event "Team Attack" and I'm going to use the names Diego and Terry for this example.


For now, I'm just going to assume you know how to disable the skill when one of the actors are out of the party. If you don't, then tell me (and specify certain things like if the player can willingly get them out of the party or not) and I'll get back to you on that.


In Team Attack, have it set Variable (X) to Actor Terry's MAT. (You can do this by going to Change Variables...)


Then, have it Force Action on Diego to make him use this other skill I'll just call "Teamwork!".


(By the way, Force Action doesn't let you choose the target, but I believe that somehow you can make it so that a skill tries to target someone with a specified state if the target is randomized. I can't remember how, but I'll look into it when I can.)


(Force Action lets you target the previous target, so just select that one and you'd probably be fine.)


I believe Force Action works by indexes, if I remember correctly. So for now, all I can think of for using Diego on the Force Action command is using a list of conditional branches that test which party member slot he's in, which I could probably explain more in depth when I can use MV again.


But anyway, you could use Variable (X) in the skill "Teamwork!" so that it modifies its damage.


Here's an example for the skill formula:


v[x] + ( a.atk * 2 )


Of course, instead of using v[x], you'd have to replace x with whatever variable you decide to use. If you need anything specified a bit more, feel free to ask.


Hope that was helpful!


Also...


@Aethers


I'm actually not that good at coding at all, or at least creating it.


However, in my quest to help you with my current wisdom and knowledge, I thought what you might want was a plug-in that added more parameters (that you'd be able to set/modify through note tags). I know that I, personally, would LOVE to have a plug-in like that, but I sadly couldn't find anything. But then again, I was always the worst at researching... 


If you can somehow figure out how to use something like that, or find a plug-in that would work that I obliviously missed, I'd appreciate it if you could notify me, as I'd like to use something like that as well.
 
Last edited by a moderator:

Bob7

Veteran
Veteran
Joined
Oct 22, 2015
Messages
30
Reaction score
10
First Language
English
I do not currently have access to RPG Maker MV, but I'll try to help you the best I can.


How I would do this, is I'd make a skill that does absolutely nothing except call a common event. (Only because common events happen after the actual attack) You can call a Common Event through a skill in the Effects section.


For this example, we'll call the common event "Team Attack" and I'm going to use the names Diego and Terry for this example.


For now, I'm just going to assume you know how to disable the skill when one of the actors are out of the party. If you don't, then tell me (and specify certain things like if the player can willingly get them out of the party or not) and I'll get back to you on that.


In Team Attack, have it set Variable (X) to Actor Terry's MAT. (You can do this by going to Change Variables...)


Then, have it Force Action on Diego to make him use this other skill I'll just call "Teamwork!".


(By the way, Force Action doesn't let you choose the target, but I believe that somehow you can make it so that a skill tries to target someone with a specified state if the target is randomized. I can't remember how, but I'll look into it when I can.)


(Force Action lets you target the previous target, so just select that one and you'd probably be fine.)


I believe Force Action works by indexes, if I remember correctly. So for now, all I can think of for using Diego on the Force Action command is using a list of conditional branches that test which party member slot he's in, which I could probably explain more in depth when I can use MV again.


But anyway, you could use Variable (X) in the skill "Teamwork!" so that it modifies its damage.


Here's an example for the skill formula:


v[x] + ( a.atk * 2 )


Of course, instead of using v[x], you'd have to replace x with whatever variable you decide to use. If you need anything specified a bit more, feel free to ask.


Hope that was helpful!


Also...


@Aethers


I'm actually not that good at coding at all, or at least creating it.


However, in my quest to help you with my current wisdom and knowledge, I thought what you might want was a plug-in that added more parameters (that you'd be able to set/modify through note tags). I know that I, personally, would LOVE to have a plug-in like that, but I sadly couldn't find anything. But then again, I was always the worst at researching... 


If you can somehow figure out how to use something like that, or find a plug-in that would work that I obliviously missed, I'd appreciate it if you could notify me, as I'd like to use something like that as well.



Well, after trying that out and some further research, it seems like that yes, I have to create different parts to the skill, and then combine it all at once.


Thanks to some further assistance, I've done my best to make the skill animations as fluent as possible while making sure the individual skills use the correct variables at certain stages. (So the first hit would be its own skill, and then the second hit would also be its own skill there.)


However, while all this worked out as I liked it to, I did eventually hit a wall with restrictions (which basically ensuring the skill doesn't go off if the 2nd character is in no position to use the skill.) While I could disable the skill if the 2nd character was not present or was KOed, I couldn't stop them if they didn't have the required amount of points nor if they were unable to move.


I'm going to try another plugin to rectify that one remaining problem, and should all go well, I think I can finally create a dual skill that calculates individual hits using specific formulas, while being subject to both members meeting the requirements. 
 

TheRiotInside

Extra Ordinaire
Veteran
Joined
Sep 3, 2012
Messages
270
Reaction score
124
First Language
English
Primarily Uses
@KeeganKLM Hey, if you were still looking around for a plugin to add custom parameters, definitely check out Quasi Params Plus! You can make your own parameters with it, which can be used in damage formulas and has compatibility with a lot of popular plugins. :)
 
Last edited by a moderator:

Riku_Masamune

Veteran
Veteran
Joined
Aug 23, 2016
Messages
50
Reaction score
19
First Language
English
Primarily Uses
RMMZ
a.gainHp(-500~-999);a.mat*5

I've tried everything I can think of to get a random -number. Works with solo numbers. I even did a list of numbers using || (or) for them to take place, but only did the first set when written out a.gainHp(-111||-222) etc. It's a spell that I was trying to use that'd be taxing on the user, but a bit more "fair" to the player and a surprise when Actor looses a lot of HP. Any help would be appreciated.
 

TheRiotInside

Extra Ordinaire
Veteran
Joined
Sep 3, 2012
Messages
270
Reaction score
124
First Language
English
Primarily Uses
@Riku_Masamune Hey, see if this works:


a.gainHp(-(Math.randomInt(500) + 500)) ; a.mat * 5


My syntax might be off somewhere, but the Math.randomInt(500) function should give you something in the 0 to 499 range, so adding 500 after should give you the 500 to 999 you're looking for. :)
 
Last edited by a moderator:

Latest Threads

Latest Posts

Latest Profile Posts

Folks, if anyone sends you a message inviting you to add their API to your game, please report them. We don't want people spamming our members asking them to add stuff to their games for their own (or others') benefit.
I'm listening to iiluminaughtii talking about the secrets behind shady businesses and scams. Meanwhile I'm writing a fanfic about Sephiroth from FF7, one specifically for my stepmom. I'll get to give it to her, too, because my boss said I could take the holidays off! Dec. 22-27 I will be in Orlando, and maybe Fort Myers too, visiting my dad and stepmom!
Of course, I bought a handful of games on the Steam Black Friday sale. Will I try them? Will I complete any? Who knows...
I don't really have any neat updates today about how I screwed up programming... But if you want to observe the intensenes of me programming, then you can check out my stream :)
New Weapons.gif
No more spam from me today, I promise! Just wanted to upload this, people have been giving me feedback that my weapon sprites (which were RTP) clashed badly with my battlers for ages, so today I finally took the plunge and updated them! Really happy with how they came out :D :D

Forum statistics

Threads
117,010
Messages
1,103,787
Members
152,906
Latest member
Heru_
Top