Author Topic: Thrown items as melee and vice versa?  (Read 1178 times)

0 Members and 1 Guest are viewing this topic.

Zandman

  • Sergeant at Arms
  • *
    • View Profile
    • Zandmod I
  • Faction: Vaegir
Thrown items as melee and vice versa?
« on: November 07, 2008, 10:47:34 AM »
I'm making a mini-mod (http://forums.taleworlds.net/index.php/topic,49398.0.html), and I wonder if it's possible to duplicate the "throwing axe" item (e.g.), make it a melee item and just rename it?
I know I CAN, but will there be an issue with changing where the character grips the axe/which direction it's facing and other problems I may not be aware of?
This also goes for making short spears into one-time throwing weapons, javelins into short melee spears, throwing knives into regular knives, etc. (TESTED)

NOTE: I'm primarily using the Item Editor and editing the .txt files - I haven't learned Python thing yet.


[EDIT 2008-11-14]

I've now tested out a couple of things: Making jarids, javelins and throwing axes into melee weapons is easy - just using the Item Editor.
Making throwing knives and throwing daggers into melee weapons requires for them to be rotated 180 degrees first.

Making a melee weapon like a shortened spear, e.g., into a throwing weapon proved to me more troublesome, though:
* Duplicated the "shortened spear" item and renamed the duplicate: "shortened throwing spear".
* Edited the item in Item Editor to be a thrown weapon (behaving like a javelin) with an ammo setting of 1.
PROBLEM:
The "shortened throwing spear" rests on my back, as normal. When I pick it up and ready it for attack, and when I throw it, everything looks normal...
Right after the attack, though, the spear returns to my back, and in the inventory I see that the ammo of the spear reads 1/1, and not 0/1, as I had hoped and expected.

Why doesn't it count down to zero? How can I fix that, and will that take care of my problem?
« Last Edit: November 14, 2008, 09:28:57 AM by Zandman »
(download HERE! )

Silver

  • Abhorrent Abomination
  • Grandmaster Knight
  • *
  • Fire and friction. Now that stuff is hot.
    • View Profile
  • Faction: Neutral
Re: Thrown items as melee and vice versa?
« Reply #1 on: November 07, 2008, 12:54:25 PM »
The problem with that is that the engine isn't made for it. You can throw away your spear and still fight with it, or throw all your axes and whip out one to fight with.

And well, just use other items as reference, shouldn't be too hard to position them. Knives need to be turned over, axes should be fine almost like they are, and javelins need to be turned over, I think.
Silver is a hilarious tranny in a corset singing Time warp repeatedly over and over. He is absolutely fantastic.
Feels good to leave a mark.

The society that separates its warriors from its scholars will have its thinking done by cowards, and its fighting done by fools.

Note: Yes, that was intentional. And no, you just take me too seriously. Stop that.

Zandman

  • Sergeant at Arms
  • *
    • View Profile
    • Zandmod I
  • Faction: Vaegir
Re: Thrown items as melee and vice versa?
« Reply #2 on: November 07, 2008, 01:07:01 PM »
The problem with that is that the engine isn't made for it. You can throw away your spear and still fight with it, or throw all your axes and whip out one to fight with.

And well, just use other items as reference, shouldn't be too hard to position them. Knives need to be turned over, axes should be fine almost like they are, and javelins need to be turned over, I think.


OK, thanks!
Not sure what you meant with the first part, though. If I make a spear into a throwing weapon and the ammo amount to 1, the unit would throw it like any old javelin and the ammo would be depleted, right? I meant to implement it as a completely separate item: so if I duplicate "Spear" (and not change the original), I'd just make a new "Spear (thrown)", which acts as thrown, ammo 1.

I don't need the unit to first fight with, say, an axe as a melee weapon and then throw the same axe at you.
(download HERE! )

Silver

  • Abhorrent Abomination
  • Grandmaster Knight
  • *
  • Fire and friction. Now that stuff is hot.
    • View Profile
  • Faction: Neutral
Re: Thrown items as melee and vice versa?
« Reply #3 on: November 07, 2008, 01:12:27 PM »
Yeah, I meant that that was going to happen. Someone can equip a spear, and a spear (thrown), which makes it look pretty ugly since they just threw away their weapon and still hits you with it.
Silver is a hilarious tranny in a corset singing Time warp repeatedly over and over. He is absolutely fantastic.
Feels good to leave a mark.

The society that separates its warriors from its scholars will have its thinking done by cowards, and its fighting done by fools.

Note: Yes, that was intentional. And no, you just take me too seriously. Stop that.

Zandman

  • Sergeant at Arms
  • *
    • View Profile
    • Zandmod I
  • Faction: Vaegir
Re: Thrown items as melee and vice versa?
« Reply #4 on: November 07, 2008, 01:22:38 PM »
But can't I fix that if I simply control the placement of the spear on the body?
Then it wouldn't look as the same spear: a unit could charge at you, throw the spear (thrown) and then equip his other spear (melee) and fight you with it.
Worst case scenario, the unit would come at you with the melee spear, change spears and throw the throwing spear before changing BACK to the melee spear, but I could live with that - maybe the unit knows something I don't know.

Worst worst case scenario, I'll just see to it that no unit that is equipped with a throwing spear also has the same melee spear.

Or... did I miss something?
(download HERE! )

Nethoras

  • Knight at Arms
  • *
  • Im to sexy for my battle plate
    • View Profile
  • Faction: Swadian
Re: Thrown items as melee and vice versa?
« Reply #5 on: November 08, 2008, 06:37:40 AM »
firstly, why? whats wrong with probable throwing weapons?

SPD_Phoenix

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Thrown items as melee and vice versa?
« Reply #6 on: November 08, 2008, 07:39:07 AM »
Have you try to duplicate the hatchet, then replace the original hatchet mesh with the throwing axe mesh?

IIRC, the BRF Edit can do scaling and resetting the origin (hand placement). If not, get Wing3D. Export the model with BRF Edit. Import it into Wing 3D. Do scaling, moving hand placement. Save. Import it back into brf using BRF Edit.

Barf

  • Sergeant Knight at Arms
  • *
    • View Profile
  • Faction: Neutral
Re: Thrown items as melee and vice versa?
« Reply #7 on: November 08, 2008, 09:25:54 AM »
can you give melee weapons "ammo" and make it so the ammo of the melee weapon depletes to 0 if you use a duplicate ranged version?,
if not ignore the rest of this reply and forgive my ignorance.

To make it look as though the weapon is disappearing and actually being thrown you could attach the animation of the mesh scaling down to 0 onto the same animation the quiver uses. At ammo 1 the weapon will be usable and visible and at ammo 0 it will disappear and be unusable...would also have to remove the "you have no ammo for this weapon".

Silver

  • Abhorrent Abomination
  • Grandmaster Knight
  • *
  • Fire and friction. Now that stuff is hot.
    • View Profile
  • Faction: Neutral
Re: Thrown items as melee and vice versa?
« Reply #8 on: November 08, 2008, 09:40:52 AM »
No, you can't. At least not in earlier versions, I don't think it's something that has changed.
Silver is a hilarious tranny in a corset singing Time warp repeatedly over and over. He is absolutely fantastic.
Feels good to leave a mark.

The society that separates its warriors from its scholars will have its thinking done by cowards, and its fighting done by fools.

Note: Yes, that was intentional. And no, you just take me too seriously. Stop that.

Zandman

  • Sergeant at Arms
  • *
    • View Profile
    • Zandmod I
  • Faction: Vaegir
Re: Thrown items as melee and vice versa?
« Reply #9 on: November 08, 2008, 12:39:40 PM »
firstly, why? whats wrong with probable throwing weapons?

Surely, you're not trying to tell me that throwing a spear is improbable?
(download HERE! )

Nethoras

  • Knight at Arms
  • *
  • Im to sexy for my battle plate
    • View Profile
  • Faction: Swadian
Re: Thrown items as melee and vice versa?
« Reply #10 on: November 08, 2008, 05:12:27 PM »
firstly, why? whats wrong with probable throwing weapons?

Surely, you're not trying to tell me that throwing a spear is improbable?

in quantaties of more than one for a man on foot, yes and in quantaties of one, largely useless unless your making some kind of hoplite/legioninaire/ any form of multipurpose foot troop en masse.

also there is a script that makes it so certain ammo types only fit certain guns,I beleive it worked by checking you equipped items at the start of a battle, and replacing wrong ammo with someting, or simply remoiving it. You could tweak this to run of a certain keystroke, and instead of checking your firearms and ammo, it went through a list of melee weapons that you deem should be throwable, and replaced said melee weapon with the throwing weapon f your choice. I know it sounds really confusing, but its not ALL that cmplicated, just rather time consuming I would assume.

but if you were to make it this way, the melee item and the thrown would be gone when you throw it, which would make sense and actually be a kinda cool feature :p also once you worked out the script it could be used for plenty of things that the community could use, affixxing bayonets, changing the grip on a weapon, crossbow bludgeoning :p

anyways sorry for long post, but I hope this helps

