SE Custom Enemies Help Thread

Mapping related threads and questions go in here!
User avatar
Tecminer
Posts: 437
Joined: 11 Jan 2014, 20:44
Contact:

Post » 28 May 2015, 18:11

this

Code: Select all

{
	"quadcount": 1,

	"movement": "none",
	"stompable": false,
	"killsonbottom": false,
	"killsonsides": false,
	
	"animationtype": "frames",
	"animationstart": 1,
	"animationframes": 1,
	"animationspeed": 0.1,
	
	
	"nospritesets": true,
	
	"gravity": 0,

	"spawnsenemy": turretgun,
	"SpawnEnemyDelays": 0.1,
	
	"transforms": true,
	"transformsinto": turret,
	"transformtrigger": death,

	"lifetime": 0.2,
	
	"width": 1,
	"height": 1,
	
	"static": false,
	"active": true,
	
	"category": 4,
	
	"mask": [	true, 
				true, false, false, false, true,
				false, true, false, true, false,
				false, false, false, false, false,
				true, true, false, false, false,
				false, true, true, false, false,
				true, false, true, true, true],
					
	
	"emancipatecheck": true,
	"autodelete": true,
	
	"offsetX": 0,
	"offsetY": 0,
	"quadcenterX": 8,
	"quadcenterY": 8
}
gets me this
Image

Squidish
Posts: 678
Joined: 05 Apr 2014, 04:04

Post » 28 May 2015, 20:37

I may be wrong, but i don't think you need an animation if there's only one frame. Either that or there's a spriteset and you didn't turn it on

User avatar
TurretBot
Posts: 4412
Joined: 15 Mar 2012, 23:18
Contact:

Post » 28 May 2015, 21:11

Squidish wrote:i don't think you need an animation if there's only one frame
use "none"

User avatar
Tecminer
Posts: 437
Joined: 11 Jan 2014, 20:44
Contact:

Post » 28 May 2015, 21:29

yea, i had "none" before, but there was an other error which was somehow fixed by adding the frames thing, but that was on an other enemy of which i copied the code to edit it. i can assure you that the error wasnt caused by the animationtype

User avatar
Sky
Posts: 1283
Joined: 08 Mar 2012, 04:35
Contact:

Post » 28 May 2015, 23:47

Put quotes around "turretgun", "turret", and "death". Basically, if it's not true, false, or a number, it needs quotes.
What did Turret ever do to you? All that guns and death and stuff - he was only trying to help

User avatar
Tecminer
Posts: 437
Joined: 11 Jan 2014, 20:44
Contact:

Post » 29 May 2015, 18:34

alright, thats one problem solved, but since i didnt want the turret to keep shooting at the player forever, i tried to use the transformtrigger "playernear", but nothing happens...

Code: Select all

{
	"quadcount": 1,

	"movement": "none",
	"stompable": false,
	"killsonbottom": false,
	"killsonsides": false,
	
	"animationtype": "frames",
	"animationstart": 1,
	"animationframes": 1,
	"animationspeed": 0.1,
	
	
	"nospritesets": true,
	
	"gravity": 0,
	
	"rotatetowardsplayer": false,
	
	"width": 1,
	"height": 1,
	
	"static": false,
	"active": true,
	
	"category": 4,
	
	"mask": [	true, 
				true, false, false, false, true,
				false, true, false, true, false,
				false, false, false, false, false,
				true, true, false, false, false,
				false, true, true, false, false,
				true, false, true, true, true],
					
	
	"emancipatecheck": true,
	"autodelete": true,
	
	"offsetX": 0,
	"offsetY": 0,
	"quadcenterX": 8,
	"quadcenterY": 8,

	"transforms": true,
	"transformsinto": "turretgunshooting",
	"transformtrigger": "playernear",
	"playerneardist": 5
	}
and yes, i DO have the newest enemy.lua

User avatar
TKG
Posts: 5
Joined: 22 Jul 2013, 02:23

Post » 30 Jun 2015, 04:05

