Mask Posted July 31, 2013 Share Posted July 31, 2013 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. Quote Link to comment Share on other sites More sharing options...
Max_Caine Posted July 31, 2013 Share Posted July 31, 2013 I believe the answer to both of those is not really. There is a timer mechanism, but you'd have to set the item to weapon.explosive. Quote Link to comment Share on other sites More sharing options...
4Aces Posted July 31, 2013 Share Posted July 31, 2013 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. Quote Link to comment Share on other sites More sharing options...
Max_Caine Posted July 31, 2013 Share Posted July 31, 2013 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. Quote Link to comment Share on other sites More sharing options...
Mask Posted August 2, 2013 Author Share Posted August 2, 2013 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). Quote Link to comment Share on other sites More sharing options...
4Aces Posted August 3, 2013 Share Posted August 3, 2013 I will try to take a look at it tomorrow. I know they can be thrown (Vanilla range of 6 in my mod - in testing), so now all we need to do is limit the amount of prime-time. Quote Link to comment Share on other sites More sharing options...
Mask Posted August 3, 2013 Author Share Posted August 3, 2013 Thank you for that. Please let me know of your results. Quote Link to comment Share on other sites More sharing options...
4Aces Posted August 3, 2013 Share Posted August 3, 2013 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. Quote Link to comment Share on other sites More sharing options...
Mask Posted August 3, 2013 Author Share Posted August 3, 2013 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. Quote Link to comment Share on other sites More sharing options...
4Aces Posted August 4, 2013 Share Posted August 4, 2013 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). Quote Link to comment Share on other sites More sharing options...
Mask Posted August 4, 2013 Author Share Posted August 4, 2013 (edited) 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 August 4, 2013 by Mask Quote Link to comment Share on other sites More sharing options...
4Aces Posted August 10, 2013 Share Posted August 10, 2013 Sorry, was gone for most of the week (and busy for the rest). Do not worry about the credit. It was a tiny thing, but thanks for offering! I think they are hard-coded. I have not come across them. I will keep my eyes open though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.