Right, I know how to create a basic ability like Stimpack, which applies a behavior or effect.
HOWEVER:
I don't know how to create three, which cannot be stacked and will swap to the next one.
My base plan is this:
In the command card, I'll create 3 Slots (Abilities) which each apply a different behavior enabling the corresponding weapon
Slot 1 (Single Shot) - Slot 2 (Burst) - Slot 3 (Full-Auto)
Slot 1 will be enabled by default, and will enable the Rifle (Single Shot). When someone clicks Slot 2 (Burst) or Slot 3 (Full-Auto) it will disable the Single Shot and swap to that behavior.
Hit Slot 1 = Disable Full-Auto and Burst + Enable Single
Hit Slot 2 = Disable Single and Full-Auto + Enable Burst
Hit Slot 3 = Disable Single and Burst + Enable Full-Auto
How would I do this, and each time you select each one it'll disable the other behaviors and replace with the selected one?
I'm doing this for a unit which can swap firing modes like a gun, and maybe even swap Bullet types from HP to AP or etc.
It's easy if I understand you what you want is 3 separated behaviors which each applies a single weapon, doesn't it? Just put in the Behavior: Modification + on the Weapon: Weapons Disabled + the weapon you want to be disabled while the other is enabled.
have each ability do its own set effect. the first 2 effects in the set is 2 remove behavior effects (each one removes the undesired firing style behavior) then add an apply behavior effect that applies the desired firing style behavior (IE: Burst fire).
now, you could either have the behavior give the desired weapon to the unit or have all 3 weapons on the unit and just simply enable the desired weapon (it would be easier to keep track of which weapon is firing by having all the weapons start as disabled and then enabling the desired one by the behavior <-my opinion)
so for example, Ability - Enable Burst Fire (of type effect instant) -> effect: effects+ - burst fire set
in the "burst fire set" -> effect: effects+ - remove single shot / - remove full-auto / - apply burst fire
the 2 "remove ..." effects remove the single shot and full-auto behaviors which would enable/give either the single shot weapon or the full-auto weapon and the apply burst fire would enable/give the burst fire weapon. then you just change which behaviors are removed and which one is added in different set effects for the Enable Single Shot and Enable Full-Auto abilities.
Well it sounds like you want this unit to have all 3 weapons to begin with, right? If so, I'd start by making the 3 weapons, ensuring they all work how you want them to, then give all 3 to said unit. Forgive the lack of good syntax/wording, but the logic behind it will work :) From here you are going to want 3 behaviors, and said unit should start with Behavior A on him:
Behavior A: Disables Weapon B and Weapon C
Behavior B: Disables Weapon A and Weapon C
Behavior C: Disables Weapon A and Weapon B
That should cover the Behavior setup, but we aren't done yet, we need to make some effects, we'll start with 3 remove behavior effects:
Remove Behavior A: Target Type should be source, removes Behavior A.
Remove Behavior B: Target Type should be source, removes Behavior B.
Remove Behavior C: Target Type should be source, removes Behavior C.
Next we need 3 apply behaviors, very similar:
Apply Behavior A: Target Type should be source, applies Behavior A.
Apply Behavior B: Target Type should be source, applies Behavior B.
Apply Behavior C: Target Type should be source, applies Behavior C.
Next 3 sets, should go something like this:
Set A: Remove Behavior C, Apply Behavior A
Set B: Remove Behavior A, Apply Behavior B
Set C: Remove Behavior B, Apply Behavior C
Getting close to done, but not yet, need 3 validators now:
Validator A: Unit:Source has Behavior A count 1
Validator B: Unit:Source has Behavior B count 1
Validator C: Unit:Source has Behavior C count 1
Final step, we need a switch effect, I forget the exact syntax here, but basically it goes something like:
If Validator A: Use Set B effect
If Validator B: Use Set C effect
If Validator C: Use Set A effect
Clear as mud now right? Just think about it for awhile, see what you can do, that is one way to achieve what you want, at least assuming you want your unit to start with the 3 different guns.
That's exactly what I wanted for the character, seeing as a real M4A1 has exactly that. Single, Burst, etc.
I've already made the three weapons, all with the same damage per bullet. The only thing this affects is the firing speed or projectiles launched.
This will drastically help with my survival map, as some people need Full-Auto for killing a big mass of zombies, or Single if they want to conserve ammo.
Does it matter which order the Apply Behaviors are in the Effect Set field? I think this might have been my problem.
Order is fairly important, on a second thought the set should actually be add behavior, then remove behavior to avoid any chance of the unit firing in all 3 modes for a moment. The rest is kind of up to you, I gave a working example based on how I started things off, just keep in mind if you change one part, the others may need to reflect this. My suggestion, just do it exactly as I said to start, then when you feel you understand it enough, mess with it to suit your needs, maybe you will feel the need to add a grenade launcher in the future for example.
Got stuck on the final step with the Switch Effect, trying to wrap my mind around how to do it.
I have no clue how I'm going to integrate that into the Set effects that get cast when the ability is used.
It's probably very simple, and I'm just blind at 1-AM.
Or the fact I'm in unfamiliar territory.
Thank you so much for the code so far, haven't tested it yet but it looks promising.
It'll be awesome for my Realistic Warfare mod, when I get it kicked into development.
Realistic Warfare will have realistic weapons such as that one I'm developing on now.
Actual bullets firing out of guns, and RPG weapons which move to a target point and don't follow like Seeker Missiles.
Anyways, thanks for all your help, again. I find myself more a designer than a coder, and SC2Mapster has helped out A LOT.
Not really at the editor or anything, but switch effects work much the same way as an if......else if statement. Just look in the portion where it says Effect - Cases - Effect, should be a box in the middle and an Add case button or some sort of add button. All you will need to do is click on that, set validator as Validator A and effect as Set B, then again for Validator B and Set C, and one more time for Validator C and Set A. Switch effects are really simple to use, sure you will think so too after making one or two of them. I find the validators to be more confusing at times, personally.
You will only need one ability for the long list I gave you, the initial effect will be your Switch Effect, which will in turn use the 3 validators to choose between which of the 3 sets to use, which in turn will use all the Apply Behavior/Remove Behavior Effects and of course the behaviors.
@silvermage: Go - Are you regarding to the Warbot in the Castanar Missions?
That's an easy thing to make, the behaviors basically Added a weapon to the unit.
I'm trying to have the three weapons switch firing modes, I have an Assault Rifle with Single/Burst/F-Auto made already.
I just really need help with it, due to my inept abilities with the Galaxy Editor.
Thank you for all your help Deadzergling, I've got it working and it's exactly what I needed.
I really couldn't have made this ability to the lack of skill in the Data Editor. Anyways, thanks! I hope I get better so I don't bug SC2Mapster so much.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Right, I know how to create a basic ability like Stimpack, which applies a behavior or effect. HOWEVER:
I don't know how to create three, which cannot be stacked and will swap to the next one.
My base plan is this: In the command card, I'll create 3 Slots (Abilities) which each apply a different behavior enabling the corresponding weapon Slot 1 (Single Shot) - Slot 2 (Burst) - Slot 3 (Full-Auto)
Slot 1 will be enabled by default, and will enable the Rifle (Single Shot). When someone clicks Slot 2 (Burst) or Slot 3 (Full-Auto) it will disable the Single Shot and swap to that behavior.
Hit Slot 1 = Disable Full-Auto and Burst + Enable Single
Hit Slot 2 = Disable Single and Full-Auto + Enable Burst
Hit Slot 3 = Disable Single and Burst + Enable Full-Auto
How would I do this, and each time you select each one it'll disable the other behaviors and replace with the selected one? I'm doing this for a unit which can swap firing modes like a gun, and maybe even swap Bullet types from HP to AP or etc.
It's easy if I understand you what you want is 3 separated behaviors which each applies a single weapon, doesn't it? Just put in the Behavior: Modification + on the Weapon: Weapons Disabled + the weapon you want to be disabled while the other is enabled.
Alright, made the abilities.
I have one effect which applies the weapon enable and two which remove the other weapon enablers...
It won't remove the behaviors.
Use a Remove Behavior effect (one for each of the behaviors you want in a set effect)
Could anyone give specific instructions on this?
My ability simply enabled every weapon and only the first one (Single Shot) fired. So I decided to trash it and restart.
have each ability do its own set effect. the first 2 effects in the set is 2 remove behavior effects (each one removes the undesired firing style behavior) then add an apply behavior effect that applies the desired firing style behavior (IE: Burst fire).
now, you could either have the behavior give the desired weapon to the unit or have all 3 weapons on the unit and just simply enable the desired weapon (it would be easier to keep track of which weapon is firing by having all the weapons start as disabled and then enabling the desired one by the behavior <-my opinion)
so for example, Ability - Enable Burst Fire (of type effect instant) -> effect: effects+ - burst fire set in the "burst fire set" -> effect: effects+ - remove single shot / - remove full-auto / - apply burst fire
the 2 "remove ..." effects remove the single shot and full-auto behaviors which would enable/give either the single shot weapon or the full-auto weapon and the apply burst fire would enable/give the burst fire weapon. then you just change which behaviors are removed and which one is added in different set effects for the Enable Single Shot and Enable Full-Auto abilities.
@Alnatair: Go
Well it sounds like you want this unit to have all 3 weapons to begin with, right? If so, I'd start by making the 3 weapons, ensuring they all work how you want them to, then give all 3 to said unit. Forgive the lack of good syntax/wording, but the logic behind it will work :) From here you are going to want 3 behaviors, and said unit should start with Behavior A on him:
Behavior A: Disables Weapon B and Weapon C
Behavior B: Disables Weapon A and Weapon C
Behavior C: Disables Weapon A and Weapon B
That should cover the Behavior setup, but we aren't done yet, we need to make some effects, we'll start with 3 remove behavior effects:
Remove Behavior A: Target Type should be source, removes Behavior A.
Remove Behavior B: Target Type should be source, removes Behavior B.
Remove Behavior C: Target Type should be source, removes Behavior C.
Next we need 3 apply behaviors, very similar:
Apply Behavior A: Target Type should be source, applies Behavior A.
Apply Behavior B: Target Type should be source, applies Behavior B.
Apply Behavior C: Target Type should be source, applies Behavior C.
Next 3 sets, should go something like this:
Set A: Remove Behavior C, Apply Behavior A
Set B: Remove Behavior A, Apply Behavior B
Set C: Remove Behavior B, Apply Behavior C
Getting close to done, but not yet, need 3 validators now:
Validator A: Unit:Source has Behavior A count 1
Validator B: Unit:Source has Behavior B count 1
Validator C: Unit:Source has Behavior C count 1
Final step, we need a switch effect, I forget the exact syntax here, but basically it goes something like:
If Validator A: Use Set B effect
If Validator B: Use Set C effect
If Validator C: Use Set A effect
Clear as mud now right? Just think about it for awhile, see what you can do, that is one way to achieve what you want, at least assuming you want your unit to start with the 3 different guns.
Check my data assets for a demo map made what 4 years ago and always available?
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
@Deadzergling: Go
Thanks Deadzergling.
That's exactly what I wanted for the character, seeing as a real M4A1 has exactly that. Single, Burst, etc. I've already made the three weapons, all with the same damage per bullet. The only thing this affects is the firing speed or projectiles launched.
This will drastically help with my survival map, as some people need Full-Auto for killing a big mass of zombies, or Single if they want to conserve ammo.
Does it matter which order the Apply Behaviors are in the Effect Set field? I think this might have been my problem.
@Alnatair: Go
Order is fairly important, on a second thought the set should actually be add behavior, then remove behavior to avoid any chance of the unit firing in all 3 modes for a moment. The rest is kind of up to you, I gave a working example based on how I started things off, just keep in mind if you change one part, the others may need to reflect this. My suggestion, just do it exactly as I said to start, then when you feel you understand it enough, mess with it to suit your needs, maybe you will feel the need to add a grenade launcher in the future for example.
Got stuck on the final step with the Switch Effect, trying to wrap my mind around how to do it. I have no clue how I'm going to integrate that into the Set effects that get cast when the ability is used.
It's probably very simple, and I'm just blind at 1-AM. Or the fact I'm in unfamiliar territory.
Thank you so much for the code so far, haven't tested it yet but it looks promising.
It'll be awesome for my Realistic Warfare mod, when I get it kicked into development.
Realistic Warfare will have realistic weapons such as that one I'm developing on now. Actual bullets firing out of guns, and RPG weapons which move to a target point and don't follow like Seeker Missiles.
Anyways, thanks for all your help, again. I find myself more a designer than a coder, and SC2Mapster has helped out A LOT.
I have no clue how to make the Switch effect Cases. Or how I'd use it with the Effect Sets.
Also, do I just make a Stimpack kind of ability which applies the Effect Sets?
Could I have some more help if anyone doesn't mind?
@Alnatair: Go
Not really at the editor or anything, but switch effects work much the same way as an if......else if statement. Just look in the portion where it says Effect - Cases - Effect, should be a box in the middle and an Add case button or some sort of add button. All you will need to do is click on that, set validator as Validator A and effect as Set B, then again for Validator B and Set C, and one more time for Validator C and Set A. Switch effects are really simple to use, sure you will think so too after making one or two of them. I find the validators to be more confusing at times, personally.
Alright, made the Switch effect.
Now I just need to know how to apply it.
When I said:
I mean just a simple Apply behavior ability. I don't know how I'm going to make all the effects apply into three abilities.
I mean, is it going to be one ability which just cycles through fire-modes, or three different abilities?
I must be doing this entire Galaxy Editor map wrong, I don't even know how many abilities I'll need! Haha.
@Alnatair: Go
You will only need one ability for the long list I gave you, the initial effect will be your Switch Effect, which will in turn use the 3 validators to choose between which of the 3 sets to use, which in turn will use all the Apply Behavior/Remove Behavior Effects and of course the behaviors.
In addition to that, there is already a unit in the game that does this *what the OP is asking for) in the WoL campaign.
@silvermage: Go - Are you regarding to the Warbot in the Castanar Missions? That's an easy thing to make, the behaviors basically Added a weapon to the unit. I'm trying to have the three weapons switch firing modes, I have an Assault Rifle with Single/Burst/F-Auto made already. I just really need help with it, due to my inept abilities with the Galaxy Editor.
Thank you for all your help Deadzergling, I've got it working and it's exactly what I needed.
I really couldn't have made this ability to the lack of skill in the Data Editor. Anyways, thanks! I hope I get better so I don't bug SC2Mapster so much.