I'm sure this is asked a lot, but I cant find anything quite what I need help with. I watched some tutorials but most of them were tower defense tutorials and not that helpful..so.. My problem is switching a units attack damage/attack animation/type based on the weapon equipped. It sounds simple and it probably is but I can't get it to work... What I am trying to do is swap out a basic marines rifle with a flamethrower... but the flamethrower has to deal constant damage instead of the hellions burst thingy. with this as a template I could do the same thing but with a lazer gun for him. I have seen a lot of people struggling with getting the fire animation working, I got it to work but I don't really understand how I did it. can someone point me to a tutorial for this kind of problem?
A unit object has a weapon object which controls how it attacks.
Weapon objects trigger an effect object, which can often lead into a chain of other effects.
The Marine Gauss Rifle for example, does straight 6 damage every 0.86 seconds.
The Stalker Entropy Lance, another example, launches a missile which does x damage and a bonus vs armoured.
A Terran Missile turret, again, triggers a create persistent, which launches two missiles, both dealing x damage against a target.
The Marauder Punisher Grenades do a launch missile effect which triggers a set. This set contains the damage which is always applied, but it also contains an Apply Behaviour effect, which applies the Slow effect to units, but this Apply Behaviour requires the validator (upgrade) to return True before it is 'activated'.
How the missiles move is controlled by the Mover object assigned to them. Missiles are a Unit>Projectile subtype.
Action actors control how the missile behaves, where it launches from, what happens when it impacts etc. Your action action must reference the impact (usually damage) and launch (usually launch missile) effects used by your weapon.
You require another actor for the actual missile too, and for this to also be referenced by the action actor.
That's it in a nutshell.
I advise looking at objects from the melee and campaign dependency to figure out how they work before creating your own custom weapons.
Flamethrowers usually use a Beam (Simple) that targets a Site (Mover) that follows the persistent for the visuals or in the case of the firebat uses a flame launch model. Most of this stuff goes via an Action actor, these determine the missile/beam launch and impact loacations and visuals
What damage the weapon shows is under the UI - Damage Display Effect field of the Weapons data type.
Easiest way to swap weapons is using a Buff behaviour because they can add weapons like the warbot in the campaign. Having the weapon being removed by removing the buff looks better than just disabling the weapon. Here is an old demo map showing how.
Under the events for the Unit type actor you find some that trigger on Weapon Start which are used to play certain Animation Bracket Starts. You can add new ones that are weapon specific if you want the unit to play a specific non default attack animation.
I'm sure this is asked a lot, but I cant find anything quite what I need help with. I watched some tutorials but most of them were tower defense tutorials and not that helpful..so.. My problem is switching a units attack damage/attack animation/type based on the weapon equipped. It sounds simple and it probably is but I can't get it to work... What I am trying to do is swap out a basic marines rifle with a flamethrower... but the flamethrower has to deal constant damage instead of the hellions burst thingy. with this as a template I could do the same thing but with a lazer gun for him. I have seen a lot of people struggling with getting the fire animation working, I got it to work but I don't really understand how I did it. can someone point me to a tutorial for this kind of problem?
@Turtlelink2: Go
A unit object has a weapon object which controls how it attacks.
Weapon objects trigger an effect object, which can often lead into a chain of other effects.
The Marine Gauss Rifle for example, does straight 6 damage every 0.86 seconds.
The Stalker Entropy Lance, another example, launches a missile which does x damage and a bonus vs armoured.
A Terran Missile turret, again, triggers a create persistent, which launches two missiles, both dealing x damage against a target.
The Marauder Punisher Grenades do a launch missile effect which triggers a set. This set contains the damage which is always applied, but it also contains an Apply Behaviour effect, which applies the Slow effect to units, but this Apply Behaviour requires the validator (upgrade) to return True before it is 'activated'.
How the missiles move is controlled by the Mover object assigned to them. Missiles are a Unit>Projectile subtype.
Action actors control how the missile behaves, where it launches from, what happens when it impacts etc. Your action action must reference the impact (usually damage) and launch (usually launch missile) effects used by your weapon.
You require another actor for the actual missile too, and for this to also be referenced by the action actor.
That's it in a nutshell.
I advise looking at objects from the melee and campaign dependency to figure out how they work before creating your own custom weapons.
Flamethrowers usually use a Beam (Simple) that targets a Site (Mover) that follows the persistent for the visuals or in the case of the firebat uses a flame launch model. Most of this stuff goes via an Action actor, these determine the missile/beam launch and impact loacations and visuals
What damage the weapon shows is under the UI - Damage Display Effect field of the Weapons data type.
Easiest way to swap weapons is using a Buff behaviour because they can add weapons like the warbot in the campaign. Having the weapon being removed by removing the buff looks better than just disabling the weapon. Here is an old demo map showing how.
Under the events for the Unit type actor you find some that trigger on Weapon Start which are used to play certain Animation Bracket Starts. You can add new ones that are weapon specific if you want the unit to play a specific non default attack animation.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg