Space Engineers

Space Engineers

Revived Large Ship Railguns (With penetration and shield damage!)
Denne tråd er blevet låst
R.U.Sirius23 31. aug. 2018 kl. 17:23
(HELP) Trying to get the Penetration script to work with another weapon mod
So I've been trying to get the Penetration script to work with another weapons mod (Albion weapon set) for the last week and I've had exactly no luck at all. (Granted I'm a pretty green when it comes to programming/scripting)

So what are the requirements for a weapon to work with this script (if any)?

- Does it have to be a Gatling Turret if it's turreted? Or a Small Missile Launcher if fixed?
- Do I have to define new classes in the script to make sure any changes I make don't interfere with another mod running the same script? ie. namespace Whiplash.RailGun -> namespace Whiplash.NewName
- Are there any changes to the .sbc files that need to be made? (outside of balancing MassDamage to how the script works)

Any help from Whiplash or anyone whose successfully used this script on their weapon mod would be greatly appreciated.
< >
Viser 1-13 af 13 kommentarer
jackik 30. sep. 2018 kl. 16:43 
Copy the linking to the script from the original railgun as you can see in its file. Concerning namespaces, you should be fine just naming the weapon something other than his railgun, but you can try to be save and just add a 2 everywhere or something.
All the changes you are trying to make are made in the .sbc file, so yeah.
a continuation of the question, does this only work with missile type projectiles, or will it work with the game's bullet type projectile too?
jackik 14. nov. 2018 kl. 9:55 
It's an external damage script, i believe it shouldn't matter as long as you tell the game to do damage via this script and not the vanilla method.
Fantastic, thanks. One more thing, for the projectiles health pool, will it continue to penetrate if it doesn't destroy the block it hits, if it has more health than the object it's piercing? Or does the health pool translate into damage it does and damage remaining it can do?
jackik 16. nov. 2018 kl. 15:47 
It's:
Somthing is hit
if blockhealth < damage pool then {
delete block
damagepool = damagepool - blockhealth
} else {
blockhealth = blockhealth - rests of damagepool
delete projectile
}
rinse, repeat, if it hits something else

i'm guessing you mean the "damage pool" instead of health pool...
The projectile will disapear in 3 different cases:
Either it has reaached its max range,
It has hit something and then reached its max range afterwards (its a relatively small range)
or it has depleted its damage pool
cool. That works a little different than I thought but I think I have just enough brain to tweak that. What I want to do is set it up so that it will pass through blocks until it runs out of health but leave them with damage = the projectiles damage value.
jackik 17. nov. 2018 kl. 3:53 
So you want it to deal less damage overall but behave more like a beamweapon with punchthrough? Sure, you could do that, but how do you want to tweak something like that reasonably? Have it deal flat damage everytime? You could make it damage non-armor blocks more than armor blocks, that would be fun! (something like having it deal more damage the less health a block has or similar)
Well, my idea was, and I'm not sure if I will be skilled enough to code it. But to have armor blocks resist quite a bit of damage, which I've coded before, but have components resist no damage, so they take a lot of damage if they're out and exposed. The projectile, in this case regular 25mm rounds from the gatling gun, would pierce through armor blocks unempeded, but get lodged in and damage components within. This way I could reel back the damage I have on them in my mod from about 120 down to about 33. So they won't break blocks, but simulate spawling and punchtrough on thin sheets of metal while damaging components within. I could use that mechanic to add variability to the ammunition types allowing some to penetrate better but deal poorer damage and vice versa.

Or make missiles that had small AoE's but high damage that would penetrate just a couple blocks to simulate AT rockets.

That is my idea.

jackik 18. nov. 2018 kl. 4:44 
That's not bad, overall it would also cut down costs. Turrets always aim for functional blocks anyway. I like the idea, but i keep thinking about how to make it the most realistic, and that would be with an exponential decay function for the damage that is started after the first punchthrough and exponentially worsens for each block hit.
Linear models or even a constant one would be too op and would litterally rip anything to shreds, which is why this mod here has the super high energy requirement. however the good thing about higher damage falloff would be that you could keep the inital range just constant. No need to have it disappear x meaters after punchthrough.
If you want to get extra fancy, you could simulate 'refraction' of the projectile through each block by just adding the squareroot of a random number to each element of it's direction (x,y,z) :D
Properly balanced that would be awesome.
I'm a very poor coder, I'd love to impliment that but I only really know how guns work and not C# ;~;
jackik 19. nov. 2018 kl. 1:24 
well, then you are already past my knowledge ^^
But i'd like to help where i can. I have C knowedge but no idea about C# really. But i'd like to get back into it... but i haven't done so for time reasons :/ though i should . . .
I really like the idea implimenting your defraction method. If you could figure out how to make it work I'd like to integrate it. First I need to figure out how to turn Delete Block function into damage though.
jackik 19. nov. 2018 kl. 13:20 
i don't know how the speed is actually characterized ingame or if you can edit x,y,z components individually. You can look at the current scrip and how it handles damage (it makes it's own damage calc stuff).
< >
Viser 1-13 af 13 kommentarer
Per side: 1530 50