Modding Help Projectile Mirroring on Spells?

Discussion in 'Starbound Modding' started by SophieKitty, Nov 18, 2019.

  1. SophieKitty

    SophieKitty Void-Bound Voyager

    So I made a few spells which work pretty well so far, but:
    Unlike other projectiles, Spell projectiles don't seem to be turning themselves around when being cast to the other side of the character.

    Any way to change this?

    20191118223143_1.jpg 20191118223139_1.jpg

    This is quite important for some spells like fire-breathing type things.
    Hope someone can help.

    No, set "Flippable: True" doesn't seem to work, neither on the spells .weaponability nor the .projectile file.
    Last edited: Nov 18, 2019
  2. lerdarim

    lerdarim Void-Bound Voyager

    I had somewhat similiar issue recently and today accidentally solved it. Maybe my experience might help.

    My ability was spawning a projectile through world.spawnProjectile command, which has the direction vector, by default it was {0, 0}
    world.spawnProjectile(self.projectileType, vec2.add(position, self.projectileOffset), activeItem.ownerEntityId(), {0, 0}, false, params)
    I've spent quite an hour trying to make it rotate, using something like "{math.cos(self.weapon.aimAngle), math.sin(self.weapon.aimAngle)}". It was rotating, but didn't flip, just like yours. So after a dozen of different methods this worked like a charm
     {mcontroller.facingDirection(), math.sin(self.weapon.aimAngle)} 
    If you do not need rotation, then i guess {mcontroller.facingDirection(), 0} would do.

Share This Page