MagicPlugin icon indicating copy to clipboard operation
MagicPlugin copied to clipboard

Disguise as Source or Target in Disguise Action

Open NightScythe1 opened this issue 3 years ago • 10 comments

Looking to make a spell that will disguise a player/caster as their target. Currently this is possible using the Command action and typing:

          - class: Command
          command: disguiseplayer @p @t
          console: true

however, this means normal magic parameters such as Undo cannot apply to it, and players may get stuck in disguise if the spell cancels. It also means it cannot be used on players as you'd need a different command-

          - class: Command
          command: disguiseplayer @p player @t
          console: true

So i wanted to ask if a little integration fix with Libsdisguises was possible, to allow 'target' as an option for the 'type:' in the Magic 'Disguise' action. Thanks for reading!

NightScythe1 avatar Jul 10 '22 14:07 NightScythe1

Try disguise_target: target - I think that should do what you want, though I don't have a working example of it.

NathanWolf avatar Jul 12 '22 19:07 NathanWolf

ah awesome, thanks! i'll give it a test as soon as i'm home

NightScythe1 avatar Jul 12 '22 22:07 NightScythe1

doesn't seem to be working unfortunately- My spell is set to use a selector to find the target & then changecontext to disguise the caster. I may have formatted it wrong? here's the spell- (it currently allows you to select a target, and then messages the caster 'TEST', but does not disguise them)

disguise_self:
    name: Disguise Self
    actions:
      cast:
      - class: EntitySelect
        actions:
          - class: ChangeContext
            target_self: true
            actions:
              - class: Message
                message: TEST
              - class: Disguise
                disguise_target: target
    parameters:
        disguise_target: target
        range: 48
        target_type: LivingEntity
        target: other

NightScythe1 avatar Jul 14 '22 23:07 NightScythe1

Hm- I'm guessing it's because of the ChangeContext, disguise_target: target is going to want to disguise it as itself ...

Try swap_source_and_target: true instead of target_self: true, then in Disguise try disguise_target: self

.. but now that I'm looking at it, Disguise action doesn't even support disguise_target, that appears to only be for ModifyEntity and SpawnEntity. Arg. I can see if I can add support for that to Disguise, I'll leave this open as a TODO.

NathanWolf avatar Jul 15 '22 13:07 NathanWolf

It also appears that disguise_target is actually very limited, and only works to set the disguise to a player skip.

Is that good enough for what you're trying to do?

NathanWolf avatar Jul 15 '22 13:07 NathanWolf

Ah alright, thanks! As for the second question i'm not sure what you mean sorry haha, the spell i'm making is designed to select a nearby entity, mob, or player, and then disguises the caster as them using the disguise action if that makes sense? for example they cast it, select 'NightScythe1' if that player is nearby, and are disguised as that player, or they can select 'Cow' from the selector, and they become a Cow.

NightScythe1 avatar Jul 15 '22 16:07 NightScythe1

Well currently the "disguise_target" feature only works on players, so it's made to copy a player's skin. I did update it to work with the Disguise action, but I think I need to do so more work to make it work with mobs as well.

NathanWolf avatar Jul 15 '22 16:07 NathanWolf

Ahh okay, well working for players is pretty good to start with, thanks! does it work under the Disguise action or another liek ModifyEntity?

NightScythe1 avatar Jul 15 '22 18:07 NightScythe1

It should now work consistently in all 3 actions (SpawnEntity, ModifyEntity and Disguise)

I'm going to leave this ticket open to remind me to make it work with mobs as well.

NathanWolf avatar Jul 23 '22 18:07 NathanWolf

Ah that's great, thank you!!

NightScythe1 avatar Jul 25 '22 19:07 NightScythe1