Enemy Positions

Mr. Trivel

Glasses
Veteran
Joined
Jun 9, 2014
Messages
284
Reaction score
460
First Language
Lithuanian
Primarily Uses
Name: Enemy Positions


Version: 1.1


Author: Mr. Trivel


Created: 2016-01-11


 


What does it do?


Allows to change enemy positions through adding tags.



In case of multiple tags - tag at random will be picked.





 


Screenshots:




Not this time.


 



How to use?





Use following tags inside enemy note fields. In case of multiple tags - tag at random will be picked.


Position is in pixels.


<Position: [X] [Y]>


E.g.: <Position: 500 200>






 



Plugin: <Link: Github>


How to download Script. Click the link above, there will be a button named Raw, press Right Click -> Save As.







Terms of Use:


Don't remove the header or claim that you wrote this plugin.
Credit Mr. Trivel if using this plugin in your project.
Free for commercial and non-commercial projects.
 
Last edited by a moderator:

Mr. Trivel

Glasses
Veteran
Joined
Jun 9, 2014
Messages
284
Reaction score
460
First Language
Lithuanian
Primarily Uses
Update v1.1

 - Now compatible with Hime's Enemy Reinforcements.
 

manoma

Villager
Member
Joined
Jan 8, 2016
Messages
6
Reaction score
0
it would be good to have a plugin that change things about the enemy depending on his position, like Darkest Dungeon where you had to defeat the enemies in the front first, then this plugin would be good to randomize the enemies formations, but still a good plugin to add some variation the the enemies :)
 

Gauze

Veteran
Veteran
Joined
Jan 9, 2016
Messages
53
Reaction score
6
First Language
Português
Primarily Uses
N/A
There is a plugin about battle formation already.

it would be good to have a plugin that change things about the enemy depending on his position, like Darkest Dungeon where you had to defeat the enemies in the front first, then this plugin would be good to randomize the enemies formations, but still a good plugin to add some variation the the enemies :)
 

Gauze

Veteran
Veteran
Joined
Jan 9, 2016
Messages
53
Reaction score
6
First Language
Português
Primarily Uses
N/A
This is what appear when i try to download the game, they send me to this page and i dont know how to convert to JS file

Screenshot_3.png
 

Mr. Trivel

Glasses
Veteran
Joined
Jun 9, 2014
Messages
284
Reaction score
460
First Language
Lithuanian
Primarily Uses
You shouldn't stop reading the post at the line that starts with Plugin.

Try reading one line below that.
 

Gauze

Veteran
Veteran
Joined
Jan 9, 2016
Messages
53
Reaction score
6
First Language
Português
Primarily Uses
N/A
Alright thanks for the help Messere
 

Coopziana

Veteran
Veteran
Joined
Jan 18, 2016
Messages
115
Reaction score
44
First Language
English
Is there any way I can change the script to accept a "Math.random" instead of an integer for the note tag?
It seems a bit of a big job to have to list 20-50 different coordinates just to get the enemies to appear in random locations.

I'd like to basically have <Position: Math.floor(Math.random() * ((y-x)+1) + x);> as a single notetag so the game works it out for me... cuz I'm lazy lol.

Edit:
For those interested I managed to edit the script to get it to do what I wanted. It makes it MUCH easier to use this script now. In the JS file go to line 72-ish or search for this part of the script:

var newX = Number(newCoordinates[0]);
var newY = Number(newCoordinates[1]);

Comment out from "Number" by putting to forwardslashes "//Number" (Cuz never delete code).

And change to this:

var newX = Math.floor(Math.random()*((y1-x1)+1)+x1);//Number(newCoordinates[0]);
var newY = Math.floor(Math.random()*((y2-x2)+1)+x2);//Number(newCoordinates[1]);

Then above that Add in 4 Variables for your X1, Y1, X2, Y2. Here is an example of what I've put, but you can play around with the numbers to make your enemies spawn in an appropriate space for you.

var x1 = 100; //Min
var y1 = 600; //Max
var x2 = 250; //Min
var y2 = 400; //Max
var newX = Math.floor(Math.random()*((y1-x1)+1)+x1);//Number(newCoordinates[0]);
var newY = Math.floor(Math.random()*((y2-x2)+1)+x2);//Number(newCoordinates[1]);

Then as long as you put a single notetag into your enemy notetags, you will have your enemies spawning in a random location within the area you set in your variables.

Hope this helps.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

suspended on twitter for calling an ahole an ahole & appealing the tweet; furious at myself for being even slightly upset with my suspension: oh no, you've been temporarily banned from hell. GET OVER IT, me.
how can you download the tiles from a forum post here? HELP
That moment when you post the wrong download link to your game and wonder why it got so few downloads... :mad:
Trying to make it so my map is cleared of "random" events after the player leaves the map... to little success >.< I think I might need to ask help for this.
Had my first interaction with a legit homophobe concerning one of my games today. Tempting to engage, but pointless.

Forum statistics

Threads
94,245
Messages
919,368
Members
123,959
Latest member
CecilGP
Top