HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Theory: GetReandomReal

10-25-2006, 01:30 PM#1
The)TideHunter(
Well, i recently created a spell, called Reign of Fire.
Ok small background: it creates bolts of fire around the caster that fall from the sky and damaga enemies.

Fine.

It all works nicely, but if i enable shadows on my bolts, i can see where they are going to land.
Now, when i do this, and if i spam the spell (set it to 0 cooldown), i can see that around all the units, theyre is no shadows whatsoever, they completly miss out the units.
Look at some screenies.
Theyre is no way this is coincidence, iv tested it loads of times, i will submit my spells code here later.

EDIT: Oh, and they way i determain the random locations is by:
Collapse JASS:
    local real hr = ReignOfFire_Radius()/2
    local real rx = GetRandomReal(x-hr, x+hr)
    local real ry = GetRandomReal(y-hr, y+hr)
x and y is the casters x and y.
ReignOfFire_Radius() = 350.
Attached Images
File type: jpgTest1.jpg (30.2 KB)
File type: jpgTest2.jpg (24.9 KB)
File type: jpgTest3.jpg (22.7 KB)
10-25-2006, 01:33 PM#2
MaD[Lion]
i think it is cus the bolt units still have collision, so they cannot land on any other units, if u add locust to the bolt, it will land on others
10-25-2006, 01:33 PM#3
The)TideHunter(
Brb, i'll try that.
EDIT: Nope, i already gave my dummy units locust.
Attached Images
File type: jpgeek.jpg (117.6 KB)
10-25-2006, 01:38 PM#4
MaD[Lion]
maybe then try to use trigger and turn collisions off. But tbh i never has problems like this when i do :P

edit: as i see problem can only be the unit, nothing wrong with formula
10-25-2006, 01:43 PM#5
The)TideHunter(
Well, this is solved, i just did:
Collapse JASS:
    call SetUnitX(d, rx)
    call SetUnitY(d, ry)
Which aviods collision.
So you was right about it was collision, looks like locust not make take effect until the unit is created, rather than when it is created.
Anyway, thanks.
10-25-2006, 08:38 PM#6
MaD[Lion]
well ofc it doesnt take effect before unit is created :P cus no unit -> no locust
10-25-2006, 09:15 PM#7
The)TideHunter(
Locust is different to most other abilities, thought. I thought it would act differently in certain ways.
10-25-2006, 09:44 PM#8
Naakaloh
I usually give my dummies flying movement so that they can be created over other units.

Also this is unrelated to your problem but ... did you want that to be a circle?
10-26-2006, 07:58 AM#9
MaD[Lion]
he have alread solved problem :)
10-26-2006, 09:48 AM#10
The)TideHunter(
Quote:
Originally Posted by Naakaloh
Also this is unrelated to your problem but ... did you want that to be a circle?

Yes, i do.
It should form a circle, with the method i use, its jus that their isent enough created /sec for it to look like one.
10-26-2006, 10:45 AM#11
iNfraNe
CreateUnit takes into account the pathing of a unit, even if it has locust, so it will create the unit on the closest point available. Doing SetUnitX/Y or even SetUnitPosition afterwards will always work :)
10-26-2006, 12:57 PM#12
The)TideHunter(
Quote:
Originally Posted by iNfraNe
CreateUnit takes into account the pathing of a unit, even if it has locust, so it will create the unit on the closest point available. Doing SetUnitX/Y or even SetUnitPosition afterwards will always work :)

Thanks man =).