Hi all. Making a single-player mission at the moment, but running into some (probably basic) issues that searching the forums did not seem to yield any answers to.
1. Weapon attacks consumes energy. I have a feeling I am over-looking something simple. What I have tried is to set the unit's energy leech to -1, but it seems to scale with weapon damage. What I want is for each attack to consume 1 energy.
2. Switching attack modes. The unit's default attack is meant to act like an automatic weapon. I want to make an ability to emulate semi-automatic weapon fire. Able to toggle it on and off. When in semi-automatic mode: damage goes up, fire rate goes down, energy consumption is still 1 energy per shot.
3. Implementing critical strikes. Have seen a few methods, but taking in mind that the above stance might also increase critical %, what ways would you recommend to implement it?
what you'd want for that "fire mode" is to apply a behavior to the unit, choose the "buff" setup for the behavior. These behaviors can alter everything you described. You may need a seperate behavior for the "crit", you can alter the chance that these behaviors take effect so reducing it from 100% will make it a random event.
In order to prevent firing I'd suggest looking into validators. These are conditions that functions have to meet in order to fire. I believe there are some pre made validators that check to see if a units energy is at a certain percentage, look at these and i think you can figure out how to make it >=1, at the very least you can check to make sure energy is >0 which should work since you're only charging 1 energy.
Isn't there a "cost" field somewhere in the weapon or effect tab? Set energy to 1 there and it will most probably drain 1 energy per shot... Not sure whether that field is there though, dont have the editor open right now...
For the multiple weapons thing... you'll need to make an ability that applies a behavior, and a behavior at which under the modifications field you go to "weapons", add a weapon to the "weapon" field, and add the weapon your character is using normally to the "Weapons - disabled" field. This will add the weapon and disable the previous weapon. You'll also have to set the commands of the ability so taht you can turn it off. dont know how to do that exactly, just open the ghost - cloak ability and see how that one does it.
I only have time for the energy requirement - I'll take a look into the others when I get back in a little while (provided they haven't been answered).
Here's how you do the archon energy requirement:
First off, give your archon energy.
Then, go into the effects tab and create two new effects: 1) ArchonSet - Effect Type: Set and 2) ArchonModify - Effect Type: Modify Unit
In ArchonSet, go into Effects and add both ArchonModify and Archon - Psionic Shockwave (Damage).
Then, in ArchonModify, change the amount of energy in Effect - Vitals + to -X, with X being the number of energy you want each attack to cost. In addition, change Target - Impact Unit + to Source. Note that you have to make the value -X, as any positive value will increase the Archon's energy reserves.
Next, go into the Validators tab and create a new Validator called MustHaveEnergy of type UnitCompareVital.
In MustHaveEnergy, change Validator - Compare to Greater Than, change Validator - Failure Result and Validator - Result - Failure to NotEnoughEnergy. In addition, change Validator - Unit + to Source, and Validator - Vital to Energy.
Go back to ArchonSet. Change Effects - Validators to MustHaveEnergy.
Finally, go to your Psionic Shockwave weapon and change Effect - Effect to ArchonSet.
Provided I didn't miss anything, that should do it.
Again, I'll take a look at the other two things if nobody else has figured them out by the time I get back.
To implement an energy cost to your attack you need a "Modify Unit" effect. In "Effect - Vitals +" set the Energy/Change box to -1 (not the Energy/Change Fraction, this would remove 1*the units maximum energy, ie all of it) and the "Target - Impact Unit +" to "Source".
Then create a "Unit Compare Vital" validator with "Validator - Compare" set to "Greater Than Or Equal To", "Validator - Unit +" set to "Caster", "Validator - Value" set to 50 and "Validator - Vital" set to "Energy".
Then create a "Set" effect which triggers both the "Modify Unit" and "Damage" or "Launch Missile" effect, depending on which you are using. Give this set the validator you just created.
As for switching between attack types, my guess would be to have 'automatic weapon' and 'semi-automatic weapon' behaviours. Create a validator which detects 'semi-automatic weapon' ("Unit Compare Behaviour Count"). Create a "Persistent" effect with a very short interval, with the "Set" effect you made before in the "Effect - Periodic" field. Then create a "Switch" effect with the first case having the "Unit Compare Behaviour Count" validator and the "Persistent" effect and the second case having no validator and the "Set" effect. Then simply make the unit's weapon's attack effect be the "Switch" effect.
I hope that all makes sense. You may need to play around with the switch as I've not used them before, but they seem straightforward enough.
The modify effect works perfectly for the energy consumption. Now just need to tweak the numbers so that the weapon do not run out of energy to fire too quickly.
Is there a need to create a new weapon to emulate the semi-automatic stance? Or just somehow modify attack speed/damage/range with effect/persistent?
No luck yet with the stance, though I ran into another issue. I have an ability to recharge all the energy of the unit, with a cool down of 60 seconds. It shows properly on the ability tool tip, but I can keep using the ability.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi all. Making a single-player mission at the moment, but running into some (probably basic) issues that searching the forums did not seem to yield any answers to.
1. Weapon attacks consumes energy. I have a feeling I am over-looking something simple. What I have tried is to set the unit's energy leech to -1, but it seems to scale with weapon damage. What I want is for each attack to consume 1 energy.
2. Switching attack modes. The unit's default attack is meant to act like an automatic weapon. I want to make an ability to emulate semi-automatic weapon fire. Able to toggle it on and off. When in semi-automatic mode: damage goes up, fire rate goes down, energy consumption is still 1 energy per shot.
3. Implementing critical strikes. Have seen a few methods, but taking in mind that the above stance might also increase critical %, what ways would you recommend to implement it?
Bumping here.
And just to add on, when at 0 energy, the unit would not be able to attack.
what you'd want for that "fire mode" is to apply a behavior to the unit, choose the "buff" setup for the behavior. These behaviors can alter everything you described. You may need a seperate behavior for the "crit", you can alter the chance that these behaviors take effect so reducing it from 100% will make it a random event.
In order to prevent firing I'd suggest looking into validators. These are conditions that functions have to meet in order to fire. I believe there are some pre made validators that check to see if a units energy is at a certain percentage, look at these and i think you can figure out how to make it >=1, at the very least you can check to make sure energy is >0 which should work since you're only charging 1 energy.
Isn't there a "cost" field somewhere in the weapon or effect tab? Set energy to 1 there and it will most probably drain 1 energy per shot... Not sure whether that field is there though, dont have the editor open right now...
For the multiple weapons thing... you'll need to make an ability that applies a behavior, and a behavior at which under the modifications field you go to "weapons", add a weapon to the "weapon" field, and add the weapon your character is using normally to the "Weapons - disabled" field. This will add the weapon and disable the previous weapon. You'll also have to set the commands of the ability so taht you can turn it off. dont know how to do that exactly, just open the ghost - cloak ability and see how that one does it.
cant help with 3rd
I only have time for the energy requirement - I'll take a look into the others when I get back in a little while (provided they haven't been answered).
Here's how you do the archon energy requirement:
Provided I didn't miss anything, that should do it.
Again, I'll take a look at the other two things if nobody else has figured them out by the time I get back.
Regards,
-Beast
@Weissritter19: Go
To implement an energy cost to your attack you need a "Modify Unit" effect. In "Effect - Vitals +" set the Energy/Change box to -1 (not the Energy/Change Fraction, this would remove 1*the units maximum energy, ie all of it) and the "Target - Impact Unit +" to "Source".
Then create a "Unit Compare Vital" validator with "Validator - Compare" set to "Greater Than Or Equal To", "Validator - Unit +" set to "Caster", "Validator - Value" set to 50 and "Validator - Vital" set to "Energy".
Then create a "Set" effect which triggers both the "Modify Unit" and "Damage" or "Launch Missile" effect, depending on which you are using. Give this set the validator you just created.
As for switching between attack types, my guess would be to have 'automatic weapon' and 'semi-automatic weapon' behaviours. Create a validator which detects 'semi-automatic weapon' ("Unit Compare Behaviour Count"). Create a "Persistent" effect with a very short interval, with the "Set" effect you made before in the "Effect - Periodic" field. Then create a "Switch" effect with the first case having the "Unit Compare Behaviour Count" validator and the "Persistent" effect and the second case having no validator and the "Set" effect. Then simply make the unit's weapon's attack effect be the "Switch" effect.
I hope that all makes sense. You may need to play around with the switch as I've not used them before, but they seem straightforward enough.
Thanks for the replies! Will try them out and get back to you guys.
The modify effect works perfectly for the energy consumption. Now just need to tweak the numbers so that the weapon do not run out of energy to fire too quickly.
Is there a need to create a new weapon to emulate the semi-automatic stance? Or just somehow modify attack speed/damage/range with effect/persistent?
No luck yet with the stance, though I ran into another issue. I have an ability to recharge all the energy of the unit, with a cool down of 60 seconds. It shows properly on the ability tool tip, but I can keep using the ability.