OpenXcom Forum

OpenXcom => Suggestions => Topic started by: Zeta Reticulan on February 22, 2023, 04:49:46 pm

Title: Toss grenades around corners.
Post by: Zeta Reticulan on February 22, 2023, 04:49:46 pm
How cool would it be if grenades could be tossed around a corner or an entry way without exposing your soldier to enemy fire? If it's possible to mod, the max throwing distance should be really short when throwing around a corner. A mod like this would make grenades useful even if you have a grenade launcher mod installed.
Title: Re: Toss grenades around corners.
Post by: Solarius Scorch on February 22, 2023, 06:20:43 pm
Just Ctrl+D, Ctrl+K... ::)
Title: Re: Toss grenades around corners.
Post by: Zeta Reticulan on February 22, 2023, 08:04:09 pm
You're telling me xcom had this feature all along? 😮
Title: Re: Toss grenades around corners.
Post by: BlackStaff on February 23, 2023, 01:48:53 am
Just Ctrl+D, Ctrl+K...
Only if debug mode is enabled in "options.cfg"!  :D   ;D   ;D
Title: Re: Toss grenades around corners.
Post by: TBeholder on February 27, 2023, 05:36:00 am
How cool would it be if grenades could be tossed around a corner or an entry way without exposing your soldier to enemy fire?
As in, object bounce physics instead of instant "whoops, all momentum is suddenly gone"? Well, yes.
Even if it was implemented, however…
1. In order to not look weird too, it should at least crudely tell the obstacles apart when deciding how elastic the collision should be, i.e. requires an extra tile property. Not that it was a big deal, but still.
2. In UFO:AI bounce physics is implemented (it’s on Quake 3 engine, after all), and it is, indeed, cool. But also, last checked this led to the following chain of events: <hidden movement> <impact sound> <impact sound> <green flash> <alien dying sound> …more often than once per two missions. The invaders keep taking losses from devious hu-mon architecture (like street lamps). Grenade bounce is the new point-blank rocket, at least in dense terrains. :)
Title: Re: Toss grenades around corners.
Post by: Xilmi on February 27, 2023, 10:36:55 am
You're telling me xcom had this feature all along? 😮
No, I think they're trying to mock you for wanting something that would make the game much easier.
Ctrl+d, ctrl+k is "kill all enemies and immediately win the mission".
Title: Re: Toss grenades around corners.
Post by: Zeta Reticulan on February 27, 2023, 04:13:39 pm
It wouldn't make it that much easier if tossing around a corner has a very short range, just like in real life. SWAT teams and military usually toss a grenade into a room before going in.
Title: Re: Toss grenades around corners.
Post by: Solarius Scorch on February 27, 2023, 04:48:31 pm
It's not about the game being easier, it's about the engine being completely unsuited for this. It's almost like asking for an FPS sequence. The missile (grenade in this case) would have to originate not only off-centre, but from a completely different tile, which is unprecedented and completely against both the mechanics and the spirit. Not to mention that it wouldn't simulate other issues, like for example the thrower being 100% safe during the throw. And then you went into objects bouncing off walls, which is honestly in a "let's write a new engine from scratch" territory.
I certainly didn't mean to sound condescending ("mocking" is a bit of a strong word IMO), but it really wasn't a very sensible idea. Which is still okay; most ideas in general aren't very good, whereas som are. That's how brainstorming works. :)
Title: Re: Toss grenades around corners.
Post by: Zeta Reticulan on February 27, 2023, 06:49:08 pm
Actually, I didn't say anything about bouncing off a wall, just the ability for the grenade to turn a corner. Maybe something like the way points for the blaster launcher. But if it's not possible, oh well.
Title: Re: Toss grenades around corners.
Post by: Solarius Scorch on February 27, 2023, 07:03:18 pm
Sincere apologies; I mixed your post with Beholder's. But most points still stand.

Actually, I didn't say anything about bouncing off a wall, just the ability for the grenade to turn a corner. Maybe something like the way points for the blaster launcher. But if it's not possible, oh well.

Actually you could make it work like Blaster Launcher... But it won't be a thrown grenade, it will be a one-shot "gun". This has been used by Robin in his "From the Apocalypse" mod to emulate the Boomeroid, and I also parroted his solution in X-Com Files. But I doubt it would satisfy your request.
Title: Re: Toss grenades around corners.
Post by: Zeta Reticulan on February 27, 2023, 07:07:19 pm
Interesting. I'll have to look into it. It would turn the grenade into an instant grenade I assume, because isn't  instant grenades treated like a one shot gun?
Title: Re: Toss grenades around corners.
Post by: Solarius Scorch on February 27, 2023, 07:59:13 pm
Interesting. I'll have to look into it. It would turn the grenade into an instant grenade I assume, because isn't  instant grenades treated like a one shot gun?

Yes, precisely. It's just a pistol with one bullet which disappears after use.
Title: Re: Toss grenades around corners.
Post by: Zeta Reticulan on February 27, 2023, 10:18:08 pm
I need to get my hands on that code.
Title: Re: Toss grenades around corners.
Post by: The Martian on February 27, 2023, 11:39:13 pm
Actually you could make it work like Blaster Launcher... But it won't be a thrown grenade, it will be a one-shot "gun".
I need to get my hands on that code.

I may be misunderstanding but do you mean something like this:
Code: [Select]
items:
  - type: STR_EXAMPLE_WEAPON
    size: 0.2
    costSell: 36900
    weight: 8
    bigSprite: 19
    floorSprite: 19
    bulletSprite: 6
    fireSound: 11
    hitSound: 19
    hitAnimation: 36
    power: 60
    damageType: 4
    accuracyAimed: 100
    tuAimed: 50
    clipSize: 1 # <==
    battleType: 1
    twoHanded: true
    invWidth: 1
    invHeight: 1
    arcingShot: true # <==
    maxRange: 1 # <==
    waypoints: 2 # <==
    accuracyMultiplier:
      firing: 0.0
      throwing: 1.0

The above code is untested I'm not sure if arcingShot: works with the waypoints: setting.
Title: Re: Toss grenades around corners.
Post by: Zeta Reticulan on February 28, 2023, 02:26:41 am
Don't know much about the codes, but I think that is what I mean. Can a weapon have 2 different firing modes? One using way points (when tossing around a corner), and the other an arcing shot (when thrown in a straight line)?
Title: Re: Toss grenades around corners.
Post by: Chuckebaby on February 28, 2023, 01:45:14 pm
You could probably use a baseline example from something like a Cybermite. But rather than toss them, have them be a deployable (one use) motorized drone grenade.

How you code this ? I have no clue. I believe Cybermites need to be deployed by a carrier. So you'd need to work out the details.

The only reason I say use a Cybermite structure is, you'd keep the laws of physics in tact. Creating a remote control grenade is much more believable. Almost like a mini remote control car with wheels.
I would also suggest balance be taken into consideration. Using one would take up all a soldiers TU's. vs. what normal grenades use.