• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

KB3D - Knock back 3D

Status
Not open for further replies.
Level 16
Joined
Jul 31, 2012
Messages
2,217
Table of Version Contents:

1.0
Release!
1.1
6 new features, optimizations
1.2
Many Trigger Optimizations
1.3
10 new features, better scripting
1.4
Fixes, Approved!
1.5
7 new features, 1 new secondary features
Expected:

1.6
Unknown
1.7
Unknown
1.8
Preparing Bounce Feature [scripts will be created, and added as another feature]
1.9
Bounce Feature!
2.0
Knock-Back 4D!
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
LOL:
2HSio4B.png
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
hi guys, well, we haven't talked too much here lately...
i'll start the topic
KB3D v. 1.6.0
will have 2 new features, one of them is not underestimated;

1st: AoEKB_Power (the power of the AoE KB [ since AoEKB automatically chooses range, speed, Z and angle, it is now slightly configurable (range, speed and Z)])
2nd: iKB

iKB refers to intelligent KB
iKB will need a new triggering for the affected features:
what will it change:
it's a boolean, so if it is true:
  • Range, usually always positive, will be also possible for it to be negative, negative values will change the angle to backward (+180 degrees)
  • Speed, usually always positive will be available in negative values too, it doesn't change much in the system, just that the speed will be negative (backward movement)
  • Damages:
    AoEEndDamage, AoEDamage, LineDamage, ImpactDamage, TargetDamage
    All of Those ^ will turn intelligent and only Damage the target if and only if he is in approximate height of the KBed Unit, for example, in Infernal Cyclone, the spinning balls damage enemy land units even if they are flying, and damage flying units even if they are still on the ground, this will change with iKB
  • AoEKB, AoEKB will also not KB units that aren't in the approx height of the KBed Unit
More specs about the iKB may be added, those are the ones for the moment

Edit, added more specs
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
let's do as usual (sometimes :p)
Spherical:
What does it have?
Height Calculation:
what does it have?

for now i don't really understand the spherical thing you are talking about

and for my idea of height calculation, simple and effective:
if the height of the target unit is close enough to the height of the KBed unit, then the damage will occur, or else, nothing happens
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
iKB refers to intelligent KB
iKB will need a new triggering for the affected features:
what will it change:
it's a boolean, so if it is true:
  • Range, usually always positive, will be also possible for it to be negative, negative values will change the angle to backward (+180 degrees)
  • Speed, usually always positive will be available in negative values too, it doesn't change much in the system, just that the speed will be negative (backward movement)
  • Damages:
    AoEEndDamage, AoEDamage, LineDamage, ImpactDamage, TargetDamage
    All of Those ^ will turn intelligent and only Damage the target if and only if he is in approximate height of the KBed Unit, for example, in Infernal Cyclone, the spinning balls damage enemy land units even if they are flying, and damage flying units even if they are still on the ground, this will change with iKB
  • AoEKB, AoEKB will also not KB units that aren't in the approx height of the KBed Unit
More specs about the iKB may be added, those are the ones for the moment
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
JASS:
function KB3D_isPossiblePathability takes real x, real y, real RADangle, real MaxDist, real Arc returns boolean
    local real X = 0
    local real Y = 0
    local real dist
    loop
        exitwhen (dist >= MaxDist) or (KB3D_CW(X,Y))
        set dist = dist + 0.3125
        set RADangle = RADangle + 10*Arc
        set X = x + ( dist * Cos(RADangle) )
        set Y = y + ( dist * Sin(RADangle) )
    endloop
    return KB3D_CW(X,Y)
endfunction

function KB3D_canFlyover takes unit U, real S, real MaxT, real Angle, real Arc returns boolean
    return (GetUnitFlyHeight(U) > 150) and KB3D_isPossiblePathability(GetWidgetX(U),GetWidgetY(U), Angle, S*MaxT/0.03125, Arc)
endfunction

Those are two functions i just created, they are supposed (KB3D_canFlyover) to return a boolean to if it is possible to make the unit cross a cliff knowing that it is possible for him to stop in a pathable place

so what do you think?
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
JASS:
set udg_EventKBEnd=1.00

That will fire the Real Variable change event, that's all you need to do.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Group Enum + Dest Enum + Cliff Detection ? I remember doing that on a tank movement system (to detect which things I bump into)
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
Okay now that i have kept your attention

ignore this phrase ^ i was kidding ..

anyway:
I guess we will use:
FirstOfGroup (since we need only one target and not more) from enumed units in range
Destructables are destroyed if Destroy Tree is true, if not it is detected as unpathable, so it will go with cliff/unpathable detection"
which is easy as easy.. :p .. it is already implemented as Check Walkability from PnF


EDIT: Thanks for the native.. i think i will use it XD
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
@chobibo
Oh so it will detect the cliff level example:
JASS:
if GetTerrainCliffLevel ( My_KBedUnitX, My_KBedUnitY ) >= 1 then
    call BounceKBedUnit( My_KBedUnit, My_KB_BouncePower )
endif
Anyway Jad you notice "My_KB_BouncePower" right?
Is that will be added to a KB3D Bounce Features? or it depends like decreasing per bounce?.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
@jake you need to compare the cliff level where the unit is at to where the unit will go
JASS:
 if GetTerrainCliffLevel(x,y)==GetTerrainCliffLevel(newX,newY) then

In this case, you need to know if your going down a cliff, or going to hit a cliff wall so:

JASS:
 set level=GetTerrainCliffLevel(newX,newY)-GetTerrainCliffLevel(x,y)
 if level==0 then
  //same level
 elseif level>0 then
  //your going to hit a cliff wall
 else
  //your going down a pit
 endif
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
I need some help here, cuz i'm getting late with v. 1.8.0
So here is the first problem:
JASS:
function KB3D_ClosestUnit takes unit U, real x, real y, integer Loop returns unit
    local real max = 99999999
    local real r
    local group g = CreateGroup()
    local unit u
    call GroupEnumUnitsInRange(g, x, y, KB3D_GetUnitCollision(U)*2.5, function KB3D_True)
    loop
        set u = FirstOfGroup(g)
        call GroupRemoveUnit(g,u)
        if KB3D_Filter(u, U, Loop) then
            if not(LoadBoolean(udg_KB3D_HA, 44, Loop)) then
                //if 
            elseif KB3D_Approx(u, U, Loop) then
                //call UnitDamageTarget(Damager, U, LineD, true, false, AType, DType, WEAPON_TYPE_WHOKNOWS)
            endif
        endif
    endloop
    return u
endfunction

Okay, so this function is made for detecting the closest unit to a point, i got a response for this way before in time.. but the thread was removed from my subscription, and i forgot how it was done...

can someone fix it please, a ASAP is highly wanted :/
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Haha, one of my badass moments, the time where I could argue with guys like Maker... It's related to your closest unit function.
 
Status
Not open for further replies.
Top