Modding Help Is there a way for projectiles to shake the screen?

Discussion in 'Starbound Modding' started by xaliber, Jan 27, 2017.

  1. xaliber

    xaliber Scruffy Nerf-Herder

    I've been trying to figure out how to shake the screen with a projectile - been trying to made some kind of earth shattering weapon. I've taken a peek at some weapons and projectiles but it seems there haven't been something like that in vanilla.

    Is there a way to make projectiles shake the screen when it hits something?
     
  2. lazarus78

    lazarus78 The Waste of Time

    That would be interesting...

    There is a way, of sorts, though I don't know if it can be applied to weapons. The cinematic have the ability to basically wiggle the "camera" around as seen in the game's intro sequence.
     
  3. bk3k

    bk3k Oxygen Tank

    I really don't think there is anything capable of doing this. You could shake/rotate/etc the player, but I know of nothing to shake the screen itself within the LUA functions provided.

    ...unless I'm missing something.
     
  4. Monijir

    Monijir Scruffy Nerf-Herder

    Have you checked out the ability on the eye sword?
     
  5. xaliber

    xaliber Scruffy Nerf-Herder

    Hmm... tried checking out the intro sequence, not yet able to replicate it for weapons though.

    @Monijir: hmm, which Eye Sword? This one? http://starbounder.org/Eye_Sword Do you happen to know the item ID? As I can't find the ID with the Heroku app and got Oculus Reaver instead...

    EDIT: Wait a minute... I think you meant that Oculus Reaver sword right? The sword's special ability is to move the screen. I'll check that.
     
    Last edited: Feb 4, 2017
  6. Cyel

    Cyel Scruffy Nerf-Herder

    The Eye Sword's Lua uses activeItem.setCameraFocusEntity onto the scouteye projectile, so you could maybe create quickly a few projectiles (eg. invisibleprojectile) around the player with a short timeToLive, no velocity / gravity, focus the camera onto these and get a screen shaking effect this way

    Edit: I looked at the cinematic thingy in /cinematics/intro/introstage.cinematic, the "rumble" seen in the intro is "simply" the camera panning a few pixels at given times (every ~0.02 seconds). It's in an array and I guess there's no way to use exactly this, but maybe you could, when firing, trigger a short cinematic onto the current screen with similar camera commands. Though, I don't know if you can trigger a cinematic via a projectile, nor if you can make a cinematic not take away players' controls.

    (Also, the Eye Sword's relevant .lua script is in /items/active/weapon/melee/abilities/generic/scouteye.lua)

    Edit: the only way to play a cinematic is via player.playCinematic(), and the player table is only available "in a few contexts on the client such as scripted interface panes, quests, and player companions", so rip that I guess
     
    Last edited: Feb 7, 2017
    Monijir likes this.
  7. bk3k

    bk3k Oxygen Tank

    Sounds like I was wrong as there is a way.
     

Share This Page