Spell Death Nova

D.V.D

Make a wish
Reaction score
73
I already told you why atype and dtype. The spell effect has been done and the return. I just didn't show it because I did it after I showed you the code that doesn't work. I nulled the struct variables just in case. I'll change everything i missed and to make you happy, I'll show you what it look like but alteast help me with those globals problems. The timer needs to be a global so it would work together without leaking a timer. And please read all my posts before postig because I don't want to repeat myself.
 

Romek

Super Moderator
Reaction score
964
> I already told you why atype and dtype.
I have an amazing plan: How about you make them configurable.
Thus, they are useless struct members.
 
Reaction score
341
I can't beleive how many times I (as well as others) have told you this...

JASS:
private function Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == ID ) ) then
        return false
    endif
    return true
endfunction


CHANGE TO!

JASS:
private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == ID
endfunction


Also, don't use polledwaits, they are no better than TSA's, in fact polledwait uses TSA's

People are beginning to repeat what others have said now.
To be frank, the code is a mess, and you don't seem to understand some basic things that apply to making spells in Jass. I suggest you learn [v]Jass properly, before submitting more spells, it'd benefit the community, as well as yourself.

QTF. I used to be the same way, submitting every little thing I made, now that I look back, just want to burn all of it.
 

D.V.D

Make a wish
Reaction score
73
Read the post above.

Edit: t is now a struct member. The globals radius, distance,amount still are messed. Cannot be assinged to DeathNova(main actions). Here's the code up to now:
JASS:
scope DeathNova initializer InitTrig

////////////////////////////////////////////////////////////////////////////////////////
//   Variables:                                                                       //
// 1.atype = AttackType of the damage                                                 //
// 2.dtype = DamageType of the damage                                                 //
// 3.damage = Damage done                                                             //
// 4.X = X of the middle of the nova                                                  //
// 5.Y = Y of the middle of the nova                                                  //
// 6.model = The model name when using CreateNovaDamageAllEffect()                    //
// 7.caster = The Casting Unit of the spell                                           //
////////////////////////////////////////////////////////////////////////////////////////
//   Methods:                                                                         //
// 1.OnDestroy = Nulls everything in the struct and sets it to 0                      //
// 2.CreateNovaDamageEffectAll() = Creates a nova that uses Special Effects and       //
// damages all the units even allies and yours.                                       //
// 3.CreateNovaDamageAllUnit() = Creates a nova made from units that damages all      //
// units including yours and allies.                                                  //
////////////////////////////////////////////////////////////////////////////////////////

globals
private constant integer endLoop = 10//This is the amount of times the novas will be made
private constant integer ID = 'AHtc'//This is the raw code for your ability
private constant real amount = 20.00//This variable indicates the amount of effects amde in one nova. CANNOT BE A DECIAML NUMBER!
private constant real distance = 100.00//This variable sets the distance the nova's are created from the x and y of your choice
private constant real radius = 50.00//This variable indicates the radius of the damage. Radius increases by 10 for all nova's made each time.
private constant real Time = 0.10//This is the time between the next nova is created
private constant timer t = CreateTimer()
endglobals

public struct nova
attacktype atype
damagetype dtype
real damage
real X
real Y
string model
timer t
unit caster

method onDestroy takes nothing returns nothing
    set .X = 0.00
    set .Y = 0.00
    set .caster = null
endmethod

method CreateNovaDamageAllEffect takes nothing returns nothing
    local real angle = 0
    local real intervals = 360 / amount
    local real x
    local real y
    local effect f
      loop
         exitwhen angle > 360
         set x = .X + distance * Cos(angle * bj_DEGTORAD)
         set y = .Y + distance * Sin(angle * bj_DEGTORAD)
         set f = AddSpecialEffect(.model, x, y)
         call UnitDamagePoint(.caster, 0.00, radius, x, y, .damage, true, false, .atype, .dtype, WEAPON_TYPE_WHOKNOWS)
         set angle = angle + intervals
      endloop
      call DestroyEffect(f)
      set f = null
endmethod

////////////////////////////////////////////////////////////////////////////////////////////////
endstruct
////////////////////////////////////////////////////////////////////////////////////////////////

private function DeathNova takes nothing returns nothing
    local nova d = nova.create()
    local integer beginloop = 0
      call PauseTimer(d.t)
      call DestroyTimer(d.t)
      set d.t = CreateTimer()
      set d.caster = GetTriggerUnit()
      set d.X = GetUnitX(d.caster)
      set d.Y = GetUnitY(d.caster)
      set d.model = "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl"
      set d.damage = GetUnitAbilityLevel(d.caster,'AHtc') * 10
      set d.atype = ATTACK_TYPE_MAGIC
      set d.dtype = DAMAGE_TYPE_NORMAL
      if (beginloop != endLoop) then
         set amount = amount + 5.00
         set distance = distance + 100.00
         set radius = radius + 10.00
         set beginloop = beginloop + 1
           call d.CreateNovaDamageAllEffect()
           call TimerStart(d.t, Time, false, function DeathNova)
           call d.destroy ()
      endif
endfunction

private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == ID
endfunction

//===========================================================================
private function InitTrig takes nothing returns nothing
    local trigger e = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( e, EVENT_PLAYER_UNIT_SPELL_EFFECT )  
    call TriggerAddAction(e, function DeathNova )
endfunction

endscope
 
Reaction score
341
JASS:
set d.model = "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl"


Change into a global, no need to store the effect each time, that will also make it configurable.

JASS:
         set amount = amount + 5.00
         set distance = distance + 100.00
         set radius = radius + 10.00


You cannot change constant values, hence the word constant.
 

D.V.D

Make a wish
Reaction score
73
So I change it into private integer amount = 20? Ill make the effect a configurable but, Im not removing the model from the struct.

EDIT: Basically, I changed the globals. Now here's the proble. First time you cast the ability, first nova is made in the right location, all the others are made in Centre of Playable map area. Next time you cast it nothing happens because the map keeps getting laggier and laggier till it crashes so I guess the loop never ends. here's the code:
JASS:
scope DeathNova initializer InitTrig

////////////////////////////////////////////////////////////////////////////////////////
//   Variables:                                                                       //
// 1.atype = AttackType of the damage                                                 //
// 2.dtype = DamageType of the damage                                                 //
// 3.damage = Damage done                                                             //
// 4.X = X of the middle of the nova                                                  //
// 5.Y = Y of the middle of the nova                                                  //
// 6.model = The model name when using CreateNovaDamageAllEffect()                    //
// 7.caster = The Casting Unit of the spell                                           //
////////////////////////////////////////////////////////////////////////////////////////
//   Methods:                                                                         //
// 1.OnDestroy = Nulls everything in the struct and sets it to 0                      //
// 2.CreateNovaDamageEffectAll() = Creates a nova that uses Special Effects and       //
// damages all the units even allies and yours.                                       //
// 3.CreateNovaDamageAllUnit() = Creates a nova made from units that damages all      //
// units including yours and allies.                                                  //
////////////////////////////////////////////////////////////////////////////////////////

globals
private constant integer endLoop = 10//This is the amount of times the novas will be made
private constant integer ID = 'AHtc'//This is the raw code for your ability
private real amount = 20.00//This variable indicates the amount of effects amde in one nova. CANNOT BE A DECIAML NUMBER!
private real distance = 100.00//This variable sets the distance the nova's are created from the x and y of your choice
private real radius = 50.00//This variable indicates the radius of the damage. Radius increases by 10 for all nova's made each time.
private constant real Time = 0.10//This is the time between the next nova is created
private constant string Effect = "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl"
endglobals

public struct nova
attacktype atype
damagetype dtype
real damage
real X
real Y
string model
timer t
unit caster

method onDestroy takes nothing returns nothing
    set .X = 0.00
    set .Y = 0.00
    set .caster = null
endmethod

method CreateNovaDamageAllEffect takes nothing returns nothing
    local real angle = 0
    local real intervals = 360 / amount
    local real x
    local real y
    local effect f
      loop
         exitwhen angle > 360
         set x = .X + distance * Cos(angle * bj_DEGTORAD)
         set y = .Y + distance * Sin(angle * bj_DEGTORAD)
         set f = AddSpecialEffect(.model, x, y)
         call UnitDamagePoint(.caster, 0.00, radius, x, y, .damage, true, false, .atype, .dtype, WEAPON_TYPE_WHOKNOWS)
         set angle = angle + intervals
      endloop
      call DestroyEffect(f)
      set f = null
endmethod

