Worms 4 Tweaking

Le tweaking ou comment créer ses armes au delà de l'usine d'armes
 
AccueilPortailFAQRechercherS'enregistrerMembresGroupesConnexion

Partagez | 
 

 2 - Clusters

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
_Kilburn
Admin
avatar

Nombre de messages : 1133
Age : 26
Localisation : data\\Tweak\\
Date d'inscription : 25/05/2006

MessageSujet: 2 - Clusters   Ven 14 Mar - 20:04

The way clusters are defined in Worms 4: Mayhem is mainly what makes tweaking so powerful. With it, you can simulate nearly anything you want, from simple clusters to nice fireworks effects, the "explosive bounciness" effect from the 2D Worms series, or even fire and earthquakes with more experience.

Basic explanation

For this explanation, we will use kWeaponClusterGrenade, which is the weapon data for the Cluster Bomb. Search "kWeaponClusterGrenade" until you get to this part:

Code:
    <XContainerResourceDetails id='kWeaponClusterGrenade'>
      <Value href='kWeaponClusterGrenade-0'/>
      <Name>kWeaponClusterGrenade</Name>
      <Flags>81</Flags>
    </XContainerResourceDetails>
    <PayloadWeaponPropertiesContainer id='kWeaponClusterGrenade-0'>
      <IsAimedWeapon>true</IsAimedWeapon>
      <IsPoweredWeapon>true</IsPoweredWeapon>
      <IsTargetingWeapon>false</IsTargetingWeapon>
      <IsControlledBomber>false</IsControlledBomber>
      <IsBomberWeapon>false</IsBomberWeapon>
      <IsDirectionalWeapon>true</IsDirectionalWeapon>

Scroll down until you get to this:

Code:
      <NumBomblets>4</NumBomblets>
      <BombletMaxConeAngle>0.28</BombletMaxConeAngle>
      <BombletMaxSpeed>0.24</BombletMaxSpeed>
      <BombletMinSpeed>0.12</BombletMinSpeed>
      <BombletWeaponName>kWeaponClusterBomb</BombletWeaponName>

This is probably pretty easy to understand, NumBomblets is the number of clusters, BombletMaxConeAngle is the maximum angle (in radians, remember) within which the clusters will spread, BombletMaxSpeed and BombletMinSpeed are respectively the maximum and minimum velocity they can get.
The most interesting property is BombletWeaponName. Scroll up until you get to this (and don't get confused between kWeaponClusterGrenade and kWeaponClusterBomb!)

Code:
    <XContainerResourceDetails id='kWeaponClusterBomb'>
      <Value href='kWeaponClusterBomb-0'/>
      <Name>kWeaponClusterBomb</Name>
      <Flags>81</Flags>
    </XContainerResourceDetails>
    <PayloadWeaponPropertiesContainer id='kWeaponClusterBomb-0'>
      <IsAimedWeapon>false</IsAimedWeapon>
      <IsPoweredWeapon>false</IsPoweredWeapon>
      <IsTargetingWeapon>false</IsTargetingWeapon>
      <IsControlledBomber>false</IsControlledBomber>
      <IsBomberWeapon>false</IsBomberWeapon>
      <IsDirectionalWeapon>false</IsDirectionalWeapon>

This is the weapon data for the clusters of the Cluster Bomb.
Looks like a weapon, just like kWeaponBazooka or kWeaponClusterGrenade. Because it is a weapon. It does not appear in the inventory, but it is a weapon anyway, and this is the reason why tweaking is so powerful. Because you can create as many weapons as you want in WeapTwk.xml, which can't be added into the inventory, but can still be used as clusters. Any weapon can be used as a cluster of another weapon.

For instance, go back to kWeaponClusterGrenade, and set its BombletWeaponName to kWeaponHolyGrenade. Run the game, and enjoy!

Any weapon can be used as a cluster, and you can even make a weapon cluster into itself (in this case, setting BombletWeaponName to kWeaponClusterGrenade).
The only limitation is that you can't set melee weapons as clusters (you don't want to do that anyway), same for guns (shotgun, sniper rifle) and sentry guns. Animals will lose their walking or flying ability, and homing missiles will lose their homing ability.


Now for more advanced stuff.

Creating clusters

You need some knowledge about how XML object models work. If you haven't read the tutorial about Understanding XOM, try to read it. If you can hardly understand anything, here is a simpler explanation of what you need.

Each weapon must have the following structure:

1: A declaration in the XDatabank, near the beginning of the file:

Code:
      ...
      <ContainerResources href='kWeaponSentryGunPayload'/>
      <ContainerResources href='kWeaponSheep'/>
      <ContainerResources href='kWeaponShotgun'/>
      <ContainerResources href='kWeaponSniperRifle'/>
      <ContainerResources href='kWeaponStarburst'/>
      <ContainerResources href='kWeaponSuperAirstrike'/>
      <ContainerResources href='kWeaponSuperSheep'/>
     
-----> Declaration goes here
     
      <ColorResources href='Payload.FuseTimerInitialColor'/>

Let's say you want to call your cluster kWeaponMyCluster. The declaration will be:

Code:
<ContainerResources href='kWeaponMyCluster'/>

Pretty simple, isn't it? This declaration is necessary so the game loads the actual cluster.
kWeapon is a naming convention, you don't have to add it to the name of your weapon, but it is recommended anyway for practical reasons.

2: A XContainerResourceDetails block. You can put it wherever you want but it is recommended to insert it near the end of the file, before </xomObjects> so you can find it again later.

Code:
    <XColorResourceDetails id='Payload.FuseTimerUrgentColor'>
      <Value r='255' g='255' b='255' a='255' />
      <Name>Payload.FuseTimerUrgentColor</Name>
      <Flags>64</Flags>
    </XColorResourceDetails>

---> XContainerResourceDetails block goes here

  </xomObjects>
</xomArchive>

The actual structure of a XContainerResourceDetails block is:

Code:
    <XContainerResourceDetails id='NAME'>
      <Value href='NAME-0'/>
      <Name>NAME</Name>
      <Flags>81</Flags>
    </XContainerResourceDetails>

Just replace NAME by the name of your weapon, kWeaponMyCluster for this example. The property Flags should never be changed. Don't forget to add "-0" to the name in the Value tag.

3: A PayloadWeaponPropertiesContainer, right after your XContainerResourceDetails block. Its structure should be:

Code:
    <PayloadWeaponPropertiesContainer id='NAME-0'>
      (properties)
    </PayloadWeaponPropertiesContainer>

Instead of writing the XContainerResourceDetails and the PayloadWeaponPropertiesContainer, you can copy them from any payload weapon (Bazooka, Grenade, Cluster Bomb, etc...) and just change the names, and the properties you want.

And there you go, you have created your own cluster and you can use it in any weapon by setting its BombletWeaponName to the name of your cluster (kWeaponMyCluster).

_________________
Windows did not detect any keyboard. Press Enter to continue...
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://w4-tweaking.bb-fr.com
 
2 - Clusters
Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Worms 4 Tweaking :: ENGLISH Section :: ENGLISH Section :: Tweaking Tutorials and Support :: WeapTwk.xml Tutorials-
Sauter vers: