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,346
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,346
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
711
Reaction score
379
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 Profile Posts

I managed to review my previous lessons on Learn MV and fixed a lot of things. Yay! :kaopride:
I've decided "Attack on Equestria" should be released first... hence this new ARG channel! https://www.youtube.com/channel/UClKiUI8xOVx9dsF4kRXUmxw
Check it out, and subscribe! The ARG will lead up to the video game. It's not a creepy game, but I just thought it should follow ARG standards.
For anyone interested in my project M - i finally made a gamethread about it :D

Forum statistics

Threads
110,409
Messages
1,053,089
Members
143,474
Latest member
Arsyloth
Top