Change projectile size based on Unit scale

Status
Not open for further replies.
Level 2
Joined
Oct 28, 2021
Messages
7
Hello!
I need to change the unit's projectiles scale in-game.
This method work on warcraft 3 frozen throne:
JASS:
call SetUnitScalePercent(u,300.00,300.00,300.00)
call UnitAddAbilityBJ(1093678922,u)
call IssuePointOrderLocBJ(u,"carrionswarm",point)

How to do this in wc3 reforged? Is it a bug?
Yeah I now that this work with pre-placed unit. But I looking for another way...
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Someone asked a very similar question recently and I think the conclusion that was reached is that the only way to change projectile size now is by actually morphing the unit into a different unit type with a different scale.

Depending on what you’re trying to do, you could create various dummy units of different scales and have one of them cast the Carrion Swarm. (I realize that could just be an example.)
 
Level 2
Joined
Oct 28, 2021
Messages
7
I try to use metamorph, but still not working
JASS:
    set udg_D9[1]=GetLastCreatedUnit()
    call UnitAddAbility(udg_D9[1], 'A0E7')
    call SetUnitAbilityLevelSwapped('A0E7', udg_D9[1], 2)
    call IssueImmediateOrderBJ( udg_D9[1], "metamorphosis" )
    call PolledWait(0.1)
    call IssuePointOrderLocBJ(udg_D9[1],"carrionswarm",udg_c9[1])

1672823062674.png
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
I keep seeing things about Metamorphosis being fucked right now; it doesn't work properly unless the units are literally based on the Demon Hunter in the OE (which shouldn't normally matter if you set all the fields to be the same... but it does for some reason). In any case unless you need the expiration timer on the unit's UI doing a reverse Bear Form morph is better for transforming units semi-permanently.

I see you say the solution doesn't work for you because you have many different skills that need different projectile sizes. The solution I outlined in the other thread I linked you doesn't require different copies of the abilities, just different versions of the base unit that is casting the spell. Maybe I misunderstand you but that could be workable for what you need. You could also fake this effect by making various dummy units actually cast the spells via triggers instead of the main/actual caster (who would instead be activating fake abilities that do nothing other than target the right type of thing).
 
Last edited:
Level 2
Joined
Oct 28, 2021
Messages
7
Thanks, I will try reverse Bear Form.
I understand correctly that I need to create 5 different unit (100% size, 200%, 300%, 800%, 1000%) for each player(max 12) to replace unit created by trigger?
Maybe I don't understand corretly, but if I need to create 32 dummies with 300% size what should I do? For example I have a spell that create 32 dummies around caster and each one cast carrionswarm. Or maybe I try to use unit with 200% size that already used by another spell. So I will need to write something like queue system...
 
Level 2
Joined
Oct 28, 2021
Messages
7
Ok, Reverse bear form doesn't work.

JASS:
set udg_D9[1]=GetLastCreatedUnit()

call UnitAddAbility(udg_D9[1], 'A0DT') // Bear Form
call UnitRemoveAbility(udg_D9[1], 'A0DT')

call UnitAddAbilityBJ(...)
call IssuePointOrderLocBJ(udg_D9[1],"carrionswarm",point)
 

Attachments

  • 1672841980292.png
    1672841980292.png
    119.1 KB · Views: 19
  • 1672842162719.png
    1672842162719.png
    301.1 KB · Views: 19
  • 1672842404483.png
    1672842404483.png
    128.1 KB · Views: 18

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
You could always trigger Carrion Swarm yourself and have full control over the size of the Special Effects.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Hmm okay; a reply in the other thread implied my suggestion worked. Guess not. They did add this:
OK, I've found that the pre-placed unit on the map works as intended. No idea what the difference is from the unit created by the trigger.
But my goal is achieved.
You can use this fact to have a dummy unit for each player preplaced on the map, then use each player's dummy for every relevant cast any of their units needs it for and simply change the scaling of that dummy when necessary. A single dummy unit, if properly configured, can cast instantly (literally within the line that orders it) without having to turn to face the target. A single dummy can cast all your carrion swarms 'at once' and properly keep kill credit as long as you don't change its owner.

The dummy must have all cast-related animation points set to 0, 0 move speed, and the movement type None.
 
Level 2
Joined
Oct 28, 2021
Messages
7
I don't really believe it. Otherwise, everyone would have used this method for a long time.
Hmm okay; a reply in the other thread implied my suggestion worked. Guess not. They did add this:

You can use this fact to have a dummy unit for each player preplaced on the map, then use each player's dummy for every relevant cast any of their units needs it for and simply change the scaling of that dummy when necessary. A single dummy unit, if properly configured, can cast instantly (literally within the line that orders it) without having to turn to face the target. A single dummy can cast all your carrion swarms 'at once' and properly keep kill credit as long as you don't change its owner.

The dummy must have all cast-related animation points set to 0, 0 move speed, and the movement type None.
 
Level 2
Joined
Oct 28, 2021
Messages
7
You could always trigger Carrion Swarm yourself and have full control over the size of the Special Effects.
Thanks, looks interesting. I will take look at this system in near future. Won't this system create "lags" with a large number of casts?
 
Level 24
Joined
Feb 27, 2019
Messages
833
I don't really believe it. Otherwise, everyone would have used this method for a long time.
I have generally opted to using special effects, kinda like Shockwave/Carrion system which should work fine and performance of the system is reduced if loopsfx is set to False. I have tried other ways to no avail but Pyromancers technique works. It may just be that the technique is not generally known yet. At least I didnt know about it. Sure it requires a few pre-placed dummies but I dont think it affects performance in a noticeable way. I have noticed that if units dont move or cant move they dont seem affect performance much.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Thanks, looks interesting. I will take look at this system in near future. Won't this system create "lags" with a large number of casts?
How often do you plan on casting it? It should be fine as long as it's not like 100 casts per second.

Also, Pyromancer's system should be MORE performant than constantly creating new Dummys. Why create 100+ units a game per player when you only need one per player? It's also handy for managing systems like Ability Power which scale the power of your spells, since you could pair this Dummy to a Hero for example and share this stat between the two of them.

It's much cheaper to manage things that are already stored in memory than instantiating a completely new object.

Edit: Pyrogasm* not pyromancer, although one name rolls off the tongue a bit better than the other...
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
16-year-old me says "no". :mwahaha:
16 year old me rocked the name Deathclaw24. I had never played Fallout (at the time of making it) and had no idea what I was referencing. Even better, it was all based on my friend's name which was Deathclaw23, which he had no good reasoning for, he just copied it from some other random dude's name which he thought sounded cool. I think this was when we were 12? I dunno, it all made sense at the time. I guess we didn't care what it was at the time, we were just trying to play some Run Kitty Run, ya know? Even my current name is pretty stupid... Never been good with names.
 
Last edited:
Status
Not open for further replies.
Top