System Projectile System

Reaction score
341
I'm not sure if your system has it or not, or if it's relevant to a projectile system.

But what about detecting collision between objects, that included destructables and walls.
 

Viikuna

No Marlo no game.
Reaction score
265
You could save projectiles data struct to its UnitUserData and make somekind of GroupProjectilesInRange -function, so people can easily group projectiles and change their values.

( Like move speed, to make spells like Slow Time in Diablo 3 trailer. )

Also, use only one unit type for projectiles. Vexorians dummy model with attached effect is good. It also has Z angle animations, which are useful for 3d arrows and stuff..
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
@Viikuna Maybe but if could also just use PUI and have an boolean array that sets to true for the projectiles upon creation.

It's up to the user if he wants to use the model since my system only takes a unit and then runs with that. If he wants to have a special dummy unit then he would just create it and attach the effects and then just modify it within the onLoop method.



@TriggerHappy This is not a physics system and if the user wanted to detect collisions then he would just code that into the onLoop method using whatever method he want.
 

Viikuna

No Marlo no game.
Reaction score
265
One dummy unit type allows you to use group all units of projectile unit type, with IsUnitInRangeXY to make GroupEnumProjectilesInRange..

Direct use of UnitUserData is better than PUI in this case, because these units are like private objects. ( Just make PUIs filter to ignore them, if you use PUI )

Also, your system should detect collinsion with unwalkable point and Extension library should have z angle calculations coded in it.

Also you should add homing missile support. ( xecollider has it and im planning to do it for my projectile system ) It couldt be an extending struct or something, so its easier for people to choose not to use it.

@TriggerHappy This is not a physics system and if the user wanted to detect collisions then he would just code that into the onLoop method using whatever method he want.

Physics systems do a lot more than detect collinsions. If you want this to be a projectile system, this should do everything that is needed for projectile usage. ( Add wrapper for IsTerrainWalkable, so people can choose which walkability check to use )
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
> One dummy unit type allows you to use group all units of projectile unit type, with IsUnitInRangeXY to make GroupEnumProjectilesInRange..

Then it's up the user to code his map to work that way and then use this system for the movement.

> Direct use of UnitUserData is better than PUI in this case, because these units are like private objects. ( Just make PUIs filter to ignore them, if you use PUI )

It's not since maybe he want to use PUI based stuff on the projectile that is not coded into his struct, then his stuff would just completely fail.

> Also, your system should detect collinsion with unwalkable point

onLoop method ftw?

> Extension library should have z angle calculations coded in it.

This is a framework for creating projectiles, not a take everything that any user might ever use and put in system. If you want that then use Caster System.

> Also you should add homing missile support. ( xecollider has it and im planning to do it for my projectile system ) It couldt be an extending struct or something, so its easier for people to choose not to use it.

It's already added, check the "SlideTowardsUnit" extension.

> Physics systems do a lot more than detect collinsions. If you want this to be a projectile system, this should do everything that is needed for projectile usage. ( Add wrapper for IsTerrainWalkable, so people can choose which walkability check to use )

Still, onLoop method ftw?
 
Reaction score
341
I'm using your system for a spell, this is a rough version of it, please tell me if I did anything wrong.

I'm pretty sure it's leaking, I don't destroy the struct.

JASS:
scope ArrowStorm initializer InitTrig

globals
    private constant integer RAW_CODE = 'A002'
    private constant integer DUMMY = 'h000'
    private constant integer ARROW_COUNT = 50
endglobals

private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == RAW_CODE
endfunction

function GetSpellTargetLocX takes location l returns real
    local real r = GetLocationX(GetSpellTargetLoc())
    call RemoveLocation(l)
    return r
endfunction

function GetSpellTargetLocY takes location l returns real
    local real r = GetLocationY(GetSpellTargetLoc())
    call RemoveLocation(l)
    return r
endfunction

private function Actions takes nothing returns nothing
    local player p = GetOwningPlayer(GetTriggerUnit())
    local real x = GetSpellTargetLocX(GetSpellTargetLoc())
    local real y = GetSpellTargetLocY(GetSpellTargetLoc())
    local integer i = 0
    local unit u
    local Jump j
    loop
        exitwhen i == ARROW_COUNT
        set u = CreateUnit(p, DUMMY, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()),0)
        call UnitApplyTimedLife(u, 'BTLF', 2)
        set j = Jump.create(u, true)
        call j.Jump(x, y, 10, 800)
        set i = i + 1
    endloop
