Page 1 of 1

How do you put enemies in Clear Pipes?

Posted: Fri Nov 05, 2021 10:11 am
by Rendangbike
How do you put enemies in Clear Pipes like in SM3DW?

Re: How do you put enemies in Clear Pipes?

Posted: Fri Nov 05, 2021 11:04 am
by Enjl
You can't natively place them in such a way that they spawn in them.
I have however written some code for my MAGLX3 level which lets you do that.
https://drive.google.com/file/d/1FQLmUH ... sp=sharing

MAKING ENEMY TYPES ABLE TO ENTER CLEAR PIPES
In the file luna.lua, near the top, are some lines that are as follows:
local clearpipe = require("blocks/ai/clearpipe")
clearpipe.registerNPC(285)
clearpipe.registerNPC(207)

These allow NPCs of the given ID to enter clear pipes. In the code linked, the require was slightly outdated, but the lines I pasted above should work for spinies and sparkies respectively.

PLACING ENEMIES IN CLEAR PIPES
The level folder also contains a set of files pertaining to npc-751 (a custom range npc). This is an npc that I've made to spawn an NPC in a clear pipe. The code needs a single adjustment in line 5: Changing "blocks/clearpipe" to "blocks/ai/clearpipe".
Then, in the editor, you can place the npc-751 npc and change the container npc to the NPC you want spawned in the clear pipe.

This particular NPC generates an NPC of the type whenever the timer passes a certain value, and probably also needs pnpc removed, but it should work in the broad strokes.