Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 XML Customization » How can I create new ammo ?
How can I create new ammo ?[message #361847] Sun, 15 November 2020 06:20 Go to next message
Kitty

 
Messages:505
Registered:October 2017
Location: Germany
Is there any up-to-date guide on how to create new ammo?

What I'm looking for:


- Ammotypes.xml has a bunch of flags, where I'm not sure if they even exist anymore. E.g., some stuff has flags for poison (poison percentage, etc), but the poison-system doesn't exist anymore (replaced by disease?)


- how can I connect an ammotype with animation in Tilecache ? I'm thinking of something like the flamethrower or incenary-shotgun-ammo in UC ? Where can this be defined ?


- how are items.xml, ammotypes.xml, ammostrings.xml are connected to each other ? Like, ui-index in this is refering to xyz in that.


I guess, it's somehow simular to how explosives are defined, but so far I fail to see the interactions for ammo. So, any advice or hint would be great.



How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

First Sergeant
Re: How can I create new ammo ?[message #361849 is a reply to message #361847] Sun, 15 November 2020 09:46 Go to previous messageGo to next message
Deleted.

 
Messages:2634
Registered:December 2012
Location: Russian Federation
Kitty wrote on Sun, 15 November 2020 09:20
- Ammotypes.xml has a bunch of flags, where I'm not sure if they even exist anymore. E.g., some stuff has flags for poison (poison percentage, etc), but the poison-system doesn't exist anymore (replaced by disease?)
From Weapons.h
// -------- added by Flugente: various ammo flags --------
// flags used for various ammo properties (easier than adding 32 differently named variables). DO NOT CHANGE THEM, UNLESS YOU KNOW WHAT YOU ARE DOING!!!
#define AMMO_CRYO			0x00000001	//1			// this ammo shock-freezes target
#define AMMO_BLIND			0x00000002	//2			// this ammo will blind if it hits the head
#define AMMO_ANTIMATERIEL		0x00000004	//4			// this ammo is anti-materiel, bullets can destroy structures

Quote:
- how can I connect an ammotype with animation in Tilecache ? I'm thinking of something like the flamethrower or incenary-shotgun-ammo in UC ? Where can this be defined ?
You cannot, it's hardcoded.
From bullets.cpp:
if ( pBullet->usFlags & ( BULLET_FLAG_MISSILE | BULLET_FLAG_TANK_CANNON ) )
	{
		strcpy( AniParams.zCachedFile, "TILECACHE\\MSLE_SMK.STI" );
	}
	else if ( pBullet->usFlags & ( BULLET_FLAG_SMALL_MISSILE ) )
	{
		strcpy( AniParams.zCachedFile, "TILECACHE\\MSLE_SMA.STI" );
	}
	else if ( pBullet->usFlags & ( BULLET_FLAG_CREATURE_SPIT ) )
	{
		strcpy( AniParams.zCachedFile, "TILECACHE\\MSLE_SPT.STI" );
	}
	else if ( pBullet->usFlags & ( BULLET_FLAG_FLAME ) )
	{
		strcpy( AniParams.zCachedFile, "TILECACHE\\FLMTHR2.STI" );
		AniParams.sDelay							= (INT16)( 100 );
	}
Where flags defined depending on weapon and ammo:
// Check if we have spit as a weapon!
if ( Weapon[ usHandItem ].ubWeaponClass == MONSTERCLASS )
{
	usBulletFlags |= BULLET_FLAG_CREATURE_SPIT;
}
else if ( Item[ usHandItem ].usItemClass == IC_THROWING_KNIFE )
{
	usBulletFlags |= BULLET_FLAG_KNIFE;
}
else if ( Item[usHandItem].rocketlauncher )
{
	usBulletFlags |= BULLET_FLAG_MISSILE;
}
else if ( Item[usHandItem].cannon )
{
	usBulletFlags |= BULLET_FLAG_TANK_CANNON;
}
else if ( Item[usHandItem].rocketrifle )
{
	usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
}
else if ( usHandItem == FLAMETHROWER )
{
	usBulletFlags |= BULLET_FLAG_FLAME;
	ubSpreadIndex = 2;
}
Flame animation is hardcoded to item 63, this was fixed in VR and +AI to use flame ammo instead, but not in the unstable.
//else if ( usHandItem == FLAMETHROWER )
// sevenfm: check for flame caliber instead
else if ( Weapon[Item[usHandItem].ubClassIndex].ubCalibre == AMMOFLAME  )

And tracer ammo has light.

Quote:
- how are items.xml, ammotypes.xml, ammostrings.xml are connected to each other ? Like, ui-index in this is refering to xyz in that.
As far as I remember, magazines in Items.xml are connected to Magazines.xml using <ubClassIndex> which defines <ubCalibre> (AmmoStrings.xml) and <ubAmmoType> (AmmoTypes.xml).
<ubMagType> defines mag type - magazine, bullet, box or crate:
AMMO_MAGAZINE = 0,
AMMO_BULLET,
AMMO_BOX,
AMMO_CRATE



Left this community.

Report message to a moderator

Lieutenant

Re: How can I create new ammo ?[message #361851 is a reply to message #361849] Sun, 15 November 2020 17:49 Go to previous messageGo to next message
Kurt is currently offline Kurt

 
Messages:423
Registered:March 2004
Which definition points where - Not knowing what you're actually wanting to do it might be completely off topic, but it still might help somebody:

Here is what you need to create a new magazine. To create a new ammo or ammo type, just add the necessary entries in the corresponding files (and don't forget to create the new magazines and crates!):

Magazine in Items.xml:
Toggle Spoiler

Magazine definition in Magazines.xml:
Toggle Spoiler


Carthago delenda est Of course with a working XML Editor, this would all be so easy... cheeky

Report message to a moderator

Master Sergeant
Re: How can I create new ammo ?[message #361853 is a reply to message #361851] Sun, 15 November 2020 18:40 Go to previous messageGo to next message
Deleted.

 
Messages:2634
Registered:December 2012
Location: Russian Federation
Kurt wrote on Sun, 15 November 2020 20:49
<ubMagType>0</ubMagType> <!-- Magazine type, points to MagazineType.xml -->
Minor clarification: MagazineType.xml and other files in Lookup folder are not used in the game code, they are for XML Editor only to show some values in human friendly form.



Left this community.

Report message to a moderator

Lieutenant

Re: How can I create new ammo ?[message #361874 is a reply to message #361849] Mon, 16 November 2020 20:15 Go to previous message
Kitty

 
Messages:505
Registered:October 2017
Location: Germany
sevenfm wrote on Sun, 15 November 2020 09:46
... From Weapons.h ... From bullets.cpp ...

To see if have grasped the principal idea, I tried to activate the Flamethrower (and it's ammo) - and it worked happy

Thanks for those informations.



How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

First Sergeant
Previous Topic: Strange entries in Items.xml
Next Topic: What does <sBackpackWeightModifier> do?
Goto Forum:
  


Current Time: Fri Jun 12 02:42:54 GMT+3 2026

Total time taken to generate the page: 0.00631 seconds