System Projectile

Troll-Brain

You can change this now in User CP.
Reaction score
85
JASS:
native GroupAddUnit                         takes group whichGroup, unit whichUnit returns nothing


Seems to return nothing for me. :|

Meh, sorry then i was pretty sure o_O

EDIT : Hmm saying two big shits in few time, time to go to bed ...

EDIT 2 : Not really a good excuse, but it's because i did it like that with my UnitList, and mess up with UnitAddAbility.
 

Kenny

Back for now.
Reaction score
202
Version 1.0.1 (Beta) released. Check my first post for the full updates list (basically added everything listed in one of my previous posts).

Still looking for feedback and criticisms. :)

Edit:

I am pretty happy with where this is at in terms of its interface and functionality. So if there are no major quarrels with those parts of the system, I think I will move this out of Beta in the next update. :)

Edit:

Still looking for feedback/answers for my delayed removal question and the question regarding projectile collision.
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
Yeah, if you look at the horses, they do not seem to face the correct direction. Yes, those riflemen are equipped with horse cannons.

Not sure if it's a problem on my end, though.

I've attached the map for you to have a look (make the rifleman attack stuff).
 

Attachments

  • horse_cannon.jpg
    horse_cannon.jpg
    158.4 KB · Views: 334
  • PJ0002.w3x
    142.5 KB · Views: 280

Kenny

Back for now.
Reaction score
202
Lol!! That is freakin' hilarious. Riflemen equipped with horse cannons! Why didn't I think of that.

As for your problem:

[ljass]Projectile.create(xPos,yPos,zPos,facing)[/ljass] <-- Facing is in radians as per the documentation.

I believe your [ljass]AngleBetweenPointsXY(x1,y1,x2,y2)[/ljass] function returns the angle in degrees. :D
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
Whoops.

Also, I left like 30 riflemen firing at the tank for 2 hours (I fell asleep lol), and when I got back War3 was using 400MB of RAM (as opposed to the 120MB it used at the start). Food for thought (although I may be leaking something haha).
 

Kenny

Back for now.
Reaction score
202
Leaving warcraft on for two hours doing anything would increase its RAM usage (just not by that much). Did you have unit recycling on or off?

If it was off, you probably created somewhere near 110,000 units in 2 hours, which is what would cause the usage to go up like that. If it was on, I don't know what's up..

Edit:

Added some tiny changes to he next update that help with multiple projectile collisions simultaneously. Haven't found anything else wrong with it yet.
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
No, I didn't have recycling on. I'll repeat the test with it on - but it's probably unreliable, I might have leaks in my system somewhere.

EDIT: You aren't using instant facing with projectile recycling? Memory still goes up, but I think it's a problem on my side somewhere.
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
isUnitInHeightRange() does not seem to factor in terrain height properly.

Take a group of gunships, and attack the AA missile tanks on the ledge to the north. You might want to turn on whosyourdaddy (AA hurts a lot) and iseedeadpeople. The gunships will be unable to kill them. Now take the gunships and kill the battle tanks on ground level to the north of the ledge, or attack the AA missile tanks in the bottom-right corner, and you will find the gunship rockets will destroy them.
 

Attachments

  • PJ0005.w3x
    170.8 KB · Views: 282

Kenny

Back for now.
Reaction score
202
You aren't using instant facing with projectile recycling? Memory still goes up, but I think it's a problem on my side somewhere.

That instant facing crap doesn't work properly with arced projectiles and doesn't seem to be -very- effective with everything else... I just don't find it reliable enough for something public.

As I said earlier, I am willing to add recycling, but it would only really be useful for those with non-arrow like projectiles (projectiles that can face any direction).

isUnitInHeightRange() does not seem to factor in terrain height properly

If you read the documentation, I think it says something about that method only being for simple vertical collision, because that stuff is basically impossible to do properly for multilpe maps (I am attempting to come up with something better).

For it to work properly you would need:

- A real array that stores the approximate height of every model (unit type) used in your map.
- Some way to set and access the array (unit indexing or raw code hashing).
- And then a function that does something similar to mine, but then uses the height of the target unit stores in the array.
- And some fancy terrain height stuff as well.

That is far to complex or static for a public system.
 

black.sheep

Active Member
Reaction score
24
Could you give us a simple Fire2dProjectile function? Or atleast explain to me how to fire a simple 2d projectile, I dont really get it.
 

Viikuna

No Marlo no game.
Reaction score
265
That instant facing crap doesn't work properly with arced projectiles and doesn't seem to be -very- effective with everything else... I just don't find it reliable enough for something public.


It does work properly. Whats exactly your problem with it?
 

Kenny

Back for now.
Reaction score
202
Could you give us a simple Fire2dProjectile function? Or atleast explain to me how to fire a simple 2d projectile, I dont really get it.

There is a demo spell in the map that does simple 2D projectiles. It is called Hurl Boulder.

It does work properly. Whats exactly your problem with it?

I cannot get it to work with arcing projectiles.

When using it with normal 2D projectiles, they all seem to face the ground instead of the target location.

Grim001 said himself that it is only worthwhile for projectiles that will only ever face one set of coordinates or one unit. He also said it doesn't work well with the SetUnitAnimationById() trick we all use.

Taken from his instant facing tutorial:

You can't use this instant facing stuff in conjunction with the dummy model's pitch animations.

So, this trick is only useful for projectiles that face one angle or follow one unit and never change from that until they get recycled.

To me it just doesn't seem stable enough for a public system..
 

Viikuna

No Marlo no game.
Reaction score
265
You are not supposed to call that SetUnitLookAt every .03 seconds, you know...

Just use it when SetUnitFacing is too slow. ( Projectile makes a sharp turn, or is recycled )


It works just fine.

The real problem manifests when you want to have roll rotation too. Then you must either use SetUnitPosition trick, which is fucking slow, or use some movable dummies to control your projectiles facing, which Im not sure if it works perfectly, though.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Then you must either use SetUnitPosition trick, which is fucking slow,
Yes, it is slower than SetUnitX+Y by 2700%+-
 

Viikuna

No Marlo no game.
Reaction score
265
Aye.

Thats why Id rather play with 2 dummies per projectile and control facing like that, if I wanted roll for projectiles.
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
But you don't need roll rotation - it's something so trivial.
 

Kenny

Back for now.
Reaction score
202
You are not supposed to call that SetUnitLookAt every .03 seconds, you know...

I know that. :)

I only ever used it when the units were recycled, still didn't look good. Arrows faced \ (down, but still kinda forward) instead of --- (straight forward).

I will try to make it work for the next update.

Thanks for your input. :)

Edit:

After extensive tests and studies, I have come to the conclusion that I am an idiot. :D

I have achieved making recycled projectiles face the correct direction immediately, and I am now working on a way to implement it in .modifyTargeting().

The easiest way to make it work, would be for it to take different arguments, such as: [ljass]modifyTargeting(distance,angle)[/ljass] where distance is the distance from the projectiles current coordinates and angle is pretty obvious. That would be instead of the current [ljass]modifyTargeting(xPos,yPos,zPos)[/ljass].

Thoughts anyone?
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
That would be good for making projectiles that turn.
 

Kenny

Back for now.
Reaction score
202
I am going to have to think hard about implementing [ljass]SetUnitLookAt()[/ljass] into the system.

Once you use [ljass]SetUnitLookAt()[/ljass] on a dummy unit, [ljass]SetUnitFacing()[/ljass] is just useless.

That makes things far more complex for homing missiles, as the system lets users add a target if they want, which means I might need an overhaul to that part of the interface..

Maybe some sort of [ljass]enableHoming(whichTarget)[/ljass] method or some type of method operator..

Basically if the system uses [ljass]SetUnitLookAt()[/ljass] at all, it cannot use [ljass]SetUnitFacing()[/ljass], otherwise you will run into graphics bugs.

Waiting for peoples opinions before I go any further with this.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top