Jump to content

Modding Grenades: Delay and Throwing Arc?


Mask
 Share

Recommended Posts

Is is possible to put a delay on grenade detonation, through modding? I was wondering if it would be possible to have grenades explode at the end of the player's turn, or possibly the end of the alien's.

I'd also like to ask if modding the throwing arc and range of grenades is feasible.

I and a friend are attempting to mod some features, and we're wondering if there's much hope in editing the grenades.

Link to comment
Share on other sites

It is on my list of to-do's for my mod, and I thought that turning grenades into explosive (C4) would work. Just edit the range, effects, and graphics, and sounds.

So Max what would be the issue you see with changing it to weapon.explosive? It is far easier to learn how my plans would have failed here, than endless reloads into combat. ;)

Link to comment
Share on other sites

I'm not certain how the explosive subtype fully operates - I don't have enough experience with it. I'm uncertain how far an explosive subtype can be thrown (if it can be thrown at all - I haven't used them at all since v18), and if explsive subtypes have a flat trakectory or an arcing trajectory. I'd have to investigate further.

Link to comment
Share on other sites

Gotten it working by converting the grenades to explosives. One problem is, you can't use them via the quick slot any more. Another, is that you have a lot of options for exactly how long the grenade is primed (though that's technologically possible).

Link to comment
Share on other sites

It is hard coded. The only thing that can be done by us is to edit \assets\scripts\timerdialog.lua and cut it down to something reasonable (e.g. 4). Of course it will look a little strange with that much unused space, so creating some new icons and using them will probably also be necessary.

I found code that indicates grenades in the game have the ability to have a delay, but it is not active. So either this was cut, or they are developing it.

Link to comment
Share on other sites

It's quite likely they plan to make that aspect moddable. I've found that to be the case with engagement ranges, at least.

Regardless, you've come up with a great fix. Come to think of it... couldn't we reduce the timer to 1, making it so grenades can only be primed in one way (pulling the pin and releasing the spoon)? Even so, 2 might be a better setting, to avoid people running out of TUs and blowing themselves up.

One thing of particular note, is that you can re-set grenade timers. So, you bake a grenade for a couple of turns, then you can set it back to 6 or whichever. Not a big issue, but worth mentioning.

Actually, that might be useful... If someone keeps re-setting their grenade to 2, that'd be a fair simulation of pulling the pin, but keeping a hold on the spoon. Which is handy if they decide not to throw the grenade.

I forgot to check whether you could fully disarm an explosive after activating it. Will have to check that.

Link to comment
Share on other sites

It is coded, so you should be able to as long as it is an explosive, not a grenade. Personally, I will probably make my timer just 1 or 2. The original had a use for longer when the AI tried to hunt you down, but Xenonauts does not have that (yet).

Link to comment
Share on other sites

As you say, 1 to 2 seems like the best setting.

We'll have to credit you for coming up with the grenade timer fix, unless you'd prefer not to be. What name would you like to be credited by? Just 4Aces?

EDIT: Hmm... any ideas on how to have timer code specifically for the grenades? If I could work out where weapon types like "Explosives" are designated, it shouldn't be too hard to set up. But I don't know where those are, if they're even available without the sourcecode.

Edited by Mask
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...