OpenXcom Forum

Modding => Help => Topic started by: vadracas on April 04, 2020, 07:15:16 pm

Title: Throwing weapons
Post by: vadracas on April 04, 2020, 07:15:16 pm
So I've been thinking of implementing something where if you really need to, you can throw your weapon at an enemy as an attack. My problem is that I have no idea how to move the actual weapon to that location like the generic throw action does. Is that an option accessible to modders?
Title: Re: Throwing weapons
Post by: Solarius Scorch on April 04, 2020, 09:48:53 pm
So I've been thinking of implementing something where if you really need to, you can throw your weapon at an enemy as an attack. My problem is that I have no idea how to move the actual weapon to that location like the generic throw action does. Is that an option accessible to modders?

No, it's not a modding option.

Still, I think the idea is hilarious (had it for years myself) and I'd be happy to see it, for the lulz if nothing else :)

Normal throw: normal throw
Ctrl + throw: treat the item as a thrown missile, with damage depending on its weight, as well as new custom modifier(s) to reflect things like hardness or sharpness
Title: Re: Throwing weapons
Post by: vadracas on April 04, 2020, 11:26:02 pm
Is it worth adding this as a thread for OXCE?
Title: Re: Throwing weapons
Post by: Meridian on April 04, 2020, 11:30:13 pm
No, it's a feature that's just not needed.

This is as much of a cosmetic detail (or easter egg) as it gets and it is really not worth the effort needed to implement it.

... now feel free to crucify me.
Title: Re: Throwing weapons
Post by: Solarius Scorch on April 04, 2020, 11:46:04 pm
Yeah, not a real request on my part. Just pointing out it would be funny, and I probably would be consistently using it if it existed.
Title: Re: Throwing weapons
Post by: vadracas on April 04, 2020, 11:55:34 pm
But I really wanna throw my sword at someone. :( :( :(

lol, I understand, but I would absolutely use it if it was available.
Title: Re: Throwing weapons
Post by: Vangrimar1 on April 05, 2020, 05:00:38 am
I think you can make a spear, for example, which can be used in hand-to-hand combat and throw if necessary. Just pick it up does not work. ;)
Title: Re: Throwing weapons
Post by: vadracas on April 05, 2020, 02:16:04 pm
I think you can make a spear, for example, which can be used in hand-to-hand combat and throw if necessary. Just pick it up does not work. ;)

Yeah, I know I can do that, but there is a major flaw with the current system. If I implement a "throw" action, it doesn't actually throw the weapon to that tile, meaning that I either have infinite uses of the "throw" action or I lose my weapon completely after I throw.
Title: Re: Throwing weapons
Post by: The Martian on April 14, 2020, 10:49:33 pm
If you can spawn an item where a weapon projectile hits then you could create a melee weapon that also has a single charge of ammo and fires in an arc.

When the melee weapon's ammo is exhausted the weapon is deleted, a new item is then created on the tile that the projectile hit giving the illusion that the weapon was thrown as the projectile.

I think it is already possible to spawn units so perhaps spawning items may also be possible via scripting?
Title: Re: Throwing weapons
Post by: vadracas on April 14, 2020, 11:12:17 pm
If you can spawn an item where a weapon projectile hits then you could create a melee weapon that also has a single charge of ammo and fires in an arc.

When the melee weapon's ammo is exhausted the weapon is deleted, a new item is then created on the tile that the projectile hit giving the illusion that the weapon was thrown as the projectile.

I think it is already possible to spawn units so perhaps spawning items may also be possible via scripting?

Ah yes, the mighty script. Perhaps I'll dig into a way to do that.