How do I use irregular tiles like explosions and broken pearls in the editor?

Stuck at a level? Need help with R'n'D or anything R'n'D related? Post here!

Moderators: Flumminator, Zomis

Post Reply
ncrecc
Posts: 154
Joined: Thu Jul 12, 2018 12:59 am

How do I use irregular tiles like explosions and broken pearls in the editor?

Post by ncrecc »

In this particular case, I'm looking for how to use the animated "pearl breaking" tile as a user-defined element (since I want to detect when a pearl breaks on something). I know that it counts as an element, because it's regarded as an element by the "this element matches any element" reference element:
Image
I looked through game.c to find this element's name, and there it was: el_pearl_breaking. I figured I could just add it to my levelset's editorsetup.conf after lopping off the el_ at the beginning (el_pearl is not valid for editorsetup.conf but pearl is, el_sp_disk_yellow isn't valid but sp_disk_yellow is), but it refused to show up in the editor after adding it. I tested around a bit: the regular elements like nut, pearl, sign_sperms, etc. all showed up, but the "technical" ones such as explosion, nut_breaking, and pearl_breaking did not.
Are those technical elements off-limits for level creators entirely? I'd imagined that the more tame elements like explosion and the breaking animations would be allowed even if the obviously glitchy elements like flames and magic_wall_emptying remain unselectable.
(And yes, I made sure that the entries in editorsetup.conf were in lowercase)
User avatar
Eizzoux
Posts: 567
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Re: How do I use irregular tiles like explosions and broken pearls in the editor?

Post by Eizzoux »

First, it should be "pearl.breaking", not "pearl_breaking" since "breaking" is action for element and "pearl" is element that action is scripted for, and when you find action for element, you separate them by "." (nut.breaking, pacman.turning_from_left, mm_amoeba_wall.growing, yamyam.moving, sp_buggy_base.activating, etc.)
Second, this is pretty much intended, since it wouldn't really make sence of adding to editorsetup these specific animations of elements. Holger only made original elements, "active" states of few of them and different directions acceptable for editor palette (yamyam.left/right/up/down, mm_lightbulb.active, lightswitch.active).
𒈟
ncrecc
Posts: 154
Joined: Thu Jul 12, 2018 12:59 am

Re: How do I use irregular tiles like explosions and broken pearls in the editor?

Post by ncrecc »

Eizzoux wrote: Sat Feb 09, 2019 5:45 am Second, this is pretty much intended, since it wouldn't really make sence of adding to editorsetup these specific animations of elements. Holger only made original elements, "active" states of few of them and different directions acceptable for editor palette (yamyam.left/right/up/down, mm_lightbulb.active, lightswitch.active).
But in the case of pearl and pearl.breaking (at least), the sub-animation is considered to be an entirely different element than its base element. So setting up a CE to detect any pearl will not allow it to detect pearls that are currently undergoing the "breaking" animation, which I think is an important distinction. Just like how CEs can not detect most enemies unless it is specifically asked to check for their "random start direction" variations.
Post Reply