Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

enable boolet gun to shoot m/s2 exploding boolets

Discussion in 'Modding' started by Aryeonos, Mar 18, 2016.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Aryeonos Trainee Engineer

    Messages:
    38
    There's something I can't figure out, and that's how to mod a weapon to accept both missile type ammo, and regular ammo.

    For instance, I'm trying to make HE ammo for the vanilla gatling turret, but I want it to retain the ability to use the AP-T ammo I made for it.

    Similarly, I have a turret, that shoots in bursts, like the missile turret, with multiple barrels, I also want to give it an HE shell option.
     
  2. Digi Senior Engineer

    Messages:
    2,384
    Look at the AutomaticRifleGun in Weapons.sbc, it has commented out stuff for missiles, that should be an example enough to show you what you need to add for missiles to work.
     
  3. Aryeonos Trainee Engineer

    Messages:
    38
    I tried this, but continue to run into the same issue where it'll use the ammo, but no projectile will fire.

    On top of which, you can't cycle through multiple ammo types with regular fixed weapons.
     
  4. Digi Senior Engineer

    Messages:
    2,384
    Yeah I see that you can't swap ammo on it which is an issue.

    I placed the rocket magazine first and I was able to fire rockets but the issue is that they fire from 0,0,0 world position... maybe it requires a dummy on the model ?
    Look around the workshop maybe you can find some hand held missile launchers that still work and ask the author about it.

    EDIT: I looked in the source code and indeed it seems that rockets use a different dummy, "muzzle_missile", you need to modify the model to add that dummy. That only leaves the ammo swapping issue.


    You could probably use a script to force to swap ammo on a key.
    Code:
    (MyAPIGateway.Session.ControlledObject as Sandbox.Game.Entities.IMyControllableEntity).SwitchAmmoMagazine();
    Never tried this myself so it might not work.
    But you should know that input is detected at all times, even in menus, chat, etc, so use it carefully.
     
    Last edited: Mar 20, 2016
  5. Aryeonos Trainee Engineer

    Messages:
    38
    I figured that was the case but I was hoping it was something I could fix codeside. I hate working with blender.
     
  6. BlackRedDead Apprentice Engineer

    Messages:
    204
    the problem is the projectile system - for rockets/explosions you need to spawn a model
    where a simple projectile spawns something else (particle i guess - but not sure!)

    btw, if you find a way pls let us know ;-)
     
  7. Aryeonos Trainee Engineer

    Messages:
    38
    Hrm, well, I can't seem to find a way to open MWM files, and the extension they recommend in the tutorial for havoc is no longer supported.
    http://www.havok.com/pcxs_redirect/

    How would I go about employing that ammo change script? Is it a file I'd put in my mod, or something else?
     
  8. BlackRedDead Apprentice Engineer

    Messages:
    204
    you cant model with the .mwm files!
    you need the .fbx source! ;-)
    you can find the stock blocks source in the SDK pack ;-)

    about scripting idk :-/
    saw 1-3 mods that actually attach scripts to blocks but they seem to be all gone/deleted - maybe that isnt supported anymore :-/

    edit:
    better answer!^^
    .mwm file support for maya?
     
  9. Digi Senior Engineer

    Messages:
    2,384
    @Aryeonos
    You'll need to know some programming language to even start with something like this, not necessarily C# since you can start by knowing the basics from other languages.
    It's not simply pasting that in a file. You can start by looking through the guides section or the modding API section... and by simply opening mods that have scripts and seeing how things are done.

    But, regardless, the inability to switch ammo is an issue which should be fixed by the devs and once that happens the script is no longer necessary, up to you if you think it's worth the effort.


    I think there's more than 3, not to mention I have a lot of script mods myself which mostly work :p
     
  10. Ronin1973 Master Engineer

    Messages:
    4,845
    It sounds like you're trying to create a machine gun with a grenade launcher underneath. Could you create a toolbar item for the G menu that controls the functionality of which of the ammo types you're looking to fire? I think I've seen some first person shooters solve the problem by making the weapon actually two weapons but only one item and then swap out the different instances via a keybind.
     
  11. Aryeonos Trainee Engineer

    Messages:
    38
    No, I'm trying to give full sized guns the ability to fire explosive ammo, the problem is, the model dummy's don't support different types of ammo in keen's engine, there's a seperate dummy for missiles and bullets, and the models I'm working with only have one or the other.
     
  12. BlackRedDead Apprentice Engineer

    Messages:
    204
    @Digi :
    wasnt there such an "ammo switch" feature implemented with the Small ship sniper rifle?! ;-)

    and i wasnt talking about scripts itself - i mean block attached scripts - like the "airlock control block" thats now gone from workshop because keen restricted the possibility to attach scripts directly to blocks :-(

    to the topics matter:
    theres no way to do that - projectiles work different from rockets
    you could surpass this by making 2 models with theire respective guntype and place them over each other via
    Code:
    <ModelOffset x="0" y="0" z="0" />
    
    in the "CubeBlocks.sbc" - just change that about 1 at the intended axis ;-)
    ofc the problem is that you somewhere cant build xP
    and if you have a gatling it looks awkward when 1 weapon spins and the other not
    (beside the fact that you can blow yourself up if you try to fire booth simuntanoisly)
    a way to solve the visual is to make 2 1barreled blocks to form a 2barreled gun ;-)

    but because im not good at explaining things - here two mods that do something simliar to what i mean :)
    Enhanced cockpit concept
    Fighter Cockpit LCD Modules
     
  13. Digi Senior Engineer

    Messages:
    2,384
    We already talked about this in the thread, it doesn't work, that's the problem.

    I'm certain you can attach scripts to blocks, Keen didn't remove that ability.
    Even if they removed it, you could still monitor when the block entity is added and removed and add/remove it from a list then execute code for each of the blocks in the main script loop, would be the same thing as attaching to the block.
     
Thread Status:
This last post in this thread was made more than 31 days old.