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
589
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
589
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
589
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
589
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
589
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.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top