endfunction

//===========================================================================
private function InitTrig takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(t, Condition(function Conditions))
    call TriggerAddAction(t, function Actions)
endfunction

endscope
 

Viikuna

No Marlo no game.
Reaction score
265
Still, onLoop method ftw?

You know what this means? People just try to use this, end up coding everything in onLoop and decide to make their own projectile system, because all this does is moving units in different ways, which alone is useless.

It's not since maybe he want to use PUI based stuff on the projectile that is not coded into his struct, then his stuff would just completely fail.

He is already extending Projectile struct, he should code that stuff into struct. If these missiles cant be killed by anything else but the system, using PUI ( or any other indexing system ) is useless, not needed.

Just do: SetUnitUserData(projectile.unit, integer( projectile ))
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
@Triggers first post:
You don't need to destroy it since:
JASS:
            if p.distLeft <= FINISH_THRESHOLD or p.end == true or b then
                if p.onReach.exists == true then
                    call p.onReach()
                endif
            
                call p.destroy() <--- Gets removed upon completion there.
                set Datas<i> = Datas[N]
                set N = N - 1
                if N == 0 then
                    call PauseTimer(T)
                endif
            else
                // Do the movement stuff
            endif
</i>


> I have a suggestion though, why don't you use PUI or UnitIndexingUtils to remove those O[N] searches?

I don't have any O[N] searches in the system.

> You know what this means? People just try to use this, end up coding everything in onLoop and decide to make their own projectile system, because all this does is moving units in different ways, which alone is useless.

It's alot easier to code something when you only need to add your own stuff, your code feels more personal and in the end it will be easier to search for errors.

> He is already extending Projectile struct, he should code that stuff into struct. If these missiles cant be killed by anything else but the system, using PUI ( or any other indexing system ) is useless, not needed.

Just do: SetUnitUserData(projectile.unit, integer( projectile )) (Quote ends here)



I will not limit the user in any way by forcing him to not use UnitUserData onto his projectiles, it should be up to the mapper himself to decide which way he wants to use it.
 

Viikuna

No Marlo no game.
Reaction score
265
Well, its your system, so you decide what you do to it.

But in its current state I would not use it, because its not complete, and I would have to add too much stuff to it.

Its a nice for moving units, but you rarely need to just move units, without having proper projectile methods.


And forcing user to use UnitUserData for missiles doesnt limit them in any way. If you can think any way it does, feel free to tell..
 
Reaction score
91
But then someone (like me) wouldn't use it because it would conflict with systems like PUI unless one edits the Proj system to fit his needs.
 

Viikuna

No Marlo no game.
Reaction score
265
Why would it conflict with PUI?
Doesnt PUI have somekind of filter for leaving dummies outside of the indexing system?

Using PUI for projectiles is just useless.. Direct use of UnitUserData makes it faster&simplier.
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
> But in its current state I would not use it, because its not complete, and I would have to add too much stuff to it.

Much stuff? If you want everything go and use Caster System, Vexorian even updated it to use Timer- and Grouputils now.


>Its a nice for moving units, but you rarely need to just move units, without having proper projectile methods.

Give me one case where you need Walkability detection and Group Projectiles in range.

> And forcing user to use UnitUserData for missiles doesnt limit them in any way. If you can think any way it does, feel free to tell..

I will not limit the user to use PUI or any other indexing system in any way. That is the point of being system independence, it wouldn't be system indepence if you limited the user.

> Gwypaas, just make two versions, pui Dependant, and not.

I will not make two versions.

> Why would it conflict with PUI?
Doesnt PUI have somekind of filter for leaving dummies outside of the indexing system?

Using PUI for projectiles is just useless.. Direct use of UnitUserData makes it faster&simplier.

Still I will not limit the user in any way.
 

Viikuna

No Marlo no game.
Reaction score
265
I dont like caster system because it has too much stuff I dont need.

Still I will not limit the user in any way.

Using user data does not limit user, because user has no need to attach anything to missiles, because system should already handle that ( by using UserData ).

Walkability check is needed for missiles that for example, bounce of from the walls.

GroupEnumProjectilesInRange would be nice for spells like SlowTime. ( makes all missiles move really slow in target AoE )
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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