System Projectile

Kenny

Back for now.
Reaction score
202
A bit more of an explanation:

  • ProjVisions: I think I have explained this in enough detail. Basically you call [ljass]proj.attachVision(600.00,true)[/ljass] for a projectile and that's it. The 600.00 refers to the vision radius, while the boolean parameter refers to whether you want the vision to linger after the projectile is destroyed (or if you remove vision via the detach method). Lingering vision lasts for 3.34 seconds (like many abilities from DotA and stuff).
  • ProjClasses: I think people are thinking to far into this. This module will basically only give a projectile struct 3 more members to play with (two string members and one integer member), they are:
    • [ljass]Instance.class[/ljass]: A string member that can be used abstractly in many different situations. For example: One may set it to "Fire" for one projectile and "Water" for another, giving each projectile an elemental classification that can be checked in grouping functions.
    • [ljass]Instance.label[/ljass]: A string member that can be set to a more specific classification of a projectile. For example, one can set [ljass].class[/ljass] to "Fire", but also set [ljass].label[/ljass] to "Fireblast", basically giving the projectile a name (often the name of the spell it comes from).
    • [ljass]Instance.power[/ljass]: The integer member that can be set to one of 6 predefined integers that determine the power level of a projectile (allowing stronger projectiles to destroy weaker ones and so on), they include:
      • [ljass]PROJECTILE_POWER_NONE[/ljass]
      • [ljass]PROJECTILE_POWER_VERY_WEAK[/ljass]
      • [ljass]PROJECTILE_POWER_WEAK[/ljass]
      • [ljass]PROJECTILE_POWER_MODERATE[/ljass]
      • [ljass]PROJECTILE_POWER_STRONG[/ljass]
      • [ljass]PROJECTILE_POWER_VERY_STRONG[/ljass]
  • ProjEffects: This module has not been completed yet, but it will include one extra effect attachment for a projectile (I think more than that is overkill, but two can be necessary). It will also include "flash" methods that can be used to quickly display (i.e. create then destroy) an effect at the current coordinates of a projectile. I might also add an [ljass]AddSpecialEffectZ()[/ljass] function to it, as it allows for much more accurate effect placement when projectiles are in mid-air.

----------------------------------------------------------------------------

@ Laiev:

ProjClasses is a very simple module because this type of thing changes from map to map. The module basically allows you to classify and individualise different projectiles without the need to use the [ljass]proj.attachData()[/ljass] method (to save it for something more important).

As it is only adding new members to the struct, it should be completely compatible with projgroups. You could use something like:

JASS:
function ForNearbyFunc takes nothing returns nothing
    if EnumProjectile.class == "Fire" then // Could also use: GetProjectileClass()
        call EnumProjectile.terminate()
    else
        // Do cool stuff here.
    endif
endfunction

// In some other function:
call GlobalProjGroup.forNearby(x,y,z,radius,data,ForNearbyFunc)

// Users can even develop a library full of constant globals that represent class types:
library ProjectileClassification

    // Classes:
    globals
        constant string PROJ_CLASS_FIRE = "Fire"
        constant string PROJ_CLASS_WATER = "Water"
        constant string PROJ_CLASS_EARTH = "Earth"
        constant string PROJ_CLASS_AIR = "Air"
    endglobals

    // Labels are more like individual names for projectiles to really individualise them (in case one spell specifically counters another).
    // But they can also be used for whatever the user wants.
endlibrary


@ BlackRose:

Don't go crazy yet, I don't think it is as cool as you wanted it to be, I got too tired. But it is new, and new things are inherently awesome.
 

Kenny

Back for now.
Reaction score
202
Bump.

Still looking for feedback on the above features.

I am getting pretty close to releasing the next version (v1.0.0), all that's needed is some new documentation and a couple hundred more tests and stuff.

ProjEffects now includes:

  • Methods to attach and detach an extra effect ([ljass]this.attachEffect[/ljass] and [ljass]this.detachEffect[/ljass]).
  • Methods to flash the death animation of an effect attached to a projectile or at a projectiles coordinates ([ljass]this.flashProj[/ljass] and [ljass]this.flashPoint[/ljass]).
  • Methods to project the trajectory of a projectile and create an AoE indicator using multiple effects ([ljass]this.displayTrajectory[/ljass] and [ljass]this.displayEffectArea[/ljass]), just for fun.
  • Boolean to check if a projectile has an extra effect attached and string that returns the model path of the extra effect ([ljass]this.hasEffect[/ljass] and [ljass]this.effectStr[/ljass]).
  • An [ljass]AddSpecialEffectZ[/ljass] function to more accurately create effects at the positions of projectiles.
 

Kenny

Back for now.
Reaction score
202
I think he means making the projectile invisible to (a) enemies of the owning player of the projectile, or (b) to all other players except the owning player of the projectile.

(a) Would require adding permanent invisibility to a projectile.
(b) Would require some tricky use of [ljass]GetLocalPlayer()[/ljass], which I don't want to do.

@ Laiev:

Is there anything you think the ProjClasses module should do that hasn't already been explained?
 

Laiev

Hey Listen!!
Reaction score
188
The missile sfx can be set'ed to "" if LocalPlayer (while setting the projectile), don't?

