In my experience, <d ref/> doesn't support order of operations the way it should. You need to bracket operations you want done first, like mult/divison for example. The operation goes from left to right, it doesn't care if there are * or / signs later on in the func. I don't know how others do it, but I personally use damage effect as it can support tons of stats. Although to be honest, I'm sure effects like search can too.
Be careful with CatRef though, I highly recommend using universal base values for simple calculations and CatReffing only the harder to calculate values. CatRef has a finite limit after which your map starts leaking :<. And when it does your map will be un-exitable lol!
So you can have something like
Effect-Type: Damage, Name:LaserStats
Amount: 10
AttributeBonus[Biological]: 1.75
Your button tooltip:
Shoots a laser at target, dealing <d ref="Effect,LaserStats,Amount" precision="1"/> damage. If the target is slowed, it takes <d ref="(Effect,LaserStats,AttributeBonus[Biological]*Effect,LaserStats,Amount)+5" precision="1"/> bonus damage.
It' look like this:
Shoots a laser at target, dealing 10 damage. If the target is slowed, it takes 22.5 bonus damage.
Also another thing is, the calculations are rounded to the nearest integer if you don't give it any precision value. Precision is just basically, how many decimal points it shows. If I didn't put precision, the bonus damage would have been 23. If the final calculation is a whole, it won't show the 0 decimal values even with precision values.
A little demo I tried to replicate for the Flame Spiral. But dam I know it can be done better, I had to duplicate actors/effects to get the right launch/site corrections for beams. If there were more than 2+ beams, this would be a royal pain. I just don't really know how to do it xd. I know abv knows tho..
Another flaw is that the damage is cast by dummy caster. A simple work around, at least for me, would be using triggers - but I know adv does all of his stuff 100% data. Darn data purist - I can't stand it lol!
Lol.. this is so... incredibly sloppy I don't even know where to begin. But I can't say I blame you, you've set up a pretty big knot. A lot of it you've done unknowingly, because you copied and pasted a lot of things without fully understanding what every little thing does. But then again the most basic and key mistakes, I've already pointed out several times and you have not adjusted.
You have repeated pasted effects that have no difference from each other. If you want different damage effects for different levels, use the switch effect and use level validators for different cases. Search switch effects and validators if you don't know what they do. They're very simple - switch effect just uses different effects under different conditions (via validators). Validators are just condition checks for data, they can assess a lot of fundamental situations and are very useful. I've already told you this several times now.
Why do you have negative periodic duration values in your persistent? Also 20 periodic counts of.. turning the turret(?) - I think you meant to add some search/damage effects in there. If you have less effects listed, than the periodic counts integer - the periodic effect will use the first index after reaching the last. You're basically ordering the unit to turn it's turret 20 times. Also the location for the persistent is set to caster, so it has wrong targeting.
Your issue order for morphing has player set to 'target', should be set to 'caster'. There are some other wrong impact targets/locations such as modify unit - I haven't found all of them.
Your morph flags doesn't ignore unit food cost, the tanks can't even morph in the first place. While this might be default setting for the morph ability, you might have changed a setting in your siege units - idk what you did for sure, but it's definitely being an issue here.
You used custom units for this, but the morph actor you are using is the default Siege Breaker Siege/Unsiege type which, in their actor events, validates morph only for Siege Breaker type of units. You need to add a term that validates your type of custom units. Or copy the actor if you don't want to touch the default actor. Otherwise you're going to have an empty transition between morphing.
Repeating AnimBrackets with the same name has some glitchy visual effects, I advise using AnimPlay or at least clearing the AnimBracket event name each time you finish and/or when you start it up. Give your attack animation time scale or duration if you have lower attack speeds. Since it's not attached to a weapon, the animation flow won't be automatically scaled.
There are some other subtle things you can learn from my attachment:
I rotate the turret initially, and un-rotate it after the attack pattern - before unmorphing the unit (It looks cleaner that way).
You didn't set an arc value for your ability, so your unit turns twice in the casting stage (It's repetitive, in terms of animation time).
You can use an action actor to link together launching/impact models/sound effects. (This is up to you, but I personally don't like to do a lot of repetitive things so...)
Use a dummy search effect (set the area and unit filter), link it to cursor effect for your ability. It will show what kind of targets your effect can target - also you won't have to scale your cursor splats by model scale manually. It will automatically scale it for you, according to your dummy search effect's area radius.
Also, I forgot to add this when I responded to your PM - but even though I updated my submissions to be pure data - I had made an updated version layered directly on top of the map that you were working on. Both of them address some of the points I laid out here.
Overall - pay attention to the details! You could've avoided a lot of mistakes, if you paid closer attention to my posts/attachments.
Change the Footprint - Placement in the Unit. Without it you won't get the snap to grid display when you use it for a build unit type effect. Also, if you're using effect-target - you have to set the Place - Unit field to the unit you're using.
1. Or just limit the rate of rotation the turret can turn at.
2. wtf??? Why would different morphs be needed for this issue?
3. Agreed, that is the least dupe intensive solution unless using catalog triggers. For that problem the data/trigger hybrid solution is the easiest.
4. Why not just use an actual damage effect?
If you look at the archangel battle from HOTS it is not hard to blend triggers and effects for unusual situations.
1. He doesn't want unit targeting - he wants point targeting and no weapons involved. The example you gave him requires weapons/unit targeting - but if by all means - if that's what he wants, sure I've over complicated it. We have to go this extra mile of work-arounds because of the limitations.
EDIT: Ok this is my mistake, for some reason... the modify unit turret turn didn't initially transition smoothly when I first made the ability.. -_-;; So the scripts aren't necessary. But dam, I guess if anyone needs an overworked version for turret turning I guess you can use that rofl.
2. He didn't mention this in the thread, but in a PM he wanted this for Siege Breakers. He just used Siege Tanks as an example. I was trying to explain to him, that if he wants different types of Siege Tanks to be able to use this ability, you would use switch and issue different morphs depending on your unit type. In my updated map, it works on both Siege Tanks and Siege Breakers.
3. Yes you're right, if he has only one type of unit per player - CatRef changes would be the best. But just to be safe I added a switch, with multiple damage effects in there.
4. You definitely can, but let's say we have 30 different effect types to deal damage, apply buffs, etc.. They all use different validators and what not - you wouldn't want your effects to not show just because you forgot to include all of them would you? Better to have one dummy effect that is used to trigger all your actors rather than adding the whole tree. You would have to add the whole tree, to each actor triggered. In my map i have 5 damage effects, depending on per level. If I'm using CatRefs fine, we can just use the single damage effect used.
Also in my experience, behaviors/attribute bonuses lack conditions to provide dynamic damage modification - so I always have multiple dummy effects so I can calculate extra stuff during scripts on the fly. During the process, sometimes I want attacks to miss, not play any impact sounds. Maybe if there are multiple effects in there, I don't want some of them to show. At least this is my reasoning for dummy effects, but yes - you don't need them if your ability is super simple. However, most people are not like me - so maybe they won't need to do this. But just my bias.
Anyways, I've attached the latest version with faster morph speeds - I've explained in my PM how to do that as well.
Well, I read your PM regarding this. Since I was kind of bored, I made a more polished version not using any weapons. Of course this means that I would have to turn the turret myself - and it's probably the hardest part, since manual turret rotation is extremely limited (especially clunky via actor messages); The rest of the ability.. was pretty self explanatory. If you didn't know some of these, I suggest you take a good look at some of them, explore the editor a bit more, google or search the mapster.
Some of the questions you are asking, require problem solving and work arounds - maybe next time you need to try harder or do something easier :P. I admit though, the smooth turret turning without weapons was a challenge for me. As far as the problem solving goes, here's how I did it.
Turret Turning - use a modify unit effect that can change turret rotation to target point, and rotate the unit smoothly via scripted waits. You have to interpolate from where you are facing to the target point - then make the unit use the modify unit effect targeting the interpolated points.
Siege Breakers/Tank Dynamics - just make a switch effect that orders different morphs, via unit type validators. If you have only one type of unit using it, you won't even need a switch, just make sure the issued order is the right morph type. Don't forget morphed units are not the same unit-type as pre-morphed units.
Level Dynamics - make multiple damage effects, use a switch effect for different damage effect, checking which to use via unit abil level validators.
Attacking - just fake the attack animation via a dummy damage effect -> make it trigger necessary actors (action, modeloneshot, soundoneshot, etc..).
The script for turning the turret.
constfixedc_siegeStrikeRotationSpeed=150;constfixedc_siegeStrikeAnimDuration=.45;// README// **This ability was made specifically for Siege Tanks, other variations of Siege Tanks may/not work.**// c_siegeStrikeRotationSpeed refers to how fast the turret rotates before attacking/unmorphing// c_siegeStrikeAnimDuration refers to how fast the sieged units play their attack animation// Effects -> Siege Strike (Attack Persistent)// Period Count - number of attacks// Period Durations - time between attacks// Expire Delay - delay after finished attacking, the turret should return to original angle// - Recommend at least 0.5+ second, needed for fluidity between animations// Effects -> Siege Strike// Period Durations - morph animation time, I recommend something like 4.5+ seconds// - This is the duration after initially cast SiegeStrike_TurnTurret func is called// - Allows the morph animation to go uninterruptedboolSiegeStrike_TurnTurret(boolcond,boolactions){// Siege Tank morphed, has an initial turret angle of 135..unitcaster=EventPlayerEffectUsedUnit(c_effectUnitCaster);stringeffect=EventPlayerEffectUsed();pointcPoint=UnitGetPosition(caster);pointtPoint=EventPlayerEffectUsedPoint(c_effectLocationTargetPoint);pointdPoint;fixeddistance=DistanceBetweenPoints(cPoint,tPoint);fixedangle=135;fixedtAngle=AngleBetweenPoints(cPoint,tPoint);fixedangleDif;fixedrotationSpeed=c_siegeStrikeRotationSpeed*.0625;fixedfinalDelay=.25;boolturnback=effect=="SiegeStrikeReturnSet";boolclockwise;// AngleBetweenPoints returns a value from 0~180,-179.9~-.01// We need 0~360 values to make this workif(tAngle<0){tAngle+=360;}// If turning back, reverse the target and starting anglesif(turnback){angle=tAngle;tAngle=135;}// Get the pure differenceangleDif=AbsF(tAngle-angle);// Check which rotation direction is fasterif((!turnback&&(tAngle<135||tAngle>315))||(turnback&&(angle<315&&angle>135))){clockwise=true;}// Make sure the angle difference is the minimum, this is necessary since we check wich rotation is faster..if(angleDif>180){angleDif=360-angleDif;}while(true){Wait(.0625,c_timeGame);// If angle difference is less than the rotation speed, set the next angle to the original target angle// and set the angle difference to 0if(angleDif-rotationSpeed<0){angle=tAngle;angleDif=0;}else{// If the direction is clockwise, we subtract otherwise add the rotationif(clockwise){angle-=rotationSpeed;}else{angle+=rotationSpeed;}// Angle difference is an absolute value, so just keep subtractingangleDif-=rotationSpeed;}// Make the next interpolation, and cause caster to turn it's turret towards interpolated pointdPoint=PointWithOffsetPolar(cPoint,distance,angle);UnitCreateEffectPoint(caster,"SiegeStrikeTurnTurret",dPoint);if(angleDif==0){break;}}// Wait the final delay and trigger the next chain of effectsWait(finalDelay,c_timeGame);if(turnback){UnitCreateEffectUnit(caster,"SiegeStrikeFinalSet",caster);}else{UnitCreateEffectPoint(caster,"SiegeStrikeAttackPersistent",tPoint);}returntrue;}boolSiegeStrike_OnDamage(boolcond,boolactions){// Just plays the Attack animation when the attacking effects go off// You can choose to put in the actor message in units' actors if you want instead...unitcaster=EventPlayerEffectUsedUnit(c_effectUnitCaster);fixedanimDuration=c_siegeStrikeAnimDuration;libNtve_gf_SendActorMessageToUnit(caster,"AnimPlay Attack Attack 0 -1.000000 -1.000000 "+FixedToString(animDuration,5)+" AsDuration");returntrue;}voidSiegeStrike_Init(){triggertrig=TriggerCreate("SiegeStrike_TurnTurret");TriggerAddEventPlayerEffectUsed(trig,c_playerAny,"SiegeStrikeTurnSet");TriggerAddEventPlayerEffectUsed(trig,c_playerAny,"SiegeStrikeReturnSet");trig=TriggerCreate("SiegeStrike_OnDamage");TriggerAddEventPlayerEffectUsed(trig,c_playerAny,"SiegeStrikeAttackSet");}
0
EDIT: Welp, this doesn't work like I thought it would, but maybe you can change opacity's - it kinda works.
0
In my experience, <d ref/> doesn't support order of operations the way it should. You need to bracket operations you want done first, like mult/divison for example. The operation goes from left to right, it doesn't care if there are * or / signs later on in the func. I don't know how others do it, but I personally use damage effect as it can support tons of stats. Although to be honest, I'm sure effects like search can too.
AttributeBonus (13 values)
AttributeFactor (13 values)
Amount (1 value)
AreaArray (144 values)
Be careful with CatRef though, I highly recommend using universal base values for simple calculations and CatReffing only the harder to calculate values. CatRef has a finite limit after which your map starts leaking :<. And when it does your map will be un-exitable lol!
So you can have something like
Effect-Type: Damage, Name:LaserStats
Amount: 10
AttributeBonus[Biological]: 1.75
Your button tooltip:
Shoots a laser at target, dealing <d ref="Effect,LaserStats,Amount" precision="1"/> damage. If the target is slowed, it takes <d ref="(Effect,LaserStats,AttributeBonus[Biological]*Effect,LaserStats,Amount)+5" precision="1"/> bonus damage.
It' look like this:
Shoots a laser at target, dealing 10 damage. If the target is slowed, it takes 22.5 bonus damage.
Also another thing is, the calculations are rounded to the nearest integer if you don't give it any precision value. Precision is just basically, how many decimal points it shows. If I didn't put precision, the bonus damage would have been 23. If the final calculation is a whole, it won't show the 0 decimal values even with precision values.
0
@Spellbound7: Go
ahahah, i remember when i used to have this problem - i went through heaven and hell finding a solution.
Don't use Unit Birth it's buggy.
Make a dummy behavior, give it to your unit
Actor Event
Behavior,BehaviorName,On
Create
For some reason, using Unit Birth only causes model attachments to work when the unit is actively moving. It doesn't work when the unit is static.
0
0
A little demo I tried to replicate for the Flame Spiral. But dam I know it can be done better, I had to duplicate actors/effects to get the right launch/site corrections for beams. If there were more than 2+ beams, this would be a royal pain. I just don't really know how to do it xd. I know abv knows tho..
Another flaw is that the damage is cast by dummy caster. A simple work around, at least for me, would be using triggers - but I know adv does all of his stuff 100% data. Darn data purist - I can't stand it lol!
0
Do you plan on releasing any of these as well as some of your older stuff?
I really want to learn from your assets :).
I'm particularly interested in your Flame Spiral from this one, dark magic one, medic one.. actually nm I like them all but.. lol
I thought I did some cool stuff, but this actor stuff blows my mind and I haven't seen anything that on par with your stuffss...
Any more pro tips? Any stuff I should go look at?
0
0
@abvdzh: Go
Completely forgot about kinetics ;x; thanks.
0
^ might be useful, but what if you want to calculate x/y values based on angle variables and a set distance?
PointWithOffsetPolar(point p, fixed distance, fixed angle) is a trigger func used to create new locations based on distance and angle.
The coordinates for the new location, are calculated like so:
You can use a simple calculator, or write your self a simple program that calculates coordinates for you.
0
Lol.. this is so... incredibly sloppy I don't even know where to begin. But I can't say I blame you, you've set up a pretty big knot. A lot of it you've done unknowingly, because you copied and pasted a lot of things without fully understanding what every little thing does. But then again the most basic and key mistakes, I've already pointed out several times and you have not adjusted.
Also, I forgot to add this when I responded to your PM - but even though I updated my submissions to be pure data - I had made an updated version layered directly on top of the map that you were working on. Both of them address some of the points I laid out here.
Overall - pay attention to the details! You could've avoided a lot of mistakes, if you paid closer attention to my posts/attachments.
0
Change the Footprint - Placement in the Unit. Without it you won't get the snap to grid display when you use it for a build unit type effect. Also, if you're using effect-target - you have to set the Place - Unit field to the unit you're using.
Footprint determines actual unit pathing however.
0
^ This is the right way, make the response add another behavior that hides status bars, uncontrollable etc.. and launches itself at the target.
The final effect for the launch missile effect you can put suicide delay or something similar.
0
Here you go - the Validators XML.
Out Of Combat _ Away From Ally _ Cloak
0
1. He doesn't want unit targeting - he wants point targeting and no weapons involved. The example you gave him requires weapons/unit targeting - but if by all means - if that's what he wants, sure I've over complicated it. We have to go this extra mile of work-arounds because of the limitations.
EDIT: Ok this is my mistake, for some reason... the modify unit turret turn didn't initially transition smoothly when I first made the ability.. -_-;; So the scripts aren't necessary. But dam, I guess if anyone needs an overworked version for turret turning I guess you can use that rofl.
2. He didn't mention this in the thread, but in a PM he wanted this for Siege Breakers. He just used Siege Tanks as an example. I was trying to explain to him, that if he wants different types of Siege Tanks to be able to use this ability, you would use switch and issue different morphs depending on your unit type. In my updated map, it works on both Siege Tanks and Siege Breakers.
3. Yes you're right, if he has only one type of unit per player - CatRef changes would be the best. But just to be safe I added a switch, with multiple damage effects in there.
4. You definitely can, but let's say we have 30 different effect types to deal damage, apply buffs, etc.. They all use different validators and what not - you wouldn't want your effects to not show just because you forgot to include all of them would you? Better to have one dummy effect that is used to trigger all your actors rather than adding the whole tree. You would have to add the whole tree, to each actor triggered. In my map i have 5 damage effects, depending on per level. If I'm using CatRefs fine, we can just use the single damage effect used.
Also in my experience, behaviors/attribute bonuses lack conditions to provide dynamic damage modification - so I always have multiple dummy effects so I can calculate extra stuff during scripts on the fly. During the process, sometimes I want attacks to miss, not play any impact sounds. Maybe if there are multiple effects in there, I don't want some of them to show. At least this is my reasoning for dummy effects, but yes - you don't need them if your ability is super simple. However, most people are not like me - so maybe they won't need to do this. But just my bias.
Anyways, I've attached the latest version with faster morph speeds - I've explained in my PM how to do that as well.
0
Well, I read your PM regarding this. Since I was kind of bored, I made a more polished version not using any weapons. Of course this means that I would have to turn the turret myself - and it's probably the hardest part, since manual turret rotation is extremely limited (especially clunky via actor messages); The rest of the ability.. was pretty self explanatory. If you didn't know some of these, I suggest you take a good look at some of them, explore the editor a bit more, google or search the mapster.
Some of the questions you are asking, require problem solving and work arounds - maybe next time you need to try harder or do something easier :P. I admit though, the smooth turret turning without weapons was a challenge for me. As far as the problem solving goes, here's how I did it.
The script for turning the turret.