////////////////////////////////////////////////////////////////////////////////////////////////
endstruct
////////////////////////////////////////////////////////////////////////////////////////////////

private function DeathNova takes nothing returns nothing
    local nova d = nova.create()
    local integer beginloop = 0
      call PauseTimer(d.t)
      call DestroyTimer(d.t)
      set d.t = CreateTimer()
      set d.caster = GetTriggerUnit()
      set d.X = GetUnitX(d.caster)
      set d.Y = GetUnitY(d.caster)
      set d.model = Effect
      set d.damage = GetUnitAbilityLevel(d.caster,'AHtc') * 10
      set d.atype = ATTACK_TYPE_MAGIC
      set d.dtype = DAMAGE_TYPE_NORMAL
      if (beginloop != endLoop) then
         set amount = amount + 5.00
         set distance = distance + 100.00
         set radius = radius + 10.00
         set beginloop = beginloop + 1
           call d.CreateNovaDamageAllEffect()
           call TimerStart(d.t, Time, false, function DeathNova)
           call d.destroy ()
      endif
endfunction

private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == ID
endfunction

//===========================================================================
private function InitTrig takes nothing returns nothing
    local trigger e = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( e, EVENT_PLAYER_UNIT_SPELL_EFFECT )  
    call TriggerAddAction(e, function DeathNova )
endfunction

endscope
 

Romek

Super Moderator
Reaction score
964
Would you mind reading, and re-reading the rest of my post until you get it?

It does annoy me when I post all that stuff there, and you completely ignore it. (Just like the amount of people who told you to fix the condition until you actually did it)
 
Reaction score
341
So I change it into private integer amount = 20? Ill make the effect a configurable but, Im not removing the model from the struct.

any good reason for that?

Before you start posting vJASS resources, read this, until you understand what your doing.

Once done, practice alot.

As of now, it looks like you have no idea what your doing.

The least you could do is listen to peoples suggestions.
 

D.V.D

Make a wish
Reaction score
73
Read my edit above your post. I did what people said. And I changed the things the way the people told me and now, my code works so badly, that your map will crash.
 

Flare

Stops copies me!
Reaction score
662
Hmm, I can't see this thread going anywhere - if people don't have anything new to contribute or don't want to point out anything that had been overlooked, why do you even bother replying? Re-iterating the same stuff over and over is only going to get you so far ¬_¬ The condition has been mentioned 5 times.
If D.V.D doesn't want to take heed of the suggestions for improvement, he doesn't have to and, as such, I'm sure you can all guess what should (or, has already, in this case) happen to the resource.

JASS:
      call PauseTimer(d.t)
      call DestroyTimer(d.t)

The timer shouldn't even exist when you call those - move those to your onDestroy method.

Your d.destroy () call should be at the end i.e. after the whole if block, not just at the end of the if. The reason why your second, third, fourth (etc) novas are being created at the center of the map is because you are destroying the struct after the first loop iteration, which is setting everything to 0, so your projections are ending up as '0 + Cos (angle) * offset' which would put you fairly close to the center of the map :p

JASS:
call TimerStart(d.t, Time, false, function DeathNova)

Until you understand timers a bit more, I suggest that you stick to TriggerSleepAction or PolledWait - honestly, TriggerSleepAction's inaccuracy is much better than what you are doing right now. Once the spell is cast, it starts the timer to call the spell action function in 0.1 seconds. So, every 0.1s, the timer starts again, repeating the same function. Quite a vicious cycle, especially considering you are creating special effects
 

Steamsteam

New Member
Reaction score
1
i downloaded this map and this is a pretty sick spell.. way to week .. was hoping for like instant kills :p
 

D.V.D

Make a wish
Reaction score
73
You can change the damage,effect,etc. Im probably going to change it so its not in the graveyard.
 

Azlier

Old World Ghost
Reaction score
461
>You can change...
Not easily. This is why we have constants.
 

Jesus4Lyf

Good Idea™
Reaction score
397

D.V.D

Make a wish
Reaction score
73
Somewhere in the other posts, they told me to remove that condition line and it still works. Gonna change the wait.
 

Jesus4Lyf

Good Idea™
Reaction score
397

D.V.D

Make a wish
Reaction score
73
Updated code with the condition and reduced the lines of the condition.

I didn't do the condition thing cause when I posted in Jass Help, someone told me to remove it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top