Spell Homing Missiles

Tom Jones

N/A
Reaction score
437
It makes absolutely no difference where your null your variables, as long as you do it after your done using them.
JASS:
function...
    local unit u  //In reality local unit u = null
    local integer i = GetRandomInt(1,5)

    if i == 1 then
        set u = GetTriggerUnit()
        ...
        set u = null //When you null here, you know that the variable u contains a unit, and therefore needs to be nulled.
    endif
    set u = null //When you null here, you may not be sure that the variable u contains a unit, however if it doesn't your just setting the variable to null again.
endfunction
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
It makes more sense to only null them when you know they have a value, else it's an extra function call that you shouldn't need.
 

emjlr3

Change can be a good thing
Reaction score
395
not a function call, but its something you dont need, so why do it?
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Well, I meant that there is no need to null it at this area:
JASS:
    if failsafe <= 0 then
        set dummy = null
        set target = null
        set caster = null
        call DestroyGroup(g)
        set g = null
        return
    endif


Because the variable is not set yet. :D
 

Doomhammer

Bob Kotick - Gamers' corporate spoilsport No. 1
Reaction score
67
have you had a look at collision missiles from the Caster System yet? They are homing.
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Yea, but this spell is easier to implement than having to copy a spell along with a system. Or the functions... :D
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
Uhm, actually its only useless if there are NO units in range to begin with.
That would be useless if I nulled the dummy at the end, though.
 

emjlr3

Change can be a good thing
Reaction score
395
let me knwo if your ever update it, graveyarded
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
Yeah, I'm bumping something from October 17th.

I was looking over my submitted stuff to approved ratio and was appalled. So, I updated this.
Uses vJass now, mucho improved coding.
 

emjlr3

Change can be a good thing
Reaction score
395
why did you go from 2.7 to 4.0

seems 3.0 would have been more appropriate

range, total units should be lvlable

add an exitwhen firstofgroup==null, and remove that part you have, its silly

no need to null dummy before reusing it, same with target

you loop could be removed and its actions ran in the Condition(function), its better

this could benefit from use of a global group which is reused
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
why did you go from 2.7 to 4.0

seems 3.0 would have been more appropriate
When I do a massive update to any code of my, I just bump it up a ton.
range, total units should be lvlable
Range has been done, units are already doing that, it just has one level.
JASS:
exitwhen loopa > BASENUM*splvl

add an exitwhen firstofgroup==null, and remove that part you have, its silly
Good and all, but that means I need to limit the number of units in the group when I actually group them.
no need to null dummy before reusing it, same with target
Fixed.
you loop could be removed and its actions ran in the Condition(function), its better
I'll change.
this could benefit from use of a global group which is reused
Wouldn't that make it not MUI?
 

emjlr3

Change can be a good thing
Reaction score
395
Wouldn't that make it not MUI?

the groups use is instant, so a new thread would never be started before the current one is complete

Good and all, but that means I need to limit the number of units in the group when I actually group them.

leave the current exitwhen, and add the other under it
removes your redundant code, and makes it looks nicer

Range has been done, units are already doing that, it just has one level.

i dont see a

JASS:
private function GetRange takes integer lvl returns real
    return lvl*400.
endfunction


for range or units
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
Yeah, I hadn't added the new code. Updated with everything.
 

emjlr3

Change can be a good thing
Reaction score
395
just use groupenumunitsinrange

no need to count them

and never return true from your condition function - otherwise it adds units to the group, which you do not want

you seem to not use your local varaibles all the time, like caster

no need to remove units from the group if you never add them, and how you do it not does not work
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
I do need to count them, otherwise I'd have to use some other method inside the function to count it. The grouping method is a native. Added revised version.
 

emjlr3

Change can be a good thing
Reaction score
395
use a global integer to count them

***
is is seriously not a big deal - but just so you know - again, no need to null dummy just to reuse it

you dont need to remove units from the group, because they are only added if the condition function returns true for the enumunit, which it never does

and i though the groupenum u were using was a non-native, but its native so its fine

is loopa ever used?

null dummy at the end of the if/endif, as opposed to at the end of the condition function - since its only used in there

only other way to really improve this would be to use global variables for stuff like caster, owner of caster, lvl, etc. - which you use over and over each cast - so you would just set them once and forget about it for the rest of the spell
 

emjlr3

Change can be a good thing
Reaction score
395
while you are at it have a global for owner of caster

I think you should comment somewhere that in settingbaseenum and range, you are actually creating the linear function for each argument, where 400 range would mena 400 range per level

rest looks fine

also, some doc. on how to edit damage/etc. on the dummy missiles would be nice
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • 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 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