Greetings fellow slime,
In order to create a more animate world I decided to make some butterfly NPCs that wander around the map.
The Player shouldn't interact with the butterflies at all but unfortunately I'm unable to just walk through them.
Is there a way to make them non collidable?
Thanks in advance.
EDIT:
I figured it out.
In "Edit NPCs..." set:
Activation: Step On
Create noncollidable "Ghost" NPCs
Moderators: marionline, SDHawk
Create noncollidable "Ghost" NPCs
Last edited by Wendigo on Wed Mar 01, 2017 2:36 pm, edited 2 times in total.
On-Step activated NPCs still obstruct other NPCs. If you want to avoid that you need to use scripting to set the NPCs as non-obstructing (I know, it's crazy that there's no setting in the editor for it) using the "set npc obstructs" command. That works on a single NPC instance rather than an NPC definition, so you would need to use a loop. You can use a map autorun script like:
Code: Select all
plotscript, butterflies map script, begin
variable(index)
for (index, 0, npc copy copy(10) -- 1) do ( # Change 10 to npc ID
set npc obstructs(npc reference(10, index), false) # Change 10
)
end
Last edited by TMC on Wed Mar 01, 2017 3:16 pm, edited 1 time in total.
- BMR
- Metal King Slime
- Posts: 3310
- Joined: Mon Feb 27, 2012 2:46 pm
- Location: The Philippines
- Contact:
Strangely enough, I was working on this exact thing a few weeks ago. My solution though was to use slices, as you'll be able to get more variety and better random movement that way. Also somewhat easier to animate. The way I went about it (I think, it's been a while) was to have a set of npcs on the map. Then, a script runs through all the npcs, and upon finding those of a specific number, deletes those npcs and replaces them with butterfly slices. Each slice has extra data attached to it, "life", "target x", and "target y". Each tick, life decreases by one, and upon hitting 0, a new random x and y target are generated within a specific range from the current position. A new random life is also created. For the next few ticks, until life hits 0 again, the butterfly will animate and move towards the random target. Repeats until the player leaves the map. Kinda a vague description, I know, but I'm sick right now so I reserve the right to be incoherent =p
Last edited by BMR on Wed Mar 01, 2017 4:06 pm, edited 1 time in total.
Being from the third world, I reserve the right to speak in the third person.
Using Editor version wip 20170527 gfx_sdl+fb music_sdl
Using Editor version wip 20170527 gfx_sdl+fb music_sdl