@Kenny

This:

PROJECTILE_POWER_NONE
PROJECTILE_POWER_VERY_WEAK
PROJECTILE_POWER_WEAK
PROJECTILE_POWER_MODERATE
PROJECTILE_POWER_STRONG
PROJECTILE_POWER_VERY_STRONG

Will be something 'global' right, I mean... while setting the projectile things, we can set they power too and then use it when we want? If so, I think its perfect right now.


EDIT: Ah.. I remember right now something (not a bug actually but is strange). If you set recycle to true, everytime (after the limit) you change the angle of the old missile, the missile start launching in wrong angle..

Example:

A = Unit Source
B = Unit Target
- = Missile
> = Angle of Missile 'Head'

Code:
A           -> B
B           -> A
B         <-   A

In my map, testing with Nasha, the glaive has a trail, so everytime the limit of missile reach, it will get the first glaive launched and will move to Nasha and then start the new launch, it create a giant trail between the death of first missile and new position of Nasha.
 

Kenny

Back for now.
Reaction score
202
Yeah using [ljass]GetLocalPlayer()[/ljass] isn't hard, I just didn't really want to do it, but it wouldn't take long. :) And yeah, you can basically set the model file string to "" for all players but the local player.

As for the power thing: Yes they will be globals that can be accessed at any time, you basically do this:

JASS:
// When setting up a projectile:

set p = projectile.create(...)
// etc.

set p.power = PROJECTILE_POWER_STRONG // &lt;--- Set the power here, then it can be accessed whenever you need it to be.
 

Laiev

Hey Listen!!
Reaction score
188
Have you read my Edit? :p

May I ask if you change something in p.projectNormal? Because I'm trying to change the targetx/y but it always run more then should and only stop in map bounds.


EDIT:

nvm... You just add the allowExpiration and I don't notice it :p
 

Kenny

Back for now.
Reaction score
202
Just read your edit. That is the only problem with recycling creeps. This system doesn't use [ljass]SetUnitLookAt()[/ljass], therefore, the projectiles that have previously been used in the system will be facing the same direction they were facing when they were destroyed.

Unfortunately the [ljass]SetUnitLookAt()[/ljass] method does not work well with homing and arcing projectiles, so I can't use it.

And yes you can just use the .allowExpiration member to make the projectile finish when it gets to the target location. You can also make the projectile target coordinates with a z height of 0.00, but that doesn't look as good.
 

Lmfaocj

Active Member
Reaction score
1
Omg thank you so much.
lol when i tested your demo map i was playing for about 30 minutes, it's so fun.
 

AgentChaos

New Member
Reaction score
1
PHP:
 method operator unitHitRadius= takes real value returns nothing
            if this.allowUnitCollisions then
                if this.unitTrig != null and this.uColl != value and value != 0.00 then
                    call TriggerClearConditions(this.unitTrig)
                    call DisableTrigger(this.unitTrig)
                    call DestroyTrigger(this.unitTrig)
                    set this.unitTrig = null
                endif
                if value != 0.00 and this.uColl != value then
                    set this.uColl    = value
                    set this.unitTrig = CreateTrigger()
                    call SaveInteger(StorageOne,GetHandleId(this.unitTrig),0,this)
                    call TriggerRegisterUnitInRange(this.unitTrig,this.dummy,this.uColl,null)
                    call TriggerAddCondition(this.unitTrig,thistype.unitFilt)
                endif
            endif
        endmethod
in your this code ,TriggerRegisterUnitInRange has a problem
if range >=500 and use AOE Damage not working well,and speed >=1200,AOE Damage unit also miss filter!!!
 

BlackRose

Forum User
Reaction score
239
The next version (if it comes T__T) checks for units differently, it no longer uses that TriggerRegisterUnitInRange nonsense. It uses GroupEnum functions, if I remember correctly. I've seen the next version :D
 

Red_drake

New Member
Reaction score
4
Hey, so im using this system in your map, and i came across a bug.

whenever i compress my map using Vexorian's optomizer, it no longer works. The map acts like maps with an unfixed Return Bug do.
Now, i dont think i have the most current version, but Im wondering if this is a known issue, or if its been fixed, or what?
 

Bribe

vJass errors are legion
Reaction score
67
Don't use "compress names" as it makes native declarations unusable as it STUPIDLY changes the name of the declared native.
 

jrhetf4xb

Member
Reaction score
12
I've also had problems with "Optimize script" so if the above doesn't work, try removing this one as well.
 

Red_drake

New Member
Reaction score
4
how much compression would i lose if i didnt "Compress Names"?
because im already tight on map space >.>

EDIT:
well, unchecking "Compress Names" worked. thanks :D
 

Bribe

vJass errors are legion
Reaction score
67
Using native WC3 skins instead of custom skins (imported files) clears up your map file size.

Using as little custom object editor data as possible also clears it up.
 

Buzzard

New Member
Reaction score
1
What units does [ljass]set this.allowUnitCollisions = true[/ljass] detect? It seems weird, I once made it hit nothing but the target of the projectile, and now it keeps hitting the caster.

Oh, and this thing is great.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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