• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Firing 2 weapons simultaneously, attribute update problem

Status
Not open for further replies.
Level 5
Joined
Aug 27, 2010
Messages
79
1.
Is it possible for a unit to have 2 weapons that share same range and targets??

What i want is, a unit has 2 weapons, a gun and a missile launcher, missile launcher has a long period so when is recharging the unit must use gun.
i added a timed buff equal to period of missile launcher which disable it. but i couldnt change the time scaled based on change in attack speed.


2.
4 stat points are aquired every level, these stat points can be assigned to 3 attributes. assigning is done through abilities that apply buff that increases the attribute by 1 per stack. to check if stat points are available or not, i've made stat point as an attribute. so the veterancy behavior adds 'stat point' per level. the buff that adds attribute also deducts 1 stat point.
my problem here is, when a level is gained the points on the attribute 'stat point' is reset, the modification from buff is removed! but the buff is there as the other attributes are still modified.
for example
at level 1 i used all points. 2 str, 1 agi, 1 int. stat point reads 0 (i've made it visible)
at level 2 i have 8 stat points!!! 4 from level 1, 4 from level 2...
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
For problem 2...
Why not just used the learn ability functionality? The learn ability allows you to mimic WarCraft III style hero learning systems but with better custimization.

You give 4 skill points per level, and every time they place it into one of the abilities it will automaticly deduct the skill point and keep track of them properly.

Script might be needed to apply the attribute change.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
The solution I suggest for problem 1 is rather straightforward: use two weapons.

(1) Weapon #1 = Missile Launcher. You need to modify the effect to a Set.
  • Set Effect - it first applies the behavior on the caster, then it generates the missile on the target. Use an Effect: Validator that checks for the absence of the Missile Cooldown behavior (count = 0).
  • Apply Behavior Effect - applies the Missile Cooldown Buff on the caster.
  • Launch Missile Effect - generates a missile from the caster to the target. On destination make sure it damages the target.
  • Missile Cooldown Buff Behavior - make sure it is hidden (flags). Other than that, it does not need to modify anything. Change its duration though to that of the cooldown.

(2) Weapon #2 = Gun. This one is really easy. Simply apply a validator on the damage effect to check for the presence of the Missile Cooldown buff (count > 0).

Alternatively, instead of using a validator on the set for the missile, you can modify the Reload Duration field to the duration of the buff.

Quite unorthodox but does the trick. :wink:
 
Level 5
Joined
Aug 27, 2010
Messages
79
@DSG... thank u but m still in data editor... have not even checked out triggering...once i learn scripting/triggering i'l check it out...


@Daelin.... working thank u.... but cant scale the cooldown based on attack speed of unit.... also i had to set the period of missile launcher to 0(which is displayed in UI)... it is checking which weapon to fire after the period of last weapon is over...
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Period is one thing, but Reload Duration is a different story. I admit I haven't played with weapons, so I'm only speculating here. Why not give the missile a minimal period (from the moment the missile is launched to the moment the gun can shoot), and place the rest of the time in the Reload Duration? Even if the short period appears on the UI, perhaps the Reload Duration appears like Cooldown on the weapon? (speculating again)
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
Only 1 weapon can fire at any time during an attack. Thus the idea is to allow the missle launcher to fire first and then fall back to the normal gun.

I have done this before so it is possible but the problem is repeating it as it would always get stuck on one of them at the end.

You need to fidget around with weapon flags to control how weapons relate to attacks. You could probably force cycling by disabling the fired weapon for 1 frame so it is forced to fall back to the other weapon.
 
Level 5
Joined
Aug 27, 2010
Messages
79
@Daelin...didnt work :(...its like he's reloading weapon and cant fire another weapon...i'l do it with buffs...i'l hide the missile launcher weapon altogether...

@DSG...say i disabled missile launcher after firing for 1 frame, so for next attack the gun is used...but after gun fires once missile launcher would be used again...i want it disabled for a longer period...


is it possible to change period of the cooldown buff for different situations?? somehow based on amount of stack??
 
Status
Not open for further replies.
Top