Is there a way to make enemies transform after being hit by specific enemies (Like a custom explosion)?

Squidish
Posts: 678
Joined: 05 Apr 2014, 04:04

Post » 10 Jul 2015, 08:27

TKG wrote:Is there a way to make enemies transform after being hit by specific enemies (Like a custom explosion)?
Most likely by editing its mask

User avatar
Polybius
Posts: 307
Joined: 03 May 2012, 08:24

Post » 12 Jul 2015, 08:22

My attempt at a 16x16px diagonal Super Mario World 3 cannonball. I can't pin point the problem, Quadcount is 1, Nospritesets is true.

Image

Code: Select all

{
	"quadcount": 1,

	"movement": "none",
	
	"Nospritesets": true,
	"Animationtype": "none",
	
	"SpawnOffsetX": 0.1,
	"SpawnOffsetX": -0.1,
	"Width": 1,
	"Height": 1,
	"OffsetX": 0,
	"OffsetY": 0,

	"SpeedX": 1,
	"SpeedY": -1,
	"Gravity": 0,
	"Static": false,
	"Spawnsound": "bulletbull",
	"NotKilledFromBlocksBelow": true,
	"DontMirror": true,
	"doesntunrotate": true,
	"autodelete": true,
	

	"Active": true,
	"Category": 11,
	
	"mask": [	true, 
				true, false, true, true, true,
				true, true, true, true, true,
				true, true, true, true, true,
				true, true, true, true, true,
				true, true, true, true, true,
				true, true, true, true, true],
	
	"StompComboSuppressor": false,
	"Stompable": true,
	"StompAnimation": false,
	"KilledByBoxes": true,
	"ignorefaithplates": true
}		
	

EDIT:

fixed:

Code: Select all

{

	"movement": "none",
	
	"Nospritesets": true,
	"Animationtype": "none",
	"DontMirror": true,
	
	"SpawnOffsetX": 0.0,
	"SpawnOffsetY": -0.5,
	"Width": 1,
	"Height": 1,
	"OffsetX": 0,
	"OffsetY": 0,
	"QuadcenterX": 0,
	"QuadcenterY": 0,

	"SpeedX": -3,
	"SpeedY": -3,
	"Gravity": 0,
	"Static": false,
	"doesntunrotate": true,
	"autodelete": true,
	"ResistsFire": true,
	"ResistsSpikes": true,
	"NoCollideStops": true,
	"Killsonbottom": true,
	"KillsonSides": true,

	"Active": true,
	"Category": 11,
	
	"mask": [	true, 
				true, false, true, true, 

true,
				true, true, true, true, 

true,
				true, true, true, true, 

true,
				true, true, true, true, 

true,
				true, true, true, true, 

true,
				true, true, true, true, 

true],
	
	"StompComboSuppressor": true,
	"Stompable": true,
	"Spawnsound": "bulletbill",
	"StompAnimation": false,
	"KilledByBoxes": true,
	"ignorefaithplates": true
}		
	

User avatar
Polybius
Posts: 307
Joined: 03 May 2012, 08:24

Post » 14 Jul 2015, 22:36

how would i go about replicating these flame throwers from smb3?
Image

User avatar
Qwerbey
Posts: 1280
Joined: 05 Oct 2012, 07:58
Contact:

Post » 14 Jul 2015, 22:57

I'd recommend an enemy with the lifetime property that kills you and another enemy to periodically respawn it.

User avatar
Turtle95
Posts: 1246
Joined: 21 Mar 2012, 21:48
Contact:

Post » 14 Jul 2015, 23:10

QwertymanO07 wrote:I'd recommend an enemy with the lifetime property that kills you and another enemy to periodically respawn it.
Wouldn't he just need an Enemy Spawner and set that on a loop?

User avatar
Polybius
Posts: 307
Joined: 03 May 2012, 08:24

Post » 14 Jul 2015, 23:52

I tried to make it a plant, but thats not gonna work... the sprite sheet is too big for that, its 3 blocks tall. so yeah ill have to try the enemy spawner thing

User avatar
Qwerbey
Posts: 1280
Joined: 05 Oct 2012, 07:58
Contact:

Post » 15 Jul 2015, 00:26

Turtle95 wrote:Wouldn't he just need an Enemy Spawner and set that on a loop?
He could, but with the custom spawner method, he can just place the enemy and not have to change any settings or do any linking.

User avatar
Polybius
Posts: 307
Joined: 03 May 2012, 08:24

Post » 15 Jul 2015, 02:24

Could someone go about explaining so i can try to go about doing it? :P

heres my attempt at it. it's not working so far :P

Code: Select all

{
	"Quadcount": 5,
	"nospritesets": true,
	"movement": "none",

	"animationtype": "frames",
	"animationstart": 1,
	"animationframes": 5,
	"animationspeed": 0.3,
	
	"stompable": false,
	"kills": true,
	
	"width": 1,
	"height": 1,
	"static": true,
	"active": true,
	"category": 29,
	
	"mask": [true],
	
	"emancipatecheck": true,
	"notkilledfromblocksbelow": true,
	"jumpsfromblocksbelow": false,
	"autodelete": true,
	"portalable": false,
	"resistsstar": true,
	"resistsfire": true,
	"resistsspikes": true,
	
	"offsetx": 6,
	"offsety": 0,
	"quadcenterX": 8,
	"quadcenterY": 19,
	"ignorefaithplates": true
}

User avatar
Qwerbey
Posts: 1280
Joined: 05 Oct 2012, 07:58
Contact:

Post » 15 Jul 2015, 05:55

You need the property "lifetime": # somewhere in there or else it won't delete itself.

The spawner should be something like this:

Code: Select all

{
	"quadcount": 1,

	"movement": "none",
	
	"animationtype": "none",
	
	"spawnsenemy": "whatever you called it",
	"spawnenemydelays": [5],
	"spawnenemyspeedy": 0,
	"spawnenemyspeedx": 0,
	"spawnenemyoffsetx": -1,
	
	"width": 0.75,
	"height": 0.75,
	
	"static": true,
	"active": true,
	
	"category": 4,
	
	"mask": [	true, 
				false, false, false, false, true,
				false, true, false, true, false,
				false, false, false, false, false,
				true, true, false, false, false,
				false, true, true, false, false,
				true, false, true, true, true],
					
	
	"emancipatecheck": true,
	"autodelete": true,
	
	"offsetX": 6,
	"offsetY": 3,
	"quadcenterX": 8,
	"quadcenterY": 8
}

User avatar
Qwerbey
Posts: 1280
Joined: 05 Oct 2012, 07:58
Contact:

Post » 05 Aug 2015, 01:21

Sorry for the double post, but I just have a question: has anybody had the movement type "targety" work? I found it while looking through enemy.lua, and couldn't get it to work, though I only tried it once.

User avatar
Polybius
Posts: 307
Joined: 03 May 2012, 08:24

Post » 06 Aug 2015, 20:13

I believe its for the blooper movement type. I may be incorrect, but that is my best bet.

User avatar
Qwerbey
Posts: 1280
Joined: 05 Oct 2012, 07:58
Contact:

Post » 07 Aug 2015, 00:37

No, their movement is "squid".

Unrelatedly, is there any way to make an enemy spawn another enemy only once?

Murphmario
Posts: 60
Joined: 03 Feb 2014, 23:24

Post » 15 Aug 2015, 20:34

My enemy, Green Spikey, causes a crash:
Image

Here is the code:

Code: Select all

base=spikey

{
    "quadcount": 2,
	"NoSpriteSets": false,

    "movement": "follow",
	"DistanceTime": 0.1,
	"followspace":0.1,
	"killsontop": true,
	"killsonsides": true,
	
	"stompable": false,
}
And the sprite:
Image

There is also Green Spikey Lakito, but it's just a normal Lakitu that throws Green Spikeys. It even uses the same sprite!
Last edited by Murphmario on 15 Aug 2015, 21:04, edited 1 time in total.

User avatar
TurretBot
Posts: 4412
Joined: 15 Mar 2012, 23:18
Contact:

Post » 15 Aug 2015, 20:47

Why is there a ]?

Murphmario
Posts: 60
Joined: 03 Feb 2014, 23:24

Post » 15 Aug 2015, 21:05

TurretBot wrote:Why is there a ]?
Fixed. That wasn't part of the original code. I must have put it there when I was copypasting the code over to the forums.

Squidish
Posts: 678
Joined: 05 Apr 2014, 04:04

Post » 15 Aug 2015, 21:07

Murphmario wrote:Here is the code:

Code: Select all

base=spikey

{
    "quadcount": 2,
	"NoSpriteSets": false,

    "movement": "follow",
	"DistanceTime": 0.1,
	"followspace":0.1,
	"killsontop": true,
	"killsonsides": true,
	
	"stompable": false,
}
You're not supposed to have a comma on the last line.

Murphmario
Posts: 60
Joined: 03 Feb 2014, 23:24

Post » 15 Aug 2015, 21:10

Squidish wrote:
Murphmario wrote:Here is the code:

Code: Select all

base=spikey

{
    "quadcount": 2,
	"NoSpriteSets": false,

    "movement": "follow",
	"DistanceTime": 0.1,
	"followspace":0.1,
	"killsontop": true,
	"killsonsides": true,
	
	"stompable": false,
}
You're not supposed to have a comma on the last line.
Didn't fix anything. The game still crashes.

User avatar
TurretBot
Posts: 4412
Joined: 15 Mar 2012, 23:18
Contact:

Post » 15 Aug 2015, 21:14

Murphmario wrote:The game still crashes.
does it show the same message?

Murphmario
Posts: 60
Joined: 03 Feb 2014, 23:24

Post » 15 Aug 2015, 22:22

TurretBot wrote:
Murphmario wrote:The game still crashes.
does it show the same message?
For the most part, yes. But I edited the codes to remove the commas.

Squidish
Posts: 678
Joined: 05 Apr 2014, 04:04

Post » 15 Aug 2015, 22:38

Murphmario wrote:
TurretBot wrote:
Murphmario wrote:The game still crashes.
does it show the same message?
For the most part, yes. But I edited the codes to remove the commas.
You're not supposed to take out all the commas. just the one on the last line.

Murphmario
Posts: 60
Joined: 03 Feb 2014, 23:24

Post » 15 Aug 2015, 23:27

Squidish wrote: You're not supposed to take out all the commas. just the one on the last line.
Tried that too.

User avatar
Sky
Posts: 1283
Joined: 08 Mar 2012, 04:35
Contact:

Post » 16 Aug 2015, 18:33

Character #184 is at "killsonsides." So something there is throwing the error. Since you're using a spikey as a base, it already has that property, so you can remove it and "killsontop" and it will still function correctly, hopefully without error.

Just to be safe, make sure you have a comma on the end of every line except the last, and add a space between "followspace" and its value (I'm not sure if JSON parsing throws an error for this or not, but it's good to be consistent anyway).

Murphmario
Posts: 60
Joined: 03 Feb 2014, 23:24

Post » 16 Aug 2015, 22:12

WillWare wrote:Character #184 is at "killsonsides." So something there is throwing the error. Since you're using a spikey as a base, it already has that property, so you can remove it and "killsontop" and it will still function correctly, hopefully without error.

Just to be safe, make sure you have a comma on the end of every line except the last, and add a space between "followspace" and its value (I'm not sure if JSON parsing throws an error for this or not, but it's good to be consistent anyway).
It still crashes. Here is the new code:

Code: Select all

base=spikey

{
    "quadcount": 2,
	"NoSpriteSets": false,

    "movement": "follow",
	"DistanceTime": 0.1,
	"followspace": 0.1,

	"stompable": false
}

User avatar
Sky
Posts: 1283
Joined: 08 Mar 2012, 04:35
Contact:

Post » 16 Aug 2015, 23:38

Could you post the new crash as well? It helps a ton when debugging enemies.

User avatar
Skel3t
Posts: 47
Joined: 17 Nov 2017, 13:41

Post » 25 Nov 2017, 12:48

I don't know the problem...
https://imgur.com/a/q1Iy2

User avatar
Skel3t
Posts: 47
Joined: 17 Nov 2017, 13:41

Post » 25 Nov 2017, 13:08

{
"quadCount":4, "animationType": "frames", "animationSpeed": 1.25, "facesPlayer":true, "width": 64, "height": 72, "offsetX": 1,
"offsetY": 2, "spawnOffsetX": 1, "spawnOffsetY": 2, "quadcenterX": 8, "quadcenterY": 8,"spawnq":true,"nospritesets":true,"quadno":1}
???

User avatar
Technochips
Posts: 608
Joined: 12 Mar 2015, 16:05
Contact:

Post » 25 Nov 2017, 13:56

can you not double-post and put your code in a code tag
Skel3t wrote:

Code: Select all

{
"quadCount":4,
"animationType": "frames",
"animationSpeed": 1.25,
"facesPlayer":true,
"width": 64,
"height": 72,
"offsetX": 1,
"offsetY": 2,
"spawnOffsetX": 1,
"spawnOffsetY": 2,
"quadcenterX": 8,
"quadcenterY": 8,
"spawnq":true,
"nospritesets":true,
"quadno":1
}
Width and height might be too large, since it's supposed to be in blocks.
"spawnq" doesn't exists.

Also use this documentation page thing, it can help.

User avatar
Skel3t
Posts: 47
Joined: 17 Nov 2017, 13:41

Post » 26 Nov 2017, 09:26

Did it all,and
Uh well
Raining enemy is normal?
Like i added Needed things(good collision,gravity,active,no movement and e.t.)
Falls from the sky...

User avatar
Qwerbey
Posts: 1280
Joined: 05 Oct 2012, 07:58
Contact:

Post » 28 Nov 2017, 02:29

Probably your "spawnoffsety".

User avatar
Skel3t
Posts: 47
Joined: 17 Nov 2017, 13:41

Post » 01 Dec 2017, 15:16

QwertymanO07 wrote:Probably your "spawnoffsety".
I meant it doesn't collide with blocks.
The "Raining" problem is fixed.
Idk what is wrong.

User avatar
Sky
Posts: 1283
Joined: 08 Mar 2012, 04:35
Contact:

Post » 02 Dec 2017, 07:37

Your enemy needs a mask so it knows what to collide with. This one will probably do what you need it to:

Code: Select all

"mask": [true, 
false, false, false, false, true,
false, true, false, true, false,
false, false, false, false, false,
true, true, false, false, true,
false, true, true, false, false,
true, false, true, true, true],
The mask setup is complicated to explain in one post, but this will make it collide with Mario, the ground, and most other enemies.

User avatar
Skel3t
Posts: 47
Joined: 17 Nov 2017, 13:41

Post » 02 Dec 2017, 09:59

Still doesn't touch the ground.
I am making a mini bullet bill generator.How do i make a bill generator?

User avatar
Skel3t
Posts: 47
Joined: 17 Nov 2017, 13:41

Post » 05 Dec 2017, 17:04

WillWare wrote:Your enemy needs a mask so it knows what to collide with. This one will probably do what you need it to:

Code: Select all

"mask": [true, 
false, false, false, false, true,
false, true, false, true, false,
false, false, false, false, false,
true, true, false, false, true,
false, true, true, false, false,
true, false, true, true, true],
The mask setup is complicated to explain in one post, but this will make it collide with Mario, the ground, and most other enemies.
Sorry for double posting,but i think i got it.
The first one should be false,the second is true.

User avatar
frostplays
Posts: 26
Joined: 13 Mar 2018, 10:36
Contact:

Post » 17 Mar 2018, 06:05

How do you make an enemy not collide with grates?

User avatar
Villager103
Posts: 506
Joined: 31 Jan 2013, 14:50
Contact:

Post » 17 Mar 2018, 06:11

Grates don't actually have a mask, so no, you can't.

User avatar
Qwerbey
Posts: 1280
Joined: 05 Oct 2012, 07:58
Contact:

Post » 17 Mar 2018, 08:01

At least, not without also have them not collide with any other tile. The best solution is probably to just make a custom "grate" enemy and use that.

User avatar
Villager103
Posts: 506
Joined: 31 Jan 2013, 14:50
Contact:

Post » 17 Mar 2018, 11:31

That, and having grate enemies also opens up other opportunities like grates that are thin like light bridges, or half-block grates. Or even moving grates.

User avatar
frostplays
Posts: 26
Joined: 13 Mar 2018, 10:36
Contact:

Post » 20 Mar 2018, 09:38

That's a shame. Maybe next version of the bugfixes mod? Thanks for the suggestion. Also, how do I make an enemy die when it hits a block, but not without breaking the block first? The code I've got for it right now is (it's currently based off the vvvvvv enemy on the wiki, and with all code that i tried to kill it with removed)

Code: Select all

{
	"quadcount": 4,

	"movement": "none",
	"gravity": 0,
	"reflects": true,
	"emancipatecheck": true,
	"resistsfire": true,
	"resistsstar": true,
	"resistsspikes": true,
	"laserresistant": true,
	"breaksblocks": true,
	"breakblockside": "global",	

	"animationtype": "frames",
	"animationframes": 4,
	"animationstart": 1,
	"animationspeed": 0.2,
	"nospritesets": true,
	"DontMirror": true,

	"kills": true,
	
	"width": 0.75,
	"height": 0.75,
	
	"static": false,
	"active": true,
	
	"category": 17,
	
	"mask": [	true, 
				false, false, true, true, true,
				false, true, true, true, true,
				false, true, true, true, true,
				true, true, true, true, true,
				true, true, true, false, true,
				true, false, true, true, true],
					
	"autodelete": false,
	"ignorefaithplates": true,
	
	"offsetX": 6,
	"offsetY": 3,
	"quadcenterX": 4,
	"quadcenterY": 4
}

User avatar
Qwerbey
Posts: 1280
Joined: 05 Oct 2012, 07:58
Contact:

Post » 20 Mar 2018, 13:36

Have it transform into a dummy enemy that immediately deletes itself.

User avatar
frostplays
Posts: 26
Joined: 13 Mar 2018, 10:36
Contact:

Post » 21 Mar 2018, 09:01

Tried that. It doesn't break the block. Is there any way I can transform it the frame AFTER collision?
(Oh, and I tried giving the transformed enemy a non-zero lifetime. It also doesn't break it. I'm sure there's a workaround.)

User avatar
Qwerbey
Posts: 1280
Joined: 05 Oct 2012, 07:58
Contact:

Post » 21 Mar 2018, 21:14

My best guess was that the dummy enemy wasn't actually touching the tile. Try adding "transformPassedParameters": ["speedx","speedy"] (I don't know if it'll work but try it anyway)

User avatar
Mari0_Player
Posts: 224
Joined: 23 Sep 2013, 00:48

Post » 19 Jul 2018, 22:01

Any way to make an enemy stompable by boxes but not by Mario, aside from "killsontop" or other radical design changes? "stompable": false, "killedbyboxes": true just means that boxes bounce on the enemy without actually killing it.

User avatar
Qwerbey
Posts: 1280
Joined: 05 Oct 2012, 07:58
Contact:

Post » 20 Jul 2018, 06:48

Try having it transform into an intermediary stage that kills on all sides and is taller than the enemy itself. That way, if the player steps on it, they get killed by the new enemy, but boxes are immune. I tried using this once to recreate 1.6 spikies, but that was before I knew much about enemies.

Post Reply