• 🏆 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!

[Trigger] shotgun spell problem

Status
Not open for further replies.
Level 7
Joined
Feb 18, 2007
Messages
216
So I'm making zombie shooter kind of map, and I have problems with shotguns. I have two types of shotguns in my map, normal and super shotguns, and both have the same idea: firing multiple carrion swarm-spell based projectiles in multiple directions. The main spell is based on carrion swarm also. Shotgun fires the main projectile (the one fired by the caster itself) and four dummy projectiles (carrions swarms casted by dummy units) and Super Shotgun fires six dummy projectiles in addition with the main projectile. The problem is that normal shotgun sometimes fires only three dummy projectiles and all go to weird directions like this:
ass.jpg
The blue projectile is the main and green ones are dummies. Super Shotgun never fires more than four dummy projectiles (it should fire six) and they also usually go to weird directions like this:
ass2.jpg
Here are the triggers, I would use loop but then there would be fired extra dummy projectile that would go same direction as the main projectile.
  • Fire Shotgun
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Shotgun (Fire)
    • Actions
      • Set shotgun_point = (Target point of ability being cast)
      • Unit - Create 1 Shotgun Dummy for Player 1 (Red) at (Position of marine) facing (Angle from (Position of marine) to shotgun_point) degrees
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Casting unit)) offset by (Distance between (Position of (Casting unit)) and shotgun_point) towards ((Angle from (Position of (Casting unit)) to shotgun_point) + 22.50) degrees)
      • Unit - Create 1 Shotgun Dummy for Player 1 (Red) at (Position of marine) facing (Angle from (Position of marine) to shotgun_point) degrees
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Casting unit)) offset by (Distance between (Position of (Casting unit)) and shotgun_point) towards ((Angle from (Position of (Casting unit)) to shotgun_point) - 22.50) degrees)
      • Unit - Create 1 Shotgun Dummy for Player 1 (Red) at (Position of marine) facing (Angle from (Position of marine) to shotgun_point) degrees
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Casting unit)) offset by (Distance between (Position of (Casting unit)) and shotgun_point) towards ((Angle from (Position of (Casting unit)) to shotgun_point) + 11.25) degrees)
      • Unit - Create 1 Shotgun Dummy for Player 1 (Red) at (Position of marine) facing (Angle from (Position of marine) to shotgun_point) degrees
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Casting unit)) offset by (Distance between (Position of (Casting unit)) and shotgun_point) towards ((Angle from (Position of (Casting unit)) to shotgun_point) - 11.25) degrees)
  • Fire Super Shotgun
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Super Shotgun (Fire)
    • Actions
      • Set shotgun_point = (Target point of ability being cast)
      • Unit - Create 1 Super Shotgun Dummy for Player 1 (Red) at (Position of marine) facing (Angle from (Position of marine) to shotgun_point) degrees
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Casting unit)) offset by (Distance between (Position of (Casting unit)) and shotgun_point) towards ((Angle from (Position of (Casting unit)) to shotgun_point) + 22.50) degrees)
      • Unit - Create 1 Super Shotgun Dummy for Player 1 (Red) at (Position of marine) facing (Angle from (Position of marine) to shotgun_point) degrees
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Casting unit)) offset by (Distance between (Position of (Casting unit)) and shotgun_point) towards ((Angle from (Position of (Casting unit)) to shotgun_point) - 22.50) degrees)
      • Unit - Create 1 Super Shotgun Dummy for Player 1 (Red) at (Position of marine) facing (Angle from (Position of marine) to shotgun_point) degrees
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Casting unit)) offset by (Distance between (Position of (Casting unit)) and shotgun_point) towards ((Angle from (Position of (Casting unit)) to shotgun_point) + 11.25) degrees)
      • Unit - Create 1 Super Shotgun Dummy for Player 1 (Red) at (Position of marine) facing (Angle from (Position of marine) to shotgun_point) degrees
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Casting unit)) offset by (Distance between (Position of (Casting unit)) and shotgun_point) towards ((Angle from (Position of (Casting unit)) to shotgun_point) - 11.25) degrees)
      • Unit - Create 1 Super Shotgun Dummy for Player 1 (Red) at (Position of marine) facing (Angle from (Position of marine) to shotgun_point) degrees
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Casting unit)) offset by (Distance between (Position of (Casting unit)) and shotgun_point) towards ((Angle from (Position of (Casting unit)) to shotgun_point) + 33.75) degrees)
      • Unit - Create 1 Super Shotgun Dummy for Player 1 (Red) at (Position of marine) facing (Angle from (Position of marine) to shotgun_point) degrees
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Casting unit)) offset by (Distance between (Position of (Casting unit)) and shotgun_point) towards ((Angle from (Position of (Casting unit)) to shotgun_point) - 33.75) degrees)
Projectiles should go like this, green lines are dummies and blue one is the main:
likethis.jpg

Anyone have and idea what could be the problem? And yeah I know it leaks, I will fix them when I manage to get this work as it should.
 
Level 7
Joined
Feb 18, 2007
Messages
216
As I said I will fix the leaks later :) well it can be JASS if it just works exactly as it should, but rather in GUI if I want to edit it later :p (though I guess all I would need to edit are the values in spells and dummy units)
 
Level 6
Joined
Oct 10, 2009
Messages
1,425
Okay, well I'm done I beleive, unless you want super shotgun and shotgun to do different damages.
or have different distances or something.

Right now the only difference is it make 6 instead of 4 dummy casts.
 
Level 6
Joined
Oct 10, 2009
Messages
1,425
Okay, I'll have to make another ability then :p
then I'll send it to you.
I don't need to explain where.
It's self explanatory :p

JASS:
constant function RAWCODE_LARGER takes nothing returns integer
    return 'ZZZz'//Change the rawcode to the rawcode of your ITEM ability (the one that triggers it)
endfunction
constant function RAWCODE_DUMMYY takes nothing returns integer
    return 'yyyy'//Change the rawcode to the rawcode of your Dummy unit. Also, please make sure your dummy unit does not have the ability that he casts. The spell adds that for you.
endfunction
constant function CARRIONSWARMLARGEDUMMY takes nothing returns integer
    return 'ACca'//This is the dummy unit's carrion swarm attack!
endfunction
constant function  SMALLER takes nothing returns real
    return 11.25 //This is an optional change. In case you ever want to edit ;) It's the small value for the shotgun angle (but you should know that ;)
endfunction
constant function  LARGER takes nothing returns real
    return 22.50 //This is an optional change. In case you ever want to edit ;) It's the larger value for the shotgun angle (but you should know that ;)
endfunction
constant function  LARGEST takes nothing returns real
    return 33.75 //This is an optional change. In case you ever want to edit ;) It's the largest value for the shotgun angle (but you should know that ;)
endfunction

That is the super shotgun changeable area.
You understand where to change the rawcodes?
 
Last edited:
Level 7
Joined
Feb 18, 2007
Messages
216
In the test map it works as it should, but there's small problem: the dummy projectiles are shot with a little delay, they should be shot at the same time as the main projectile. It might be because you've added the ability to them via triggers, instead of them having it already.
 
Level 7
Joined
Feb 18, 2007
Messages
216
The dummy abilities are still casted with a delay....

EDIT: NVM, the spell was working properly all the time, the problem was UNIT settings... you had Art - Animation - Cast Point 0.400 even though it was supposed to be 0 :p

So thank you very much for help ! :)
 
Status
Not open for further replies.
Top