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

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,563
Reaction score
8,159
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
950
Reaction score
498
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
6,018
Reaction score
5,667
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

Hey everyone! No Studio Blue RPG Maker Critiques Stream today! But you can always check the playlist for old streams you've missed!

I ran out of paper sheets to draw, so I guess I'm forced to do digital for a while now...
x778xt8.jpg

Still haven0t found a colouring style that I like :kaoswt:
woods.pngshop.jpgboss.jpgRoom.png

Mapping is becoming so much easier!
FirestormNeos wrote on Neikoku's profile.
the cat in your profile picture is adorable
Are the default-size "chibi" sprites really a bad thing for a project? I'm not planning to sell my game anyway but I was wondering if they were as hated as some videos seem to claim...

Forum statistics

Threads
111,432
Messages
1,061,088
Members
144,798
Latest member
Orion3G
Top