Modding Help Remote Weapon that generates poison liquid and stop at cursor location.

Discussion in 'Starbound Modding' started by RedBastion, Aug 8, 2021.

  1. RedBastion

    RedBastion Intergalactic Tourist

    Hi, Im new to modding but have already created and modify a few things to my own liking, however, for my son, I want to generate cosmetics that he likes.

    Liquid issue: The issue I have right now is that the liquid cannot generate the same way as the balloon works and it will have to be inserted trought LUA? Which LUA the projectile LUA or the weapon LUA? Would need to add a function SpawnLiquid and add it at the end of the projectiles triggers? Right now: The remote works as intended but not matter where I try to add the spawnliquid command it just does not generate any poison or remote stop working.

    Projectile end location issue: Im not sure if its possible at all but is it possible to have a projectile stop at the cursor location? Ex.: A Whip will always strike at the cursor unless its out of range. Right now, all the physics seems to just have the projectiles go on, even with laser. Is it possible to add a collision on the cursor but specifically for this projectiles? Current attempt: Using the Hover Chakram coding to have my projectile stop at the ownerAimPosition but it just go to its max distance travel without stopping at the cursor. (Even using laser physics)

    I'm starting to have issues with modding when it starts to plays with multiple config or LUA files but Im starting to understand how function are called in LUA just not when multiple are used at the same time

    PS.: Would eventually add something, blood liquid generated on strike and such. (I am well aware some mods have that already, but its a hell to try to understand anything in Frackin Universe hahaha.
    Also, let me know which files you want and I will send it. Right now I am working on it and making too many change.
     
    Last edited: Aug 8, 2021
  2. Dakrhunter30

    Dakrhunter30 Scruffy Nerf-Herder

    For liquid, if you're trying to create a gun that fires the liquid and it being placed, look at the "watergun" and its projectile "squirt". It places water using "actionOnReap".

    "actionOnReap" : [ { "action" : "liquid", "liquid" : "water", "quantity" : 0.2 } ],

    Regarding the projectile and location, are you refering for a projectile to fly until it reaches the cursor location on creation (location when the gun spawned the projectile) and then destroy itself or does any action?

    You could create a status effect such as "Bleeding" and insides its LUA script cause it to spawn liquid at the affected entitys location. The bleed would have a short duration and/or a lockout of spawning the liquid every so often (like cooldown)
     
  3. RedBastion

    RedBastion Intergalactic Tourist

    Liquid: if there is already an actiononreap it would be : "actionOnReap" : [ { "action" : "config", "file" : "/projectiles/explosions/regularexplosion2/regularexplosionknockback.config" }, { "action" : "liquid", "liquid" : "water", "quantity" : 0.2 } ], ??? I believe this still has to be called in a LUA script, probably somewhere around the trigger, since the remotegrenade launcher was not naturally build to spawn liquid no? (Remote Grenade Launcher Trigger but not the projectiles lua)

    Projectile END location : I want it to leave my Gun/Grenade Launcher and STOP at the cursor location, I dont want my projectile to spawn at the location, just stop its movement there, regardless if it has reached its maximum range or not, and when the "Trigger" button is pressed, projectile will explode and spawn poison as the projectile.die. (But adding a function between the projectile.die and End breaks the trigger) It probably has to be called somewhere in the Grenade Launcher LUA.

    Eye Blinking Effect: I also want to add the blinking and twitching animation to the gun but... thats seems to be a lots of works if I want to combine it with the Remote Grenade Launcher Triggers (But not losing hope if figuring it out hahaha) especially since its originally a Melee Weapon :rofl:.
    QUESTION: Could a weapon use 5 different LUA or they would all need to be converge into one? So far on my test, I have removed the 2nd ability and the blinking is still occurring, but like my liquid issue, all the animation are occurring in a LUA and im slowly removing the 2nd ability from the LUA to have the animation isolated... once isolated, ill be able to put that anywhere :D

    Bleeding: Yes! that's also a desired effect and I will gladly take it if there is a decent Blood Mod with that (FU seems to have a nice decent one but I just cant find all the files required to have it working separately. (Not my main focus right now)

    I also just started working on a :nuruflirt:Custom Magnaorbs:nuruflirt: with 5 projectiles instead of 3, changed them into swords and notice that I can make multiple different skills depending on the amount of actives sword, this is getting really interresting!

    PS.: I will work on the liquid again tonight and post my files here so that people can see where i'm wrong so I can learn :D
     
    Last edited: Aug 9, 2021
  4. Dakrhunter30

    Dakrhunter30 Scruffy Nerf-Herder

    Liquid & Projectile END location: I've created an example remote-granadelauncher that spawns poison and stops at the cursors location. You can use/edit this one as you please.
    Function wise, the projectile receives an additional parameter that declares its stop location and when it reaches that location, sets the velocity of the projectile to 0, hence stopping it in place.

    Check out the .LUA files of the projectile for more details. Important is also the additional parameter provided within the weapon .LUA itself. Its called "endPosition" (Ctrl + F, to find the location), without that the projectile wouldn't know when to stop.

    Liquid: I have copied from the "Toxicwaste barrel", here some sources:
    • Toxicwaste barrel (../objects/glitch/toxicwastebarrel)
    • poisonbarrel.projectile (../projectiles/unsorted/poisonbarrel.projectile)
    • poisonballoon.projectile (../projectiles/poisonballon/poisonballon.projectile)

    Eye Blinking Effect: If you mean the blinking of the granade itself, that you can simply adjust with its image and .frame file. In my example I have provided both versions of the granade if ya want to have a look.
    For the animation of the gun itself, that does not directly require LUA but you can adjust it within the .animation file and animationStates. These states can be tricky and I'm still learning how those work, so I cant really explain much here.
    As for multiple LUA scripts, that is not possible directly. You could setup references within the scripts to one another and in that way they could use functions from other scripts, but most of the time, Lua stuff that concerns and item/weapon are kept within one file.

    Bleeding: Creating your own version of blood liquid using water as template wouldn't be that hard ;)

    Yeah, Magnaorbs are really nice. Haven't done much with them yet, but I know they have a lot of possibilities.
     

    Attached Files:

    Last edited: Aug 11, 2021
  5. RedBastion

    RedBastion Intergalactic Tourist

    Thanks Dakrhunter30, I had the correct line in my weapon lua but the projectile lua section what exactly what I was looking for... however I don't understand why its working... not matter what I was trying to add as function, it was breaking the trigger itself.
    Also, if I try to recopy your code to my projectile, the projectile will reach the Endposition but start dropping to the floor instead of floating.
    However, for the liquid production part, I also could make it throw other poisonballon, I am actually looking for a spawnliquid on the function trigger ()

    If located this that somewhat seems to be working in another mode but I can't make it happen for the remoteprojectile
    function init()
    --self.spawnLiquid = projectile.getParameter("spawnLiquid", "poison")
    end

    function uninit()
    --[[void projectile.processAction(actionOnReap : {
    {
    action = "liquid",
    liquid = self.spawnLiquid,
    quantity = 1
    }
    })--]]
    end

    Liquid: Still WIP
    EndPosition : SOLVED

    Eye blinking Effect:
    Sorry for not mentioning this before. I mean the Eyesword Blink/Twitch effect. They are using the lua as an animator for this specific Sword. I love this animation and my whole Weapons Series have eyes on the weapons. but the 2nd ability of the sword in the lua I don't give a crap lol. I was wondering if the animator parts could be isolated and simply be used and called like the vec2.lua and such.

    Ive added my Dissolver for you to look at, I have yet to properly animate the weapon(Liquid Pump system) and better projectile animation. Ive notice that the weapon is not held properly (Hand positioning would need to be adjusted in the lua?) also yea... it will be a glass transparent weapon... (Using the FutaraDragon OpenGL files), ill need to work on the color panel too.
    Ive also added the eyesword in case it does not ring a bell or you do not have it close by. (PS.: Ive removed the 2nd ability from the activeitem and the animation still work but the lua is untouched and dont mind the red spot too (Just a test))
    Ive also added my Custom MagnaOrbs(Swordy's Slave) for you to understand why I want that Eyeanimation badly hahaha (PS.: I will also work on the right click eye veins shield animation) (Eye animation will be on the gauntlet and, if possible, on projectiles also)

    Ive been busy playing Starmancer and will start enter issue and help them out on their game :) (PS.: Im a FQA (Videogame Tester) in real life :D) AND
    I now have a trap that can generate an endless supply of liquid and I realised that I can work other trap the same way to successfully have different projectile animation occurring which could make a GOOD LOOKING WATERFALL FINALLY!!!!! - Only one trap is required to generated the liquid and the other traps are mostly for the looks and textures by using the projectile image, can turn into an animation when the projectile is fired at a fast speed.... just not sure if this will cause major lag yet. but the endless water no problem so far. In other words, Id used the object for the top and bottom waterfall animation and dropping projectiles for the left/right waterfall effect. so yea.... also now working on WATERFALL

    Too many projects at the same time :rofl:... 2 days off next week. I hope to work on modding :)
     

    Attached Files:

  6. RedBastion

    RedBastion Intergalactic Tourist

    Eye blinking Effect: Ive managed to remove the 2nd ability from the LUA, there wasn't much to remove. It does not have to be removed if you want to use a 2nd ability too, it should still work if another ability is used anyway. Now Ill try to integrate it on simple one hand gun for starter,that should be simple, until I use a weapon that already use LUA but for im done for tonight.

    Only need to know how to transfert that data in another lua or if I can call the blinking lua in another lua like mention before? Ill experiment more around it tommorrow.
     
    Last edited: Aug 14, 2021
  7. Dakrhunter30

    Dakrhunter30 Scruffy Nerf-Herder

    Dont try to spawn liquid or anything within the Init() function of the projectile. That funcion is called immediately when the projectile is spawned (unless you wanna spawn poison directly on yourself).

    In the attached file I've altered the projectile LUA. It has the spawn liquid functionality tied to its uninit, so when the projectile dies. It also has an adjustment you should add, that corrects a condition problem when firing the projectile to the left at the same y-axis as the player (straight line to the left).
    You could add the liquidspawn function within your object with slightly adjusted x-axis so it covers a wider area.

    I looked into your files and now understand the blinking part and I gotta be honest, I didn't know that animation was handled in the LUA. That being said, adding that LUA code to other weapons script file is not that hard, but the magorbs having those eyes is gonna be very difficult as it revolves alot around animation parts/states.
    Magorbs are already difficult to understand on the animation side. For that we may need someone with more animation knowledge then me.

    Don't overwork yourself ;)
     

    Attached Files:

  8. RedBastion

    RedBastion Intergalactic Tourist

    Nice! Thanks again. Oh yea, I noticed I had a hardtime shooting on the bottom left side. I presume the Void function is from older coding? Yea I figured the init was when the item is initiated, at first, I tought it had to be loaded in the init funct to be called anywhere else but not and many thanks again. After you helping me out, I noticed that not all the codes are on the websites im looking at that talk about lua. I will learn a lot more about LUA as I try to integrate animated lua in other lua :rofl:. Ill also take the time to learn the color code for transparency purposes. That and get used to the all the offsets too. Already got help from another thread. Ill remember you and mention you if I ever upload any :).
     
    Last edited: Aug 15, 2021
  9. RedBastion

    RedBastion Intergalactic Tourist

    I am almost done working with it now :). I was wondering, Is there an easy way to have only 1 hand seen when holding a two hand weapons? Im going for the easy way and modify my weapons to add an handle instead but if there is an easy way that be great :).
     
  10. Dakrhunter30

    Dakrhunter30 Scruffy Nerf-Herder

    You can alter the stances in the activeitem itself to make it look like its one-handed while occupying both hands. The second hand would hast be down the side of your character.

    Here an example gun I've made, its a handcannon thats held in one hand but occupies both hands on the hotbar.
     

    Attached Files:

  11. RedBastion

    RedBastion Intergalactic Tourist

    Here is the "Final Version" of the Dissolver : They are still a few offset issues with it and the handle needs some art love and there is a empty flicking that bug me in the cursors but I think its cool even as it is now :) (PS.:added the horns for the cursors SFX) I will also do the 1h stance version too (Feel more natural)

    Eyesword lua animation: In the end, copy pasting the animation to the weapons lua cannot be done and end up breaking the function itself.. I had hope because the game runs at less , I will attempt to call the functions of another lua like the weapon lua calls the function from the projectiles lua like the triggers function.
     

    Attached Files:

    Last edited: Aug 20, 2021
  12. RedBastion

    RedBastion Intergalactic Tourist

    Hmmm Seems like adding the /requires of the animation LUA will make it happen (Will test around with other melee). I just need to switch it to occurs on the ArmPosition since it was programmed to work on the sword itself. (Step 1 - Working on it) and eventually add if and do lines so that the animation LUA calls for the correct lines if its a melee or a ranged weapon (Step 2).
     
    Last edited: Aug 23, 2021

Share This Page