This library is intended to create a custom weapon and projectile system similar to the one seen in the map Xeno Crisis.
It is intended to work with a single unit for each player, though you may be able to change this with some clever modifications.
This is most suitable for moderate to advanced game designers.
DEMONSTRATION
Skip to 4:10 -
COMPONENTS
This library requires several data components working in tandem.
First, you will need a unit who will fire a weapon.
Second, you will need weapons.
Third, you will need projectiles.
Fourth, you will need a Reload buff.
Fifth, you will need a Hidden Target unit.
SETUP
This will help you set up the library for use with a simple semi-auto pistol weapon.
Use the Setup trigger in the example map for reference.
1. Copy the following Data objects from the example map:
NOTE: You can now load these into your map by adding the XC Combat System dependency.
NOTE: If the data objects do not link properly, refer to the example map to see how everything should fit together.
2. In the Data editor, find the unit you wish to use as the main shooter for the player. In the example map, I chose the Ghost.
Remove all weapons from the unit and add Standard Pistol (Missile). Also change Behavior: Response to "No Response" and Combat: Default Acquire Level to "Passive."
3. Import the library into your map. If you do this before adding the data objects, some things may not link up properly, which may cause errors.
4. Place the shooter unit on the map for the player. Also place 1 HiddenTarget unit for the player somewhere on the map. This unit is invisible, so don't be alarmed when nothing appears after you place the unit.
5. Create a Setup trigger as in the example map, changing the parameters as necessary:
------- Setup------- Events------- Game - Map initialization------- Local Variables------- Conditions------- Actions------- XCCS Assign Reload Buff(Reloading)------- XCCS Assign Reload Sound(1, 250mmStrikeCannonsUnMorph)------- XCCS Assign Shooter(Ghost [19.45, 27.34])------- XCCS Assign Weapon Type(0, Standard Pistol (Missile))------- XCCS Assign Projectile Type(0, SmallBullet)------- XCCS Assign Initial Clip Ammo(21, 10.0)------- Trigger - Run BulletProjectileSet (Check Conditions, Don't Wait until it finishes)
6. Test the map. If set up properly, attacking anywhere on the ground should cause your shooter unit to fire projectiles in that direction.
Adding additional weapons and weapon types is a bit more difficult and is beyond the scope of this guide. Keep an eye on this thread for additional information.
Very nice! I hope that Blizzard will improve the item system, so almost no triggers will be needed for make this weapons works.
Also with ZypheRZO library's, you can add or substract charge directly on the item in the inventory. It is very useful when you have many units with reloading weapon (Else there could be too many floating numbers).
One question, Why are you using tech tree at the place of simple requirements? For example, if you have 2 ghosts with the same weapon, the tech tree will work for all the ghosts, but with simple requirements you can easily activate or deactivate a weapon. I mean by requirement a behavior that add a weapon to the unit and that behavior is verified with a requirement (Blizzard haven't add a requirement slot for weapons...).
One question, Why are you using tech tree at the place of simple requirements? For example, if you have 2 ghosts with the same weapon, the tech tree will work for all the ghosts, but with simple requirements you can easily activate or deactivate a weapon. I mean by requirement a behavior that add a weapon to the unit and that behavior is verified with a requirement (Blizzard haven't add a requirement slot for weapons...).
I'm not sure what you mean by using the tech tree. It doesn't really matter, as far as the library is concerned, how the shooter gets the weapon, only that the shooter has the weapon. Changing weapons using requirements is certainly a valid option, as is modifying weapons using triggers. I changed the weapon via the data editor because it seemed the simplest way of explaining that step, but any other way would work just as well! :)
Quick update. I've published a mod entitled XC Combat System which can be loaded into your map via dependencies. This will automatically load the data elements mentioned in the SETUP section.
This is a work in progress...
XC Combat System
By BasharTeg
Version 0.1
INFORMATION
This library is intended to create a custom weapon and projectile system similar to the one seen in the map Xeno Crisis.
It is intended to work with a single unit for each player, though you may be able to change this with some clever modifications.
This is most suitable for moderate to advanced game designers.
DEMONSTRATION
Skip to 4:10 -
COMPONENTS
This library requires several data components working in tandem.
First, you will need a unit who will fire a weapon.
Second, you will need weapons.
Third, you will need projectiles.
Fourth, you will need a Reload buff.
Fifth, you will need a Hidden Target unit.
SETUP
This will help you set up the library for use with a simple semi-auto pistol weapon.
Use the Setup trigger in the example map for reference.
1. Copy the following Data objects from the example map:
NOTE: You can now load these into your map by adding the XC Combat System dependency.
- Units: HiddenTarget, SmallBullet
- Actors: HiddenTarget, SmallBullet
- Effects: ApplySBSpawn, DestroyBullet, Dummy, SBWeaponFX, SmallBulletDamage, SmallBulletImpact, SmallBulletSearch
- Behaviors: Spawn Small Bullet, SmallBulletSearcher, Reloading, BulletTimedLife
- Weapons: Standard Pistol (Missile)
NOTE: If the data objects do not link properly, refer to the example map to see how everything should fit together.
2. In the Data editor, find the unit you wish to use as the main shooter for the player. In the example map, I chose the Ghost.
Remove all weapons from the unit and add Standard Pistol (Missile). Also change Behavior: Response to "No Response" and Combat: Default Acquire Level to "Passive."
3. Import the library into your map. If you do this before adding the data objects, some things may not link up properly, which may cause errors.
4. Place the shooter unit on the map for the player. Also place 1 HiddenTarget unit for the player somewhere on the map. This unit is invisible, so don't be alarmed when nothing appears after you place the unit.
5. Create a Setup trigger as in the example map, changing the parameters as necessary:
6. Test the map. If set up properly, attacking anywhere on the ground should cause your shooter unit to fire projectiles in that direction.
Adding additional weapons and weapon types is a bit more difficult and is beyond the scope of this guide. Keep an eye on this thread for additional information.
Reserved for advanced tutorials
Very nice! I hope that Blizzard will improve the item system, so almost no triggers will be needed for make this weapons works.
Also with ZypheRZO library's, you can add or substract charge directly on the item in the inventory. It is very useful when you have many units with reloading weapon (Else there could be too many floating numbers).
One question, Why are you using tech tree at the place of simple requirements? For example, if you have 2 ghosts with the same weapon, the tech tree will work for all the ghosts, but with simple requirements you can easily activate or deactivate a weapon. I mean by requirement a behavior that add a weapon to the unit and that behavior is verified with a requirement (Blizzard haven't add a requirement slot for weapons...).
I'm not sure what you mean by using the tech tree. It doesn't really matter, as far as the library is concerned, how the shooter gets the weapon, only that the shooter has the weapon. Changing weapons using requirements is certainly a valid option, as is modifying weapons using triggers. I changed the weapon via the data editor because it seemed the simplest way of explaining that step, but any other way would work just as well! :)
Quick update. I've published a mod entitled XC Combat System which can be loaded into your map via dependencies. This will automatically load the data elements mentioned in the SETUP section.
It's just that I was asking myself about tech tree :)