Zandman

  • Sergeant at Arms
  • *
    • View Profile
    • Zandmod I
  • Faction: Vaegir
Re: Thrown items as melee and vice versa?
« Reply #11 on: November 13, 2008, 10:48:28 AM »
Well, now I've tried a few things out, with varying degrees of success:

Making javelins and jarids into melee weapons (via Item Editor) was easy. Didn't even have to rotate the objects, just change their properties from "thrown" to "one-handed weapon", tweak a few settings and voilĂ ! - mini-spears.
Did the same thing with throwing axes, but I haven't had the time to test them yet.

Trying to make a shortened spear into a throwing weapon was a different matter:
The placement of the spear was fine, and I threw it all right, but the spear didn't disappear from my back after I threw it. It DID look right as I picked it up and as I threw it, but it reappeared after the throw. When I looked at it in the inventory, it said that my "ammo" wasn't depleted. I've set the spear as a throwing weapon with ammo of 1, but it doesn't reach "ammo: 0/1" the same way a jarid, e.g., reaches "ammo: 0/7" when you've thrown the last one.
I don't know why this is - I can't quite see the logic of it.

What to do, what to do? How can I get the ammo to "count down", and will the whole problem be fixed if I manage to make the ammo deplete?
(download HERE! )

maw

  • Hardcore
  • Sergeant Knight
  • *
  • "The Original Permadeath-Guy"
    • View Profile
  • Faction: Neutral
  • WB
Re: Thrown items as melee and vice versa?
« Reply #12 on: November 13, 2008, 05:51:34 PM »
Thrown items as melee and vice versa? yes. you can. heres how.

it involves the modifying Shield Bash Script in a manner that another key takes an assigned polearm stabbing animation and applies it to the javelin in a ready weapon slot, and applies random damage like the shield bash.

if the regular attack key (mouse button, usually) the javelin is thrown. if the assigned alternate key is used, an effect like a stabbing spear is applied. you can prolly assign the same to axes and daggers and knives.

simple - not. but doable. 9/10's of the work is already in the bash script. maw

Zandman

  • Sergeant at Arms
  • *
    • View Profile
    • Zandmod I
  • Faction: Vaegir
Re: Thrown items as melee and vice versa?
« Reply #13 on: November 13, 2008, 06:07:45 PM »
Thrown items as melee and vice versa? yes. you can. heres how.

it involves the modifying Shield Bash Script in a manner that another key takes an assigned polearm stabbing animation and applies it to the javelin in a ready weapon slot, and applies random damage like the shield bash.

if the regular attack key (mouse button, usually) the javelin is thrown. if the assigned alternate key is used, an effect like a stabbing spear is applied. you can prolly assign the same to axes and daggers and knives.

simple - not. but doable. 9/10's of the work is already in the bash script. maw

Thanks a lot - that's actually really interesting! But that's actually way more complex than what I had in mind. I don't need to put differens functions to the same item; only one function to one item for now... until I learn more about modding.

See, I have a separate item I've called "Shortened Spear (thrown)" that looks like a polearm, but behaves exactly like a javelin, only it isn't seven of them - only one.
So I've set the spear's ammo to 1, and I've made it into a thrown weapon instead of a polearm, but (as I've said in my previous post) it won't count down from 1 ammo to 0 ammo after I've thrown it, and just reappears.

That's all I want fixed: Special throwing spear on my back. I throw spear. Spear gone.
(download HERE! )

Silver

  • Abhorrent Abomination
  • Grandmaster Knight
  • *
  • Fire and friction. Now that stuff is hot.
    • View Profile
  • Faction: Neutral
Re: Thrown items as melee and vice versa?
« Reply #14 on: November 13, 2008, 08:28:13 PM »
Thrown items as melee and vice versa? yes. you can. heres how.

it involves the modifying Shield Bash Script in a manner that another key takes an assigned polearm stabbing animation and applies it to the javelin in a ready weapon slot, and applies random damage like the shield bash.

if the regular attack key (mouse button, usually) the javelin is thrown. if the assigned alternate key is used, an effect like a stabbing spear is applied. you can prolly assign the same to axes and daggers and knives.

simple - not. but doable. 9/10's of the work is already in the bash script. maw

That is awesome...

But... Would that still work even after you're out of ammo, since you technically still have a weapon equipped?
Silver is a hilarious tranny in a corset singing Time warp repeatedly over and over. He is absolutely fantastic.
Feels good to leave a mark.

The society that separates its warriors from its scholars will have its thinking done by cowards, and its fighting done by fools.

Note: Yes, that was intentional. And no, you just take me too seriously. Stop that.