Magic

Magic

190k Downloads

Disguise as Source or Target in Disguise Action

NightScythe1 opened this issue ยท 10 comments

commented

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!

commented

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

commented

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

commented

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

commented

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?

commented

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.

commented

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.

commented

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.

commented

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

commented

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.

commented

Ah that's great, thank you!!