Modding Help Animated Fist Weapons?

Discussion in 'Starbound Modding' started by SpazDiesFirst360.0, Oct 20, 2018.

  1. SpazDiesFirst360.0

    SpazDiesFirst360.0 Phantasmal Quasar

    I was thinking of fist weapons animated like the violium swords. Is it possible to pull this off?
     
  2. The Avelon

    The Avelon Phantasmal Quasar

    So it just looks like your normal hands until you attack, and a particle effect forms a glove around your hand like the violium blade?

    Should be possible; you just need to have your weapon file's animator set up to accept the parameter "blade" like the violium broadsword's is, with the corresponding art files showing your animation. Attach the energymeleeweapon.lua to your new weapon the same way it is attached to the violium broadsword.

    So you just need the .activeitem, .png, .frames, and .animation and you should be able to just copy the frames and animation files from the VB and rename them to whatever name you give your weapon. Just be sure that your art file is the same size with the same number of frames or be aware that if you change them, your frames and animation files will need to be changed as well.
     
  3. SpazDiesFirst360.0

    SpazDiesFirst360.0 Phantasmal Quasar

    Sorry for waiting so long.

    I attempted two methods, as described below:

    I first attempted to add the "blade" parameter to the fist weapon, only for SB to nuke itself. However, the error message was seemingly unrelated to the weapon, as it spewed out;
    Code:
    [14:26:36.976] [Error] Exception caught in client main-loop
    (MapException) Key 'glow' not found in OrderedMap::get()
    [0] b0a99a Star::captureStack
    [1] b098b8 Star::StarException::StarException
    [2] cf71bb Star::OrderedMapWrapper<Star::FlatHashMap,Star::String,Star::NetworkedAnimator::Light,std::allocator<std::pair<Star::String const ,Star::NetworkedAnimator::Light> >,Star::hash<Star::String,void>,std::equal_to<Star::String> >::get
    [3] cf3096 <lambda_db79c15e46e9b0e1eec7e17891596b39>::operator()
    [4] b11620 Star::AnimatedPartSet::forEachActiveState
    [5] cfee14 Star::NetworkedAnimator::update
    [6] 100ce69 Star::ActiveItem::update
    [7] edc5db Star::ToolUser::tick
    [8] d8e2f9 Star::Player::update
    [9] f5415e <lambda_43cd99ed4848a23793d927f33301b453>::operator()
    [10] c1d674 Star::EntityMap::updateAllEntities
    [11] f67bd0 Star::WorldClient::update
    [12] ee9a79 Star::UniverseClient::update
    [13] a72dfb Star::ClientApplication::updateRunning
    [14] a71912 Star::ClientApplication::update
    [15] 110d246 Star::SdlPlatform::run
    [16] 110d486 Star::runMainApplication
    [17] a74a1f WinMain
    [18] 1240209 __scrt_common_main_seh
    [19] 750f8484 BaseThreadInitThunk
    [20] 772a305a RtlValidSecurityDescriptor
    [21] 772a302a RtlValidSecurityDescriptor
    It was made worse by the fact that it applied to everything.

    The second method I tried, and have had the most success with so far, is modifying fistweapon.lua to draw the extended image when the player punches, then draw a sequence of images to make it look like it's retracting. The problem I have with this is that the other hand will not extend unless you click the respective mouse button. However, I think this can be solved by finding a way to "bridge" the two fists by detecting if the other hand has the same weapon, then updating the image that way. This seems very hard, though, as how am I supposed to call a function from a script for a weapon that is in the other hand?

    I also feel iffy on method two because I have no idea if it is copyright infringement (as I am no expert when it comes to this, but I do believe that it may be fair use). If this is infringement, I will stop pursuing this route.

    I have attached two .zips, each containing one of the two methods I used.
     

    Attached Files:

Share This Page