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,382
Reaction score
8,099
First Language
German
Primarily Uses
RMMV
can you give a link to the plugin?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,382
Reaction score
8,099
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
791
Reaction score
432
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,969
Reaction score
5,596
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

Whenever I start on a new chapter, it doesn't feel like the next episodes, but more like sequels :)
It can be frustrating that so many commercial games have used up titles that might otherwise be great for a project.
Light up explosions with QABS and Community Lighting.
qcPQHt9.gif

Forum statistics

Threads
110,655
Messages
1,054,985
Members
143,779
Latest member
Epitaph78
Top