Picks, axes and hammers.

Users who are viewing this thread

Austupaio said:
You can do simple changes on the model, take javelins for example.

You can't change the model, unfortunately (except for throwing weapons, you can change the flying ammo model, but not the normal model). The javelin changes due to the differences in the carry animations. 
 
Would it work with an itp_has_bayonet flag? I believe I may have used that on a ranged weapon to make a knife for melee, but I'm not sure.
 
MadocComadrin said:
Nah, that just makes an animation play when switching.

Nice, I was searching about "itp_has_bayonet" and found the answer here. So my next question; how do you set a knife as bayonet which can be usable for the rifle. I mean, you need a bayonet, right?
 
No. You make a rifle without a bayonet and the same rifle with a bayonet. Then place the bayonetted rifle exactly after the unbayonetted one and give the first (unbayonetted) the itp_next_item_as_melee|itp_has_bayonet flags. And bingo - the rifle has a bayonet now.
MadocComadrin said:
Nah, that just makes an animation play when switching.
This. It doesn't use a separate knife model, it just depends on your gun.
 
Previously I tried to rotate the rifle with pressing "x" but it did not work. Like you said, I had two models: enfield(normal) and enfield_alt(rotated ver.).
I suppose bayonet won't appear if I try. I'd like to learn how javelins rotate.
 
I see..

So the game does not accept the second model, just keeps the first model when you press "x". That should be corrected!
 
Sorry for double post, I have another problem about x-function. Now I have a rifle with bayonet attachment and when I press "x" the rifle becomes polearm, which means it works perfect. However, bots never use x-function, they prefer to use shovels or knifes. Is this fixable?
 
I know they'll do it sometimes for throwing weapons. Try making the melee version have a high cost or up the polearm skill of the troops who you want to use it.
 
...necro

@OP: Try making a weird model like this so that both of the versions are the same shape:

hybridwp.jpg


Texture the faces the thin lines represent. Make only the sharp part on one version's left and the other's right side invisible. Lastly, give one blunt and the other piercing damage.
 
I didn't read the rest of the thread but to answer the OP the answer is no if you decide to put the same type as the main and secondary "x" function. So meaning:
1-Handed/1-Handed = Crash on scene upon item load
1-handed/2-Handed = OK
2-Handed/2-Handed = Crash on scene upon item load
2-Handed/Throwing = OK

Also make sure the secondary mesh has the same number of Vertices as the first. Split the mesh up into parts and hide smaller ones within the mesh and just move and scale the hidden meshes. Take a good look at the scabbard models to see how they hide the sword mesh.
 
Computica said:
I didn't read the rest of the thread but to answer the OP the answer is no if you decide to put the same type as the main and secondary "x" function. So meaning:
1-Handed/1-Handed = Crash on scene upon item load
1-handed/2-Handed = OK
2-Handed/2-Handed = Crash on scene upon item load
2-Handed/Throwing = OK

Also make sure the secondary mesh has the same number of Vertices as the first. Split the mesh up into parts and hide smaller ones within the mesh and just move and scale the hidden meshes. Take a good look at the scabbard models to see how they hide the sword mesh.
Aside from the OP being ancient, just wanted to clarify...
Are you certain about this?  I'm almost 100% positive that same itp_type_*s can be itp_next_item_as_melee'd to one another. I did so in Python test code to lazily create alternate "no swing"/high thrust versions of weapons for use in formations and it worked fine without any crashing.
Code:
		add_item = deepcopy(orig_items)
		for i in reversed(range(1,len(orig_items))):
			itm_flags = add_item[i][3]
			type = itm_flags & 0x000000ff
			dmg = get_thrust_damage(add_item[i][6]) % 256
			dmg_type = get_thrust_damage(add_item[i][6]) / 256
			if type == itp_type_polearm and itm_flags & itp_couchable == 0 and dmg > 2 and dmg_type == pierce and itm_flags & itp_next_item_as_melee == 0 and add_item[i-1][3] & itp_next_item_as_melee == 0 :
				#Above checks that it is a polearm with piercing thrust damage that isn't already involved in a 'X' toggled alt-weapon
				orig_items[i][3] = orig_items[i][3] | itp_next_item_as_melee #flag native item as changeable
				add_item[i][0] = add_item[i][0]+'_alt'                  #add *_alt to the new item's name
				itm_flags = itm_flags & ~itp_merchandise      #disallow from merch list
				itm_flags = itm_flags | itp_crush_through     #add crush-through a la WFaS
				if (get_swing_damage(add_item[i][6]) % 256 > 0):        #if weapon wasn't already thrust-only
					speed = get_speed_rating(add_item[i][6])
					add_item[i][6] = add_item[i][6] & ~(ibf_armor_mask << iwf_speed_rating_bits) #clear speed
					speed +=5                                                                    #boost speed by 5
					add_item[i][6] = add_item[i][6] | spd_rtng(speed)                            #write increased speed
				if itm_flags & itp_two_handed == 0:
					add_item[i][4] = add_item[i][4] | itcf_thrust_onehanded  #so that the polearms use 'bent elbow' with shields
				add_item[i][4] = add_item[i][4] | itcf_thrust_twohanded      #overhead thrust
				add_item[i][6] = add_item[i][6] & ~(ibf_damage_mask << iwf_thrust_damage_bits) #erase damage
				dmg -= 2                                                                       #reduce damage by 2
				add_item[i][6] = add_item[i][6] | thrust_damage(dmg, pierce)                   #write reduced damage
				orig_items.insert(i+1, add_item[i])        #add right after the native item, so it can be switched to
Bottom line is that I add itp_next_item_as_melee to the Native item and then add a duplicated item of the same type, but with changed stats, to the items list following the Native item and the toggle between the two worked fine when last tested on 1.143. Haven't tested on 1.153
 
Aye, if you have a workaround for it where you set different item types then replace the 2nd, then it will work (Like your script). That might be good for the player but may confuse the AI. I had experienced crashes (1.143) upon loading a scene if an item was equipped to a troop and the secondary (itp_next_item_as_melee) item is the same type as the first.
 
Computica said:
Aye, if you have a workaround for it where you set different item types then replace the 2nd, then it will work (Like your script). That might be good for the player but may confuse the AI. I had experienced crashes (1.143) upon loading a scene if an item was equipped to a troop and the secondary (itp_next_item_as_melee) item is the same type as the first.
I'm not following, as above I set the same item types, not different.
In my understanding, the AI never switches item modes anyway, but that could definitely be a mistaken understanding.
 
Caba`drin said:
Computica said:
Aye, if you have a workaround for it where you set different item types then replace the 2nd, then it will work (Like your script). That might be good for the player but may confuse the AI. I had experienced crashes (1.143) upon loading a scene if an item was equipped to a troop and the secondary (itp_next_item_as_melee) item is the same type as the first.
I'm not following, as above I set the same item types, not different.
In my understanding, the AI never switches item modes anyway, but that could definitely be a mistaken understanding.

They switch to melee when they have a throwing weapon and enemies get close iirc.
 
Caba`drin said:
I'm not following, as above I set the same item types, not different.
In my understanding, the AI never switches item modes anyway, but that could definitely be a mistaken understanding.
The AI does change weapon modes, for instance 2-handed/Polearm. It may depend on there skill. In my own modding experience I had noticed that I was getting crashes on one of my pre 3.88 releases of SoD:W that giving the AI a weapon/item which has the same secondary (function["x"]) item type as the first (even with different stats than the first) crashed the scene upon loading though.
 
Back
Top Bottom