Gigadragon78

Veteran
Veteran
Joined
Feb 2, 2019
Messages
55
Reaction score
17
First Language
Spanish
Primarily Uses
RMMV
Sorry to bother yourselves,i have a problem with this plugin. It works nearly perfect in MZ (with the DK compatibility patch). I want to set the enemy level to vary between 1 and 5 so i used this formula in the enemy tag:
<enemy level: var numbers = [1, 5] /> and it does not worked (it says level undefined).
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,345
Reaction score
8,078
First Language
German
Primarily Uses
RMMV
can you give a link to the plugin?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,345
Reaction score
8,078
First Language
German
Primarily Uses
RMMV
<enemy level: var numbers = [1, 5] />
this is not a valid formula.

the plugin instruction states:
<enemy level: FORMULA />
Where the formula is any valid javascript formula that evaluates to a number.

which means whatever formula you use, it has to be javascript AND it has to result in a numeric value.
your formula neither returns a value, not does it contain any randomizer function.

I don't know if the following solution would work as it can result in a float number:
Math.random() * (max - min) + min

or
<enemy level: Math.random() * (5 - 1) + 1 />
 

Gigadragon78

Veteran
Veteran
Joined
Feb 2, 2019
Messages
55
Reaction score
17
First Language
Spanish
Primarily Uses
RMMV
It does not worked,but thanks you very much for the intention. Finally i give up and decided to use a common variable and an parallell event that changes the levels randomly. The only problem is that the enemies with the same variable appears with the same level,for example 3 goblins with a level of 9. They are no randomized but is beggining.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
705
Reaction score
378
First Language
English
Primarily Uses
RMMV
I don't know if the following solution would work as it can result in a float number:
Math.random() * (max - min) + min

or
<enemy level: Math.random() * (5 - 1) + 1 />
Doesn't floor truncate to integer?
Math.floor(Math.random() * 5 ) + 1
 
Last edited:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,957
Reaction score
5,581
First Language
English
Primarily Uses
RMVXA
Yeah, based on the documentation I would think that a notetag like

<enemy level: Math.floor(Math.random() * 5) + 1 />

would work for getting a Level between 1 and 5. If that doesn't work, a couple things you can try:
  • Removing the space before the />
  • If you have an older version of this plugin, removing the / character. This is an escape code that Hime uses so that it knows you're not trying to use the > as part of the formula (such as "if (5 > 3)" ), and I think it's something that was added into later releases of the script rather than present in the first few versions.
 

Gigadragon78

Veteran
Veteran
Joined
Feb 2, 2019
Messages
55
Reaction score
17
First Language
Spanish
Primarily Uses
RMMV
Thanks you very much friends. The last one worked perfecty. Excuse me for the late reply,i feel a little sick lately.
 

Latest Threads

Latest Posts

Latest Profile Posts

Made the "My Beating Mystery" board today:
3ENFLSC.png

in Grim Trigger episodes 3 & 4, the main characters play a Clue rip-off board game called "My Beating Mystery" (haha), so of course I had to draw the board for it. Can't decide if I wanna add blood or not
Jeez...
I finally decide, after several ppl asking me to, to create a gamethread about project M... And my internet craps out on me halfway through the process :(
making my first game is like trying to stuff all my experience with old games into one
so its slow and painful when i dont get it right... i bet the next game is gonna be finished earlier!
When you don't find any time to work... :kaocry:
First Ten Minutes of my Caretaker inspired game

Forum statistics

Threads
110,401
Messages
1,053,011
Members
143,460
Latest member
Totaldramawwe
Top