Modding Help Spawned Projectiles don't move? [Staff] {SOLVED}

Discussion in 'Starbound Modding' started by ImHereForTheMods, Feb 28, 2017.

  1. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    So, I'm having a problem with my staves... Mostly the problem that, for some reason, they don't behave like they should.

    Exhibit A :
    http://imgur.com/ZvwQT97
    [​IMG]

    I don't know why, but when using the apex staff, the projectile bullets, and rockets shot from the drone do not move, at all.
    I have tried referencing a couple of other weapons, but that doesn't seem to have helped.

    As far as the flor an flower staff, the green arrow-y bits, are supposed to fly off in random directions, but instead, fall to the ground.

    Does anyone know how to fix this?

    Thanks in advance.
     
    Last edited: Feb 28, 2017
  2. MetaFace

    MetaFace Guest

    *clears throat* May I have the error log plz?
     
    ImHereForTheMods likes this.
  3. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Sure, here y'are.
    Code:
    [10:50:12.653] [Info] Root: Reloading from disk
    [10:50:13.052] [Info] Root: Scanning for asset sources in directory '..\assets\'
    [10:50:13.052] [Info] Chat: Client Star::Root reloaded
    [10:50:13.052] [Warn] Root: Unrecognized file in asset directory 'ModPackHelper.log', skipping
    [10:50:13.054] [Info] Root: Loaded Configuration in 0.00212375 seconds
    [10:50:13.422] [Info] Root: Scanning for asset sources in directory '..\mods\'
    [10:50:13.634] [Warn] Root: Unrecognized file in asset directory 'RacialWeaponMegamod_1.0.zip', skipping
    [10:50:13.720] [Warn] Root: Unrecognized file in asset directory 'WaveDiver Luthier.modpak', skipping
    [10:50:13.726] [Warn] Root: Unrecognized file in asset directory 'mods_go_here', skipping
    [10:50:13.727] [Warn] Root: Unrecognized file in asset directory 'racialmegamod_0.60_beta.zip', skipping
    [10:50:13.727] [Warn] Root: Unrecognized file in asset directory 'racialmegamod_0.70_beta.zip', skipping
    [10:50:13.727] [Warn] Root: Unrecognized file in asset directory 'racialmegamod_0.80_beta.zip', skipping
    [10:50:13.728] [Info] Root: Detected asset source named 'base' at '..\assets\packed.pak'
    [10:50:13.728] [Info] Root: Detected unnamed asset source at '..\mods\noItemDrop'
    [10:50:13.728] [Info] Root: Detected asset source named 'ATM' at '..\mods\ATM.pak'
    [10:50:13.728] [Info] Root: Detected asset source named 'Augment Extractor' at '..\mods\AugmentExtractor.pak'
    [10:50:13.728] [Info] Root: Detected asset source named 'EnhancedSprinkler' at '..\mods\CeilingSprinkler.pak'
    [10:50:13.728] [Info] Root: Detected asset source named 'Combinable Augments' at '..\mods\Combinable Augments V1.3'
    [10:50:13.728] [Info] Root: Detected unnamed asset source at '..\mods\CrazyWeirdandRandomInstruments'
    [10:50:13.728] [Info] Root: Detected asset source named 'Earth's Finest - Crew Improvements' at '..\mods\Crew_Plus'
    [10:50:13.728] [Info] Root: Detected asset source named 'FrackinUniverse' at '..\mods\FrackinUniverse.pak'
    [10:50:13.728] [Info] Root: Detected asset source named 'eppfix' at '..\mods\EPPFix'
    [10:50:13.728] [Info] Root: Detected asset source named 'ExtraZoomLevels' at '..\mods\ExtraZoomLevels.pak'
    [10:50:13.728] [Info] Root: Detected asset source named 'FrackinMusic' at '..\mods\FrackinMusic-master'
    [10:50:13.728] [Info] Root: Detected asset source named 'WD Luthier + Realkeys' at '..\mods\Luthier.pak'
    [10:50:13.728] [Info] Root: Detected asset source named 'Mighty Music Instruments!' at '..\mods\Mighty Music Instruments.pak'
    [10:50:13.728] [Info] Root: Detected unnamed asset source at '..\mods\New Kitchen Cabinet'
    [10:50:13.728] [Info] Root: Detected asset source named 'NG' at '..\mods\NostalgicGreeneryVanilla.pak'
    [10:50:13.728] [Info] Root: Detected asset source named 'Racial Megamod' at '..\mods\RacialWeaponMegamod_1.1'
    [10:50:13.728] [Info] Root: Detected unnamed asset source at '..\mods\recreationalvehicle1'
    [10:50:13.728] [Info] Root: Detected asset source named 'RandomMics' at '..\mods\RandomMics.pak'
    [10:50:13.728] [Info] Root: Detected unnamed asset source at '..\mods\RealBirds'
    [10:50:13.728] [Info] Root: Detected asset source named 'Rexmeck CSGO Weapons' at '..\mods\Rexmeck CSGO.pak'
    [10:50:13.728] [Info] Root: Detected unnamed asset source at '..\mods\Roblox Death Instrument'
    [10:50:13.728] [Info] Root: Detected asset source named 'SaplingMaker' at '..\mods\SaplingMaker_v3.0.pak'
    [10:50:13.728] [Info] Root: Detected unnamed asset source at '..\mods\Starbound MoreAvianBeaks'
    [10:50:13.728] [Info] Root: Detected unnamed asset source at '..\mods\Synthesizers'
    [10:50:13.729] [Info] Root: Detected asset source named 'UT-47 Kodiak Shuttle' at '..\mods\UT-47'
    [10:50:13.729] [Info] Root: Detected asset source named 'Weapon Reassembler' at '..\mods\Weapon_Reassembler.pak'
    [10:50:13.729] [Info] Root: Detected asset source named 'Avian Augment' at '..\mods\avianaugmentpack_tiered'
    [10:50:13.729] [Info] Root: Detected asset source named 'environmentSafety' at '..\mods\environmentSafety.pak'
    [10:50:13.729] [Info] Root: Detected asset source named 'Extended Songbook' at '..\mods\extended_songbook_2-2.pak'
    [10:50:13.729] [Info] Root: Detected unnamed asset source at '..\mods\florantails'
    [10:50:13.729] [Info] Root: Detected asset source named 'Healthy Capture Fixed' at '..\mods\healthycapturefixed.pak'
    [10:50:13.729] [Info] Root: Detected asset source named 'hoardersinventory' at '..\mods\hoardersinventory'
    [10:50:13.729] [Info] Root: Detected asset source named 'immortalcritters' at '..\mods\immortal_critters_v.1.0.pak'
    [10:50:13.729] [Info] Root: Detected asset source named 'joboffers' at '..\mods\jobffers.pak'
    [10:50:13.729] [Info] Root: Detected asset source named 'RanAuto' at '..\mods\RanAuto'
    [10:50:13.729] [Info] Root: Detected unnamed asset source at '..\assets\user'
    [10:50:13.729] [Info] Loading assets from: '..\assets\packed.pak'
    [10:50:14.199] [Info] Loading assets from: '..\mods\noItemDrop'
    [10:50:14.199] [Info] Loading assets from: '..\mods\ATM.pak'
    [10:50:14.200] [Info] Loading assets from: '..\mods\AugmentExtractor.pak'
    [10:50:14.201] [Info] Loading assets from: '..\mods\CeilingSprinkler.pak'
    [10:50:14.201] [Info] Loading assets from: '..\mods\Combinable Augments V1.3'
    [10:50:14.205] [Info] Loading assets from: '..\mods\CrazyWeirdandRandomInstruments'
    [10:50:14.206] [Info] Loading assets from: '..\mods\Crew_Plus'
    [10:50:14.208] [Info] Loading assets from: '..\mods\FrackinUniverse.pak'
    [10:50:14.464] [Info] Loading assets from: '..\mods\EPPFix'
    [10:50:14.466] [Info] Loading assets from: '..\mods\ExtraZoomLevels.pak'
    [10:50:14.466] [Info] Loading assets from: '..\mods\FrackinMusic-master'
    [10:50:14.477] [Info] Loading assets from: '..\mods\Luthier.pak'
    [10:50:14.485] [Info] Loading assets from: '..\mods\Mighty Music Instruments.pak'
    [10:50:14.487] [Info] Loading assets from: '..\mods\New Kitchen Cabinet'
    [10:50:14.488] [Info] Loading assets from: '..\mods\NostalgicGreeneryVanilla.pak'
    [10:50:14.500] [Info] Loading assets from: '..\mods\RacialWeaponMegamod_1.1'
    [10:50:14.628] [Info] Loading assets from: '..\mods\recreationalvehicle1'
    [10:50:14.628] [Info] Loading assets from: '..\mods\RandomMics.pak'
    [10:50:14.629] [Info] Loading assets from: '..\mods\RealBirds'
    [10:50:14.640] [Info] Loading assets from: '..\mods\Rexmeck CSGO.pak'
    [10:50:14.641] [Info] Loading assets from: '..\mods\Roblox Death Instrument'
    [10:50:14.642] [Info] Loading assets from: '..\mods\SaplingMaker_v3.0.pak'
    [10:50:14.643] [Info] Loading assets from: '..\mods\Starbound MoreAvianBeaks'
    [10:50:14.645] [Info] Loading assets from: '..\mods\Synthesizers'
    [10:50:14.656] [Info] Loading assets from: '..\mods\UT-47'
    [10:50:14.659] [Info] Loading assets from: '..\mods\Weapon_Reassembler.pak'
    [10:50:14.660] [Info] Loading assets from: '..\mods\avianaugmentpack_tiered'
    [10:50:14.662] [Info] Loading assets from: '..\mods\environmentSafety.pak'
    [10:50:14.663] [Info] Loading assets from: '..\mods\extended_songbook_2-2.pak'
    [10:50:14.663] [Info] Loading assets from: '..\mods\florantails'
    [10:50:14.664] [Info] Loading assets from: '..\mods\healthycapturefixed.pak'
    [10:50:14.664] [Info] Loading assets from: '..\mods\hoardersinventory'
    [10:50:14.665] [Info] Loading assets from: '..\mods\immortal_critters_v.1.0.pak'
    [10:50:14.668] [Info] Loading assets from: '..\mods\jobffers.pak'
    [10:50:14.668] [Info] Loading assets from: '..\mods\RanAuto'
    [10:50:14.694] [Info] Loading assets from: '..\assets\user'
    [10:50:16.411] [Info] Assets digest is 68a219c32ead3a050be46711d945d11e0be88f0c20c77b34b74133629a2295bc
    [10:50:16.411] [Info] Root: Loaded Assets in 3.35922 seconds
    [10:50:16.448] [Info] Root: Loaded ParticleDatabase in 0.0372991 seconds
    [10:50:16.452] [Info] Root: Loaded ImageMetadataDatabase in 4.39852e-06 seconds
    [10:50:16.641] [Info] Root: Loaded PlayerFactory in 3.58928 seconds
    [10:50:16.852] [Info] Root: Loaded MonsterDatabase in 0.211 seconds
    [10:50:16.903] [Info] Root: Loaded MaterialDatabase in 0.491388 seconds
    [10:50:17.255] [Info] Root: Loaded ObjectDatabase in 0.403258 seconds
    [10:50:17.838] [Error] Duplicate projectile asset typeName glitchexplosion. configfile /racialweapons/glitchweapons/staves/tier1/projectiles/glitchexplosion/glitchexplosion.projectile
    [10:50:17.953] [Error] Could not read projectile '/racialweapons/avianweapons/staves/tier2/projectiles/activeitems/staff/quetzalcoatlsquartz/quartzspawner.projectile', error: (JsonException) No such key in Json::get("image")
    [10:50:17.954] [Info] Root: Loaded ProjectileDatabase in 0.698449 seconds
    [10:50:18.017] [Info] Root: Loaded NpcDatabase in 0.0628842 seconds
    [10:50:18.035] [Info] Root: Loaded VehicleDatabase in 0.0179973 seconds
    [10:50:18.036] [Info] Root: Loaded VersioningDatabase in 0.000843783 seconds
    [10:50:18.036] [Info] Root: Loaded EntityFactory in 4.98416 seconds
    [10:50:19.673] [Info] Root: Loaded CodexDatabase in 0.00571221 seconds
    [10:50:19.966] [Info] Root: Loaded FunctionDatabase in 0.0260491 seconds
    [10:50:20.229] [Info] Root: Loaded LiquidsDatabase in 0.00382781 seconds
    [10:50:22.207] [Error] Could not instantiate item '[NG_Seeds_Apple, 1, {}]'. (ItemException) No such item 'NG_Seeds_Apple'
    [10:50:24.893] [Error] Could not instantiate item '[NG_Seeds_Apple, 1, {}]'. (ItemException) No such item 'NG_Seeds_Apple'
    [10:50:25.151] [Info] Root: Loaded ItemDatabase in 8.24815 seconds
    [10:50:25.189] [Info] Root: Loaded QuestTemplateDatabase in 0.0313919 seconds
    [10:50:25.441] [Info] Root: Loaded StatusEffectDatabase in 0.022387 seconds
    [10:50:25.514] [Info] Root: Loaded BehaviorDatabase in 0.345363 seconds
    [10:50:25.800] [Info] Root: Loaded StagehandDatabase in 0.00101166 seconds
    [10:50:33.494] [Info] Root: Loaded StatisticsDatabase in 0.0019797 seconds
    [10:50:36.487] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.1', using placeholder default.
    (AssetException) No such frame discharge.1 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames
    [10:50:36.561] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.2', using placeholder default.
    (AssetException) No such frame discharge.2 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames
    [10:50:36.674] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.3', using placeholder default.
    (AssetException) No such frame discharge.3 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames
    [11:06:30.056] [Info] Root: Loaded EffectSourceDatabase in 0.0227502 seconds
    [11:06:30.242] [Error] Could not load image asset '/racialweapons/floranweapons/staves/tier2/leafstaff2glow.png:discharge.1', using placeholder default.
    (AssetException) No such frame discharge.1 in frames spec /racialweapons/floranweapons/staves/tier2/leafstaff2glow.frames
    [11:06:30.341] [Error] Could not load image asset '/racialweapons/floranweapons/staves/tier2/leafstaff2glow.png:discharge.2', using placeholder default.
    (AssetException) No such frame discharge.2 in frames spec /racialweapons/floranweapons/staves/tier2/leafstaff2glow.frames
    [11:06:30.450] [Error] Could not load image asset '/racialweapons/floranweapons/staves/tier2/leafstaff2glow.png:discharge.3', using placeholder default.
    (AssetException) No such frame discharge.3 in frames spec /racialweapons/floranweapons/staves/tier2/leafstaff2glow.frames
    [11:06:37.409] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.1', using placeholder default.
    (AssetException) No such frame discharge.1 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames
    [11:06:37.514] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.2', using placeholder default.
    (AssetException) No such frame discharge.2 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames
    [11:06:37.611] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.3', using placeholder default.
    (AssetException) No such frame discharge.3 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames
    [11:21:24.001] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.1', using placeholder default.
    (AssetException) No such frame discharge.1 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames
    [11:21:24.072] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.2', using placeholder default.
    (AssetException) No such frame discharge.2 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames
    [11:21:24.157] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.3', using placeholder default.
    (AssetException) No such frame discharge.3 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames
    
    Lot's of stuff there, as it's a bit messy atm, but not sure any of that has anything to do with it.
     
  4. MetaFace

    MetaFace Guest

    As far as I can tell, the only problem seems to be missing images/frames, makes me think that your projectiles aren't updating in some way (Assuming that they indeed do have the proper 'velocities'). I can't look at the image you have shown since im on a public network that blocks pretty much anything that is not text.

    Now that I have checked in its time to leave *dabs and casually walks away*. I'll be back when I can do some proper work...
     
    ImHereForTheMods likes this.
  5. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    I'll try fixing that and see if it helps.
    Thanks again.
     
  6. mastercookie

    mastercookie Existential Complex

    well the first error is duplicate "glitchexplosion" projectile, may wanna fix that first.
     
    ImHereForTheMods likes this.
  7. MetaFace

    MetaFace Guest

    Always fix duplicates, if there is a dupe, neither will work, the game will get confused, had that problem a few times when I first started this modding nonsense... it's ridiculous how easy it is to screw everything over.
     
    ImHereForTheMods likes this.
  8. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    I fixed the duplicate, but, the apex one still doesn't work, the glitch one does, but it always did.
    As far as fixing these:
    [10:50:36.487] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.1', using placeholder default.
    (AssetException) No such frame discharge.1 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames
    [10:50:36.561] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.2', using placeholder default.
    (AssetException) No such frame discharge.2 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames
    [10:50:36.674] [Error] Could not load image asset '/racialweapons/apexweapons/staves/tier2/steelstaff2glow.png:discharge.3', using placeholder default.
    (AssetException) No such frame discharge.3 in frames spec /racialweapons/apexweapons/staves/tier2/steelstaff2glow.frames

    I don't know what to do, because, in the frames file, there is no discharge.
    Edit: well, I guess that means I need discharge frames, but nto sure how to go about that.
     
  9. MetaFace

    MetaFace Guest

    Sounds like you need to define discharge in the frames file yourself... but to tell you the truth I don't think this will fix your current problem, but this should be fixed eventually either way. Kinda confused, I think I had this problem when making a minigun where the bullets weren't moving... I can't remember though.
     
    ImHereForTheMods likes this.
  10. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Hmmm, well I suppose.
    hm.

    Well, I tried adding : "initialVelocity" : [1, 1], to the laser's projectile file, but that doesn't seem to have done anything at all.
     
  11. mastercookie

    mastercookie Existential Complex

    what does steelstaff2glow.frames look like?
     
    ImHereForTheMods likes this.
  12. MetaFace

    MetaFace Guest

    Well... I'm wondering if this could be a lua problem instead of a json error... I haven't worked with staves, but the velocity should be almost the exact same as a gun's. I'm thinking, is it like a constant fire laser or like a semi-auto laser? This could be some weird compatibility issue.
     
    ImHereForTheMods likes this.
  13. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Code:
    {
      "frameGrid" : {
        "size" : [24, 50],
        "dimensions" : [23, 1],
        "names" : [
          [
            "charging.1",  "charging.2",  "charging.3",  "charging.4",  "charging.5", "charging.6", "charging.7", "charging.8", "charging.9", "charging.10",
            "charging.11", "charging.12", "charging.13", "spark.1",    "spark.2",    "spark.3",    "loop.1",     "loop.2",     "loop.3",      "loop.4",
            "fire.1",      "fire.2",      "fire.3"
          ]
        ]
      }
    }
    
     

    Attached Files:

  14. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    I managed to fix the frames on the glitch tier 2 staff (game breaker) somehow.
    Code:
    {
      "frameGrid" : {
        "size" : [24, 50],
        "dimensions" : [26, 1],
        "names" : [
          [
            "charging.1",  "charging.2",  "charging.3",  "charging.4",  "charging.5", "charging.6", "charging.7", "charging.8", "charging.9", "charging.10",
            "charging.11", "charging.12", "charging.13", "spark.1",    "spark.2",    "spark.3",    "loop.1",     "loop.2",     "loop.3",      "loop.4",
            "fire.1",      "fire.2",      "fire.3",  "discharge.1", "discharge.2", "discharge.3"
          ]
        ]
      }
    }
    
    Could be, idk, but I certainly hope not.
    Human plasma staff does the same thing, spawns projectile, but it won't move.

    May it need the guidedbolt script instead of controlledprojectile?

    I don't get it though, cause the game breaker's sword projectile shooting ability works fine.


    Deadboltlaser projectile file : (lasers shot from spawned drone, from staff)
    Code:
    {
      "projectileName" : "deadboltlaser",
      "physics" : "laser",
      "bounces" : 1,
      "damageKindImage" : "icon.png",
      "image" : "deadboltlaser.png",
      "animationCycle" : 0.2,
      "timeToLive" : 3.0,
      "animationLoops" : false,
      "frameNumber" : 4,
      "power" : 50,
      "supportsProcessing" : true,
      "initialVelocity" : [1, 1],
      "actionOnReap" : [
        {
          "action" : "config",
          "file" : "/config/plasmabulletexplosion.config"
        }
      ],
      "lightColor" : [225, 150, 50],
      "damageKind" : "plasma"
    }
    
    Glitch sword shooting projectile file :
    Code:
    {
      "projectileName" : "glitchsword",
      "physics" : "stickybomb",
      "image" : "glitchsword.png",
      "animationCycle" : 0.2,
      "bounces" : -1,
      "timeToLive" : 2.5,
      "frameNumber" : 6,
      "speed" : 70,
      "damagePoly" : [ [-20, 5.5], [14, 5.5], [14, -5.5], [-20, -5.5] ],
      "animationLoops" : true,
      "piercing" : false,
      "flippable" : true,
      "actionOnReap" : [
        {
          "action" : "sound",
          "options" : [ "/sfx/tesla_shock_kill.ogg" ]
        },
        {
          "action" : "config",
          "file" : "/config/glitchexplosion.config"
        }
      ],
      "damageKind" : "retro"
    }
    
    Pretty well near identical, but one works, one doesn't.
     

    Attached Files:

    Last edited: Feb 28, 2017
  15. MetaFace

    MetaFace Guest

    Well if the laser is moving a straight path, then you don't want a script that tells it to follow you're cursor.

    "game breaker's sword projectile"? And this is a staff right? You just using the projectile and not the whole ability right? I hope so as the guy who posted a tutorial about how not to do that...
     
    ImHereForTheMods likes this.
  16. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Good to know.
    Yes, I believe I am just referencing the projectile - calling it to be used, when the main ability is used. Posted the codes for both in an edit a few mins ago.

    The swords fire beautifully, no problem there, they work just as intended. The apex staff's drone's laser beams is a different story though.
     
    Last edited: Feb 28, 2017
  17. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    I just found a couple lua files in the assets :
    \assets\_unpacked\projectiles\activeitems\staff

    staffprojectile.lua
    Code:
    require "/scripts/util.lua"
    require "/scripts/vec2.lua"
    
    function init()
      self.controlMovement = config.getParameter("controlMovement")
      self.controlRotation = config.getParameter("controlRotation")
      self.rotationSpeed = 0
      self.timedActions = config.getParameter("timedActions", {})
    
      self.aimPosition = mcontroller.position()
    
      message.setHandler("updateProjectile", function(_, _, aimPosition)
          self.aimPosition = aimPosition
          return entity.id()
        end)
    
      message.setHandler("kill", function()
          projectile.die()
        end)
    end
    
    function update(dt)
      if self.aimPosition then
        if self.controlMovement then
          controlTo(self.aimPosition)
        end
    
        if self.controlRotation then
          rotateTo(self.aimPosition, dt)
        end
    
        for _, action in pairs(self.timedActions) do
          processTimedAction(action, dt)
        end
      end
    end
    
    function control(direction)
      mcontroller.approachVelocity(vec2.mul(vec2.norm(direction), self.controlMovement.maxSpeed), self.controlMovement.controlForce)
    end
    
    function controlTo(position)
      local offset = world.distance(position, mcontroller.position())
      mcontroller.approachVelocity(vec2.mul(vec2.norm(offset), self.controlMovement.maxSpeed), self.controlMovement.controlForce)
    end
    
    function rotateTo(position, dt)
      local vectorTo = world.distance(position, mcontroller.position())
      local angleTo = vec2.angle(vectorTo)
      if self.controlRotation.maxSpeed then
        local currentRotation = mcontroller.rotation()
        local angleDiff = util.angleDiff(currentRotation, angleTo)
        local diffSign = angleDiff > 0 and 1 or -1
    
        local targetSpeed = math.max(0.1, math.min(1, math.abs(angleDiff) / 0.5)) * self.controlRotation.maxSpeed
        local acceleration = diffSign * self.controlRotation.controlForce * dt
        self.rotationSpeed = math.max(-targetSpeed, math.min(targetSpeed, self.rotationSpeed + acceleration))
        self.rotationSpeed = self.rotationSpeed - self.rotationSpeed * self.controlRotation.friction * dt
    
        mcontroller.setRotation(currentRotation + self.rotationSpeed * dt)
      else
        mcontroller.setRotation(angleTo)
      end
    end
    
    function processTimedAction(action, dt)
      if action.complete then
        return
      elseif action.delayTime then
        action.delayTime = action.delayTime - dt
        if action.delayTime <= 0 then
          action.delayTime = nil
        end
      elseif action.loopTime then
        action.loopTimer = action.loopTimer or 0
        action.loopTimer = math.max(0, action.loopTimer - dt)
        if action.loopTimer == 0 then
          projectile.processAction(action)
          action.loopTimer = action.loopTime
          if action.loopTimeVariance then
            action.loopTimer = action.loopTimer + (2 * math.random() - 1) * action.loopTimeVariance
          end
        end
      else
        projectile.processAction(action)
        action.complete = true
      end
    end
    
    staffprojectilespawner.lua
    Code:
    require "/scripts/util.lua"
    require "/scripts/vec2.lua"
    
    function init()
      self.spawnTimer = config.getParameter("spawnDelay")
    
      message.setHandler("updateProjectile", function(_, _, aimPosition)
          self.aimPosition = aimPosition
          if self.secondaryProjectile then
            local res = {entity.id(), self.secondaryProjectile}
            self.secondaryProjectile = nil
            return res
          else
            return entity.id()
          end
        end)
    
      message.setHandler("kill", function()
          projectile.die()
        end)
    end
    
    function update(dt)
      if self.spawnTimer > 0 then
        self.spawnTimer = math.max(0, self.spawnTimer - dt)
        if self.spawnTimer == 0 then
          local params = config.getParameter("spawnParams", {})
          params.power = projectile.power()
          params.powerMultiplier = projectile.powerMultiplier()
    
          self.secondaryProjectile = world.spawnProjectile(
            config.getParameter("spawnProjectile"),
            mcontroller.position(),
            projectile.sourceEntity(),
            {0, 0},
            false,
            params
          )
        end
      end
    end
    
    perhaps I could use these in some way to make it work?
    I dunno.

    Or maybe they have some info on why this ain't working?

    Maybe plasma ball would be apossible reference?
    \assets\_unpacked\projectiles\activeitems\staff\plasmaball

    Dunno.

    EDIT: So, now I've removed, like, 90% of the code from the glitchsword ability (which launches swords) making it look like this:

    Code:
    {
      "projectileName" : "glitchsword",
      "physics" : "laser",
      "image" : "glitchsword.png",
      "actionOnReap" : [
        {
          "action" : "sound",
          "options" : [ "/sfx/tesla_shock_kill.ogg" ]
        },
        {
          "action" : "config",
          "file" : "/config/glitchexplosion.config"
        }
      ],
      "damageKind" : "retro"
    }
    
    and it STILL WORKS... So, apparently, a bunch of those values weren't the problem. . .
     
    Last edited: Feb 28, 2017
  18. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Still looking for some help on this, as I have yet to figure it out.

    Maybe if I put all my projectile files / activeitem files / etc here that'd help...
    Let's see.
    Tier 2 apex staff (as seen in gif)


    {
    "itemName": "apextier2staffbasic",
    "level": 6,
    "price": 1440,
    "maxStack": 1,
    "rarity": "Legendary",
    "description": "Creates a drone that fires lasers and rockets.",
    "shortdescription": "Deadbolt Staff",
    "category": "staff",
    "twoHanded": true,
    "itemTags": ["weapon", "staff"],
    "tooltipKind": "staff",

    "animation": "/items/active/weapons/staff/staff.animation",
    "animationParts": {
    "staff": "apexsteelstaff2.png",
    "stone": "",
    "chargeEffect": "steelstaff2glow.png"
    },



    "animationCustom": {
    "animatedParts": {
    "parts": {
    "chargeEffect": {
    "properties": {
    "zLevel": 2,
    "fullbright": true,
    "centered": true,
    "offset": [0.02, 1.475],
    "transformationGroups": ["weapon"]
    }
    }
    }
    }
    },

    "inventoryIcon": "apexsteelstaff2.png",

    "scripts": ["/items/active/weapons/staff/staff.lua"],

    "stances": {
    "idle": {
    "armRotation": -90,
    "weaponRotation": 0,
    "twoHanded": false,
    "weaponOffset" : [-0.1, 1.0],

    "allowRotate": false,
    "allowFlip": true
    },
    "charge": {
    "duration": 1.3,
    "armRotation": 20,
    "weaponRotation": -20,
    "twoHanded": true,
    "weaponOffset" : [-0.1, 1.0],

    "allowRotate": false,
    "allowFlip": true
    },
    "charged": {
    "armRotation": 20,
    "weaponRotation": -20,
    "twoHanded": true,
    "weaponOffset" : [-0.1, 1.0],

    "allowRotate": false,
    "allowFlip": false
    },
    "discharge": {
    "duration": 0.5,
    "armRotation": 20,
    "weaponRotation": -20,
    "twoHanded": true,
    "weaponOffset" : [-0.1, 1.0],

    "allowRotate": false,
    "allowFlip": false
    },
    "cooldown": {
    "duration": 0.5,
    "armRotation": -45,
    "weaponRotation": 0,
    "twoHanded": true,
    "weaponOffset" : [-0.1, 1.0],

    "allowRotate": false,
    "allowFlip": false
    }
    },

    "elementalType": "physical",

    "primaryAbilityType": "deadboltteleportin",
    "primaryAbility": {
    "type": "deadboltteleportin",
    "name": "Deadbolt Teleportin",
    "scripts": ["/items/active/weapons/staff/abilities/controlprojectile/controlprojectile.lua"],
    "class": "ControlProjectile",

    "energyCost": 100,

    "maxCastRange": 25,

    "projectileType": "deadboltteleportin",
    "projectileParameters": {
    "baseDamage": 20
    }
    },


    "altAbility": {
    "type" : "healingzone",
    "name" : "Healing Zone",
    "scripts" : ["/items/active/weapons/staff/abilities/effectzone/effectzone.lua"],
    "class" : "EffectZone",

    "energyCost" : 80,

    "maxCastRange" : 25,

    "projectileType" : "healingzone",
    "projectileParameters" : {}


    },


    "builder": "/items/buildscripts/buildunrandweapon.lua"
    }



    {
    "ability" : {
    "type" : "deadboltteleportin",
    "name" : "Deadbolt Teleportin",
    "scripts" : ["/items/active/weapons/staff/abilities/controlprojectile/controlprojectile.lua"],
    "class" : "ControlProjectile",

    "maxCastRange" : 25,

    "energyPerShot" : 25,
    "projectileSpawnInterval" : 0.4,

    "projectileType" : "deadboltteleportin",

    "projectileParameters" : {
    "baseDamage" : 9,
    "image" : "deadboltteleportin.png",
    "animationCycle" : 0.2,
    "frameNumber" : 6,
    "speed" : 0,
    "damagePoly" : [ [-36, 0], [-24, -24], [0, -36], [24, -24], [36, 0], [24, 24], [0, 36], [-24, 24] ],
    "animationLoops" : false,
    "piercing" : true,
    "flippable" : true,
    "damageKind" : "default"
    },

    "projectileDelayEach" : 0.25
    }
    }




    {
    "projectileName" : "deadboltteleportin",
    "physics" : "hover",
    "bounces" : -1,
    "speed" : 10,
    "timeToLive" : 0.5,
    "damageKindImage" : "icon.png",
    "lightColor" : [150, 100, 15],
    "piercing" : true,
    "image" : "deadboltteleportin.png",
    "animationCycle" : 0.5,
    "animationLoops" : false,
    "orientationLocked" : true,
    "flippable" : true,
    "frameNumber" : 7,
    "power" : 0,
    "damagePoly" : [ [-3, 3], [-3, -3], [3, -3], [3, 3] ],
    "supportsProcessing" : true,
    "onlyHitTerrain" : true,
    "actionOnReap" : [
    {
    "action" : "projectile",
    "type" : "deadbolt",
    "inheritDamageFactor" : 0.0,
    "inheritSpeedFactor" : 0.1,
    "angleAdjust" : 0
    },
    {
    "action" : "sound",
    "options" : [ "/sfx/tech/mech_jump1.ogg" ]
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 30
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 40
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 50
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 60
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 70
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 80
    },
    {
    "action" : "projectile",
    "type" : "rocket",
    "fuzzAngle" : 0,
    "inheritDamageFactor" : 0.2,
    "inheritSpeedFactor" : 10000,
    "delaySteps" : 90
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 100
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 110
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 120
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 130
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 140
    },
    {
    "action" : "projectile",
    "type" : "deadboltlaser",
    "fuzzAngle" : 8,
    "inheritDamageFactor" : 0.133,
    "inheritSpeedFactor" : 9000,
    "delaySteps" : 150
    },
    {
    "action" : "projectile",
    "type" : "rocket",
    "fuzzAngle" : 0,
    "inheritDamageFactor" : 0.2,
    "inheritSpeedFactor" : 10000,
    "delaySteps" : 160
    }
    ],
    "damageKind" : "plasma"
    }




    {
    "projectileName" : "deadboltlaser",
    "physics" : "laser",
    "bounces" : 1,
    "damageKindImage" : "icon.png",
    "image" : "deadboltlaser.png",
    "animationCycle" : 0.2,
    "timeToLive" : 3.0,
    "animationLoops" : false,
    "frameNumber" : 4,
    "power" : 50,
    "speed" : 10,
    "supportsProcessing" : true,
    "initialVelocity" : [1, 1],
    "actionOnReap" : [
    {
    "action" : "config",
    "file" : "/config/plasmabulletexplosion.config"
    }
    ],
    "lightColor" : [225, 150, 50],
    "damageKind" : "plasma"
    }




    {
    "projectileName" : "deadbolt",
    "physics" : "hover",
    "bounces" : -1,
    "speed" : 25,
    "timeToLive" : 3.5,
    "damageKindImage" : "icon.png",
    "lightColor" : [150, 100, 15],
    "piercing" : true,
    "image" : "deadbolt.png",
    "animationCycle" : 0.5,
    "orientationLocked" : true,
    "flippable" : true,
    "frameNumber" : 4,
    "power" : 0,
    "damagePoly" : [ [-3, 3], [-3, -3], [3, -3], [3, 3] ],
    "supportsProcessing" : true,
    "onlyHitTerrain" : true,
    "actionOnReap" : [
    {
    "action" : "config",
    "file" : "/config/vsmallregularexplosionknockback.config"
    }
    ],
    "damageKind" : "plasma"
    }




    {
    "action" : "actions",
    "list" : [
    {
    "action" : "spark"
    },
    {
    "action" : "sound",
    "options" : [ "/sfx/gun/impact_plasma.ogg" ]
    },
    {
    "action" : "explosion",
    "foregroundRadius" : 1,
    "backgroundRadius" : 0,
    "explosiveDamageAmount" : 0.5,
    "delaySteps" : 2,

    }

    ]
    }





    {
    "action" : "actions",
    "list" : [
    {
    "action" : "projectile",
    "inheritDamageFactor" : 1,
    "type" : "vsmallregularexplosionknockback"
    },
    {
    "action" : "loop",
    "count" : 10,
    "body" : [
    {
    "action" : "spark"
    }
    ]
    },
    {
    "action" : "sound",
    "options" : [ "/sfx/gun/grenadeblast_small1.ogg", "/sfx/gun/grenadeblast_small2.ogg", "/sfx/gun/grenadeblast_small3.ogg" ]
    },
    {
    "action" : "light",
    "color" : "orange"
    },
    {
    "action" : "explosion",
    "foregroundRadius" : 1,
    "backgroundRadius" : 0,
    "explosiveDamageAmount" : 0.5,
    "delaySteps" : 2
    }

    ]
    }




    Hopefully this will help somone to help me see the issue, cause I really don't see it.
    Thanks in advance.

    the inherit speed factor was set to like, 9000
    "inheritSpeedFactor" : 9000,
    not sure if that has something to do with it. Turned it to 9, but hasn't changed.
     
    Last edited: Mar 1, 2017
  19. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    I FIGURED IT OUT!!!!

    Okay, so, to help all others who have this problem :
    (Just look at all my files above in the spoilers, those are what I changed stuff in)

    So, in the deadbolt teleportin.projectile, I removed all the parts that said:
    "inheritDamageFactor" : (number),

    and then, all my projectiles started working!

    [​IMG]

    Beautiful!

    Now, I don't know why the default value for this was 9000 of all things, but, removing that code seems to have mostly fixed it. Some tweaks to make still, but, it's coming together!

    Thank you all for helping me out with this!
     
    xaliber and MetaFace like this.
  20. MetaFace

    MetaFace Guest

    Glad you figured it out, I personally would've had no clue.
     
    ImHereForTheMods likes this.

Share This Page