Page 5 of 6

Re: SE Custom Enemies Help Thread

Posted: 28 May 2015, 18:11
by Tecminer
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

Re: SE Custom Enemies Help Thread

Posted: 28 May 2015, 20:37
by Squidish
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

Re: SE Custom Enemies Help Thread

Posted: 28 May 2015, 21:11
by TurretBot
Squidish wrote:i don't think you need an animation if there's only one frame
use "none"

Re: SE Custom Enemies Help Thread

Posted: 28 May 2015, 21:29
by Tecminer
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

Re: SE Custom Enemies Help Thread

Posted: 28 May 2015, 23:47
by Sky
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

Re: SE Custom Enemies Help Thread

Posted: 29 May 2015, 18:34
by Tecminer
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

Re: SE Custom Enemies Help Thread

Posted: 30 Jun 2015, 04:05
by TKG
Is there a way to make enemies transform after being hit by specific enemies (Like a custom explosion)?

Re: SE Custom Enemies Help Thread

Posted: 10 Jul 2015, 08:27
by Squidish
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

Re: SE Custom Enemies Help Thread

Posted: 12 Jul 2015, 08:22
by Polybius
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
}		
	

Re: SE Custom Enemies Help Thread

Posted: 14 Jul 2015, 22:36
by Polybius
how would i go about replicating these flame throwers from smb3?
Image

Re: SE Custom Enemies Help Thread

Posted: 14 Jul 2015, 22:57
by Qwerbey
I'd recommend an enemy with the lifetime property that kills you and another enemy to periodically respawn it.

Re: SE Custom Enemies Help Thread

Posted: 14 Jul 2015, 23:10
by Turtle95
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?

Re: SE Custom Enemies Help Thread

Posted: 14 Jul 2015, 23:52
by Polybius
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

Re: SE Custom Enemies Help Thread

Posted: 15 Jul 2015, 00:26
by Qwerbey
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.

Re: SE Custom Enemies Help Thread

Posted: 15 Jul 2015, 02:24
by Polybius
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
}

Re: SE Custom Enemies Help Thread

Posted: 15 Jul 2015, 05:55
by Qwerbey
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
}

Re: SE Custom Enemies Help Thread

Posted: 05 Aug 2015, 01:21
by Qwerbey
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.

Re: SE Custom Enemies Help Thread

Posted: 06 Aug 2015, 20:13
by Polybius
I believe its for the blooper movement type. I may be incorrect, but that is my best bet.

Re: SE Custom Enemies Help Thread

Posted: 07 Aug 2015, 00:37
by Qwerbey
No, their movement is "squid".

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

Re: SE Custom Enemies Help Thread

Posted: 15 Aug 2015, 20:34
by Murphmario
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!

Re: SE Custom Enemies Help Thread

Posted: 15 Aug 2015, 20:47
by TurretBot
Why is there a ]?

Re: SE Custom Enemies Help Thread

Posted: 15 Aug 2015, 21:05
by Murphmario
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.

Re: SE Custom Enemies Help Thread

Posted: 15 Aug 2015, 21:07
by Squidish
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.

Re: SE Custom Enemies Help Thread

Posted: 15 Aug 2015, 21:10
by Murphmario
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.

Re: SE Custom Enemies Help Thread

Posted: 15 Aug 2015, 21:14
by TurretBot
Murphmario wrote:The game still crashes.
does it show the same message?

Re: SE Custom Enemies Help Thread

Posted: 15 Aug 2015, 22:22
by Murphmario
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.

Re: SE Custom Enemies Help Thread

Posted: 15 Aug 2015, 22:38
by Squidish
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.

Re: SE Custom Enemies Help Thread

Posted: 15 Aug 2015, 23:27
by Murphmario
Squidish wrote: You're not supposed to take out all the commas. just the one on the last line.
Tried that too.

Re: SE Custom Enemies Help Thread

Posted: 16 Aug 2015, 18:33
by Sky
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).

Re: SE Custom Enemies Help Thread

Posted: 16 Aug 2015, 22:12
by Murphmario
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
}

Re: SE Custom Enemies Help Thread

Posted: 16 Aug 2015, 23:38
by Sky
Could you post the new crash as well? It helps a ton when debugging enemies.

Re: SE Custom Enemies Help Thread

Posted: 25 Nov 2017, 12:48
by Skel3t
I don't know the problem...
https://imgur.com/a/q1Iy2

Re: SE Custom Enemies Help Thread

Posted: 25 Nov 2017, 13:08
by Skel3t
{
"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}
???

Re: SE Custom Enemies Help Thread

Posted: 25 Nov 2017, 13:56
by Technochips
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.

Re: SE Custom Enemies Help Thread

Posted: 26 Nov 2017, 09:26
by Skel3t
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...

Re: SE Custom Enemies Help Thread

Posted: 28 Nov 2017, 02:29
by Qwerbey
Probably your "spawnoffsety".

Re: SE Custom Enemies Help Thread

Posted: 01 Dec 2017, 15:16
by Skel3t
QwertymanO07 wrote:Probably your "spawnoffsety".
I meant it doesn't collide with blocks.
The "Raining" problem is fixed.
Idk what is wrong.

Re: SE Custom Enemies Help Thread

Posted: 02 Dec 2017, 07:37
by Sky
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.

Re: SE Custom Enemies Help Thread

Posted: 02 Dec 2017, 09:59
by Skel3t
Still doesn't touch the ground.
I am making a mini bullet bill generator.How do i make a bill generator?

Re: SE Custom Enemies Help Thread

Posted: 05 Dec 2017, 17:04
by Skel3t
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.

Re: SE Custom Enemies Help Thread

Posted: 17 Mar 2018, 06:05
by frostplays
How do you make an enemy not collide with grates?

Re: SE Custom Enemies Help Thread

Posted: 17 Mar 2018, 06:11
by Villager103
Grates don't actually have a mask, so no, you can't.

Re: SE Custom Enemies Help Thread

Posted: 17 Mar 2018, 08:01
by Qwerbey
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.

Re: SE Custom Enemies Help Thread

Posted: 17 Mar 2018, 11:31
by Villager103
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.

Re: SE Custom Enemies Help Thread

Posted: 20 Mar 2018, 09:38
by frostplays
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
}

Re: SE Custom Enemies Help Thread

Posted: 20 Mar 2018, 13:36
by Qwerbey
Have it transform into a dummy enemy that immediately deletes itself.

Re: SE Custom Enemies Help Thread

Posted: 21 Mar 2018, 09:01
by frostplays
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.)

Re: SE Custom Enemies Help Thread

Posted: 21 Mar 2018, 21:14
by Qwerbey
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)

Re: SE Custom Enemies Help Thread

Posted: 19 Jul 2018, 22:01
by Mari0_Player
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.

Re: SE Custom Enemies Help Thread

Posted: 20 Jul 2018, 06:48
by Qwerbey
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.