• 🏆 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!

Mms 4d

Status
Not open for further replies.
Level 16
Joined
Jul 31, 2012
Messages
2,217
Just like before, when we started that awesome project which is KB3D, we will do this again! MMS 4D, will be the best (k lol) so i guess so.. let's see what we will get, Malhorne, Chobibo, welcome to the good old days!

First: Technique, which technique are we going to use? Linked List Plz :p but how will we start? from scratch (k too hard cuz it took more than a month to do the work for KB3D i seriously can't think of that with MMS 4D)? or convert the current system into libraries, structs, and stuff (i'm with that)?
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
Do a list of anything you need to load from the hashtable.
71 stuff are saved in the hashtable for each instant xD
can i be a little lazy and tell you that each thing is listed here:
JASS:
function KB3D_Registration takes nothing returns boolean
    local real Time
    local real R
    local real R1
    local real dx
    local real dy
    //------------------------
    if udg_KB3D_Unit == null then
        return false
    endif
    //------------------------
    if udg_KB3D_Fx_Attach != "" then
        set udg_KB3D_Fx = udg_KB3D_Fx_Attach
    endif
    //------------------------
    if udg_KB3D_Targeted_Unit != null and udg_KB3D_HomingMissile then
        set udg_KB3D_Zoffset = GetUnitFlyHeight(udg_KB3D_Targeted_Unit)
        set dx = GetUnitX(udg_KB3D_Unit)-GetUnitX(udg_KB3D_Targeted_Unit)
        set dy = GetUnitY(udg_KB3D_Unit)-GetUnitY(udg_KB3D_Targeted_Unit)
        if udg_KB3D_Zoffset == 0 then
            set udg_KB3D_Zoffset = 100
            set udg_KB3D_Range = SquareRoot( dx * dx + dy * dy)*1.25
        else
            set udg_KB3D_Range = SquareRoot( dx * dx + dy * dy)*2
        endif
        set udg_KB3D_KillatEnd = true
        set udg_KB3D_KillWhenHit = true
        set udg_KB3D_EndWhenHit = true
        set udg_KB3D_FaceAngle = true
        set udg_KB3D_UnpathableStop = false
    endif
    //------------------------
    set udg_KB3D_Arc = KB3D_InBetween(-10, udg_KB3D_Arc, 10)
    set udg_KB3D_AoEKB_Power = KB3D_InBetween(0.01, udg_KB3D_AoEKB_Power, 3)
    //------------------------
    if IsUnitType(udg_KB3D_Unit, UNIT_TYPE_FLYING) then
        set udg_KB3D_UnpathableStop = false
    endif
    //------------------------
    if (udg_KB3D_iKB) and udg_KB3D_Range < 0 then
        if ( udg_KB3D_Targeted_Unit == null ) then
            set udg_KB3D_Angle = udg_KB3D_Angle + 180
        else
            set udg_KB3D_Speed = -1*(udg_KB3D_Speed)
        endif
    endif
    //------------------------
    set udg_KB3D_Range = KB3D_InBetween(0.0000001, RAbsBJ(udg_KB3D_Range), RAbsBJ(udg_KB3D_Range))
    //------------------------
    if (udg_KB3D_iKB) and udg_KB3D_Speed < 0 then
        set udg_KB3D_Speed = KB3D_InBetween(udg_KB3D_Speed, udg_KB3D_Speed, -0.01)
    else
        set udg_KB3D_Speed = KB3D_InBetween(0.01, RAbsBJ(udg_KB3D_Speed), RAbsBJ(udg_KB3D_Speed))
    endif
    //------------------------
    set udg_KB3D_Counter = udg_KB3D_Counter + 1
    set udg_KB3D_Instances = udg_KB3D_Instances + 1
    call SaveBoolean(udg_KB3D_HA, -1, GetHandleId(udg_KB3D_Unit), true)
    call SaveBoolean(udg_KB3D_HA, 57, udg_KB3D_Counter, (udg_KB3D_Zoffset != 0))
    //------------------------
    if not udg_KB3D_iKB then
        set udg_KB3D_Zoffset = RAbsBJ(udg_KB3D_Zoffset)
    elseif GetUnitFlyHeight(udg_KB3D_Unit)+udg_KB3D_Zoffset < 0 then
        set udg_KB3D_Zoffset = -GetUnitFlyHeight(udg_KB3D_Unit)
    endif
    //------------------------
    set udg_KB3D_StopTime = RAbsBJ(udg_KB3D_StopTime)
    set udg_KB3D_KillatTime = RAbsBJ(udg_KB3D_KillatTime)
    set udg_KB3D_AoE = RAbsBJ(udg_KB3D_AoE)
    //------------------------
    //------------------------
    call SaveUnitHandle( udg_KB3D_HA, 0, udg_KB3D_Counter, udg_KB3D_Unit )
    call SaveReal( udg_KB3D_HA, 1, udg_KB3D_Counter, udg_KB3D_Range )
    call SaveReal( udg_KB3D_HA, 2, udg_KB3D_Counter, udg_KB3D_Speed * 0.031250000 )
    call SaveReal( udg_KB3D_HA, 4, udg_KB3D_Counter, udg_KB3D_Accel * 0.031250000 * 0.031250000 )
    //------------------------
    if ( udg_KB3D_Targeted_Unit == null ) then
        call SaveReal( udg_KB3D_HA, 5, udg_KB3D_Counter, udg_KB3D_Angle * 3.14159 / 180 )
    else
        call SaveUnitHandle( udg_KB3D_HA, 5, udg_KB3D_Counter, udg_KB3D_Targeted_Unit )
        set udg_KB3D_JumpOverCliff = false
    endif
    //------------------------
    call SaveBoolean( udg_KB3D_HA, 6, udg_KB3D_Counter, udg_KB3D_DisableUnit )
    call SaveBoolean( udg_KB3D_HA, 7, udg_KB3D_Counter, udg_KB3D_UnpathableStop )
    call SaveBoolean( udg_KB3D_HA, 8, udg_KB3D_Counter, udg_KB3D_DestroyTree )
    call SaveStr( udg_KB3D_HA, 9, udg_KB3D_Counter, udg_KB3D_Fx )
    call SaveStr( udg_KB3D_HA, 10, udg_KB3D_Counter, udg_KB3D_Attach )
    call SaveBoolean( udg_KB3D_HA, 45, udg_KB3D_Counter, udg_KB3D_Speed>0 )
    //------------------------
    //------------------------
    set udg_KB3D_Speed = KB3D_InBetween(0.01, RAbsBJ(udg_KB3D_Speed), RAbsBJ(udg_KB3D_Speed))
    //------------------------
    if ( udg_KB3D_Accel == 0.00 ) then
        set Time = udg_KB3D_Range / (udg_KB3D_Speed)//calculating time for the knockback if Acceleration = 0
    else
        if ( udg_KB3D_Accel > 0 ) then
            set Time = (-udg_KB3D_Speed-SquareRoot(udg_KB3D_Speed*udg_KB3D_Speed + 2*udg_KB3D_Accel*udg_KB3D_Range))/-udg_KB3D_Accel//calculating time for the knockback if Acceleration > 0*/
        endif
        if ( udg_KB3D_Accel < 0 ) then
            set Time = (-udg_KB3D_Speed+SquareRoot(udg_KB3D_Speed*udg_KB3D_Speed + 2*udg_KB3D_Accel*udg_KB3D_Range))/udg_KB3D_Accel            
        endif
    endif
    //------------------------
    call SaveReal( udg_KB3D_HA, 11, udg_KB3D_Counter, Time )
    call SaveBoolean( udg_KB3D_HA, 100, udg_KB3D_Counter, true )
    //------------------------
    if UnitAddAbility(udg_KB3D_Unit, 'Amrf') then
        call UnitRemoveAbility(udg_KB3D_Unit, 'Amrf')
    endif
    //------------------------
    call SaveReal( udg_KB3D_HA, 3, udg_KB3D_Counter, udg_KB3D_Zoffset )
    call SaveReal( udg_KB3D_HA, 12, udg_KB3D_Counter, (2*udg_KB3D_Zoffset / ( Time / 2)) )
    call SaveReal( udg_KB3D_HA, 13, udg_KB3D_Counter, ( -2 * udg_KB3D_Zoffset / ( Time / 2) ) / ( Time / 2) * 0.031250000 )
    //------------------------
    if not (udg_KB3D_TrailFx == "") and not (udg_KB3D_Attach == "") then
        call SaveEffectHandle(udg_KB3D_HA, 14, udg_KB3D_Counter, AddSpecialEffectTarget(udg_KB3D_TrailFx, udg_KB3D_Unit, udg_KB3D_Attach))
    endif
    //------------------------
    call SaveReal( udg_KB3D_HA, 15, udg_KB3D_Counter, GetUnitDefaultPropWindow(udg_KB3D_Unit) )
    call SaveBoolean(udg_KB3D_HA, 16, udg_KB3D_Counter, udg_KB3D_Speed_Changer)
    call SaveReal( udg_KB3D_HA, 17, udg_KB3D_Counter, udg_KB3D_ImpactDamage )
    call SaveReal( udg_KB3D_HA, 18, udg_KB3D_Counter, udg_KB3D_LoopDamage * 0.031250000 )
    call SaveReal( udg_KB3D_HA, 19, udg_KB3D_Counter, udg_KB3D_TargetDamage )
    call SaveInteger( udg_KB3D_HA, 20, udg_KB3D_Counter, GetHandleId(udg_KB3D_AttackType))
    call SaveInteger( udg_KB3D_HA, 21, udg_KB3D_Counter, GetHandleId(udg_KB3D_DamageType))
    call SaveUnitHandle( udg_KB3D_HA, 22, udg_KB3D_Counter, udg_KB3D_Damager )
    call SaveBoolean( udg_KB3D_HA, 23, udg_KB3D_Counter, true )
    call SaveBoolean( udg_KB3D_HA, 24, udg_KB3D_Counter, udg_KB3D_KillWhenHit )
    call SaveBoolean( udg_KB3D_HA, 25, udg_KB3D_Counter, udg_KB3D_EndWhenHit )
    // 26 used
    call SaveGroupHandle(udg_KB3D_HA, 27, udg_KB3D_Counter, CreateGroup() )
    call SaveReal( udg_KB3D_HA, 28, udg_KB3D_Counter, udg_KB3D_LineDamage )
    call SaveReal( udg_KB3D_HA, 29, udg_KB3D_Counter, RAbsBJ(udg_KB3D_AoE) )
    call SaveReal( udg_KB3D_HA, 30, udg_KB3D_Counter, udg_KB3D_Arc * (3.14159/180) )
    call SaveBoolean( udg_KB3D_HA, 31, udg_KB3D_Counter, udg_KB3D_FaceAngle )
    call SaveReal( udg_KB3D_HA, 32, udg_KB3D_Counter, udg_KB3D_AoEDamage )
    call SaveBoolean( udg_KB3D_HA, 33, udg_KB3D_Counter, udg_KB3D_KillifOutSider )
    //------------------------
    set udg_KB3D_AllowOutSiding = udg_KB3D_KillifOutSider
    //------------------------
    call SaveBoolean( udg_KB3D_HA, 34, udg_KB3D_Counter, udg_KB3D_AllowOutSiding )
    //------------------------
    set udg_KB3D_EndwhenDead = udg_KB3D_KillatTime > udg_KB3D_StopTime
    //------------------------
    call SaveBoolean( udg_KB3D_HA, 35, udg_KB3D_Counter, udg_KB3D_EndwhenDead )
    call SaveReal( udg_KB3D_HA, 36, udg_KB3D_Counter, udg_KB3D_KillatTime )
    call SaveReal( udg_KB3D_HA, 37, udg_KB3D_Counter, udg_KB3D_StopTime )
    call SaveReal( udg_KB3D_HA, 38, udg_KB3D_Counter, udg_KB3D_AoEEndDamage )
    call SaveBoolean( udg_KB3D_HA, 39, udg_KB3D_Counter, udg_KB3D_KBTarget )
    call SaveBoolean( udg_KB3D_HA, 40, udg_KB3D_Counter, udg_KB3D_AoEKB )
    //41 used
    call SaveStr(udg_KB3D_HA, 42, udg_KB3D_Counter, udg_KB3D_EndFx )
    call SaveReal( udg_KB3D_HA, 43, udg_KB3D_Counter, udg_KB3D_AoEKB_Power )
    call SaveBoolean( udg_KB3D_HA, 44, udg_KB3D_Counter, udg_KB3D_iKB )
    call SaveBoolean( udg_KB3D_HA, 46, udg_KB3D_Counter, udg_KB3D_KillatEnd )
    call SaveBoolean( udg_KB3D_HA, 47, udg_KB3D_Counter, udg_KB3D_GroundDamage )
    call SaveBoolean( udg_KB3D_HA, 48, udg_KB3D_Counter, udg_KB3D_D_STRUCTURE )
    call SaveBoolean( udg_KB3D_HA, 49, udg_KB3D_Counter, udg_KB3D_D_MECHANICAL )
    call SaveBoolean( udg_KB3D_HA, 50, udg_KB3D_Counter, udg_KB3D_D_MAGIC_IMMINUE )
    call SaveBoolean( udg_KB3D_HA, 51, udg_KB3D_Counter, udg_KB3D_D_ALLY )
    call SaveBoolean( udg_KB3D_HA, 52, udg_KB3D_Counter, udg_KB3D_JumpOverCliff )
    call SaveBoolean( udg_KB3D_HA, 53, udg_KB3D_Counter, false )
    call SaveStr( udg_KB3D_HA, 54, udg_KB3D_Counter, udg_KB3D_AoEEndFx )
    call SaveTriggerHandle( udg_KB3D_HA, 55, udg_KB3D_Counter, udg_KB3D_EndTrigger )
    call SaveBoolean( udg_KB3D_HA, 56, udg_KB3D_Counter, udg_KB3D_DestroyDestructables )
    //57 used
    call SaveStr( udg_KB3D_HA, 58, udg_KB3D_Counter, udg_KB3D_Line_Fx )
    call SaveReal( udg_KB3D_HA, 59, udg_KB3D_Counter, udg_KB3D_Bounce_Power )
    call SaveBoolean( udg_KB3D_HA, 60, udg_KB3D_Counter, udg_KB3D_Bounce_Unit )
    call SaveBoolean( udg_KB3D_HA, 61, udg_KB3D_Counter, udg_KB3D_Bounce_Target )
    call SaveStr( udg_KB3D_HA, 62, udg_KB3D_Counter, udg_KB3D_Bounce_Fx )
    call SaveBoolean( udg_KB3D_HA, 63, udg_KB3D_Counter, udg_KB3D_D_ENEMY )
    call SaveBoolean( udg_KB3D_HA, 64, udg_KB3D_Counter, udg_KB3D_D_RESISTANT )
    call SaveBoolean( udg_KB3D_HA, 65, udg_KB3D_Counter, udg_KB3D_D_FLYING )
    call SaveBoolean( udg_KB3D_HA, 66, udg_KB3D_Counter, udg_KB3D_EndOnObstacle )
    //------------------------
    if udg_KB3D_Bounce_Target then
        call SaveGroupHandle(udg_KB3D_HA, 67, udg_KB3D_Counter, CreateGroup())
    endif
    //------------------------
    call SaveReal( udg_KB3D_HA, 68, udg_KB3D_Counter, KB3D_GetCoordinatesZ(GetUnitX(udg_KB3D_Unit), GetUnitY(udg_KB3D_Unit)) )
    call SaveReal( udg_KB3D_HA, 69, udg_KB3D_Counter, KB3D_GetCoordinatesZ(GetUnitX(udg_KB3D_Unit), GetUnitY(udg_KB3D_Unit)) )
    call SaveBoolean( udg_KB3D_HA, 70, udg_KB3D_Counter, udg_KB3D_EndOnTargetBounce )
    call SaveReal(udg_KB3D_HA, 71, udg_KB3D_Counter, GetUnitFlyHeight(udg_KB3D_Unit))
    //------------------------
    if ( udg_KB3D_Counter == 1 ) then
        call TimerStart(udg_KB3D_Timer, 0.031250000, true, function KB3D_Loop_Actions )
    endif
    //------------------------
    set udg_KB3D_Time = Time
    //------------------------
    //------------------------
    call SaveInteger(udg_KB3D_HA, -5, GetHandleId(udg_KB3D_Unit), LoadInteger(udg_KB3D_HA, -5, GetHandleId(udg_KB3D_Unit))+1)
    call SaveBoolean(udg_KB3D_HA, GetHandleId(udg_KB3D_Unit), GetHandleId(udg_KB3D_Unit), true)
    //------------------------
    //------------------------
    //------------------------
    call KB3D_ClearVar()
    return false
endfunction
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
List of Stuff Saved in the Hashtable:


Units
  1. KBed Unit
  2. TargetedUnit
  3. Damager
Strings
  1. EndFx
  2. AoEEndFx
  3. Fx
  4. Attach
  5. BounceFx
  6. LineFx
Integers

  1. InstancesOnUnit (Table)
Groups


  1. BounceGroup
  2. LineDamageGroup
Types


  1. DamageType
  2. AttackType
Booleans

  1. IsUnitBeingKBed (Table)
  2. IsZNotNull
  3. DisableUnit
  4. UnpathableStop
  5. DestroyTrees
  6. IsSpeedPositive
  7. SpeedChanger
  8. HasBeenImpactDamaged
  9. KillWhenHit
  10. EndWhenHit
  11. FaceAngle
  12. KillIfOutsider
  13. AllowOutSiding
  14. EndWhenDead
  15. KBTarget
  16. AoEKB
  17. iKB
  18. KillAtEnd
  19. GroundDamage
  20. D_STRUCTURE
  21. D_MECHANICAL
  22. D_MAGIC_IMMINUE
  23. D_ALLY
  24. D_ENEMEY
  25. D_RESISTANT
  26. D_FLYING
  27. JumpOverCliff
  28. A Boolean (I'll see what it is for)
  29. DestroyDestructable
  30. BounceUnit
  31. BounceTarget
  32. EndOnObstacle
  33. EndOnTargetBounce
Reals
  1. Range
  2. Speed
  3. Acceleration
  4. Angle
  5. Time
  6. Zoffset
  7. ZSpeed
  8. ZAccel
  9. UnitPropWindow
  10. ImpactDamage
  11. LoopDamage
  12. TargetDamage
  13. LineDamage
  14. AoE
  15. ArcAngle
  16. AoEDamage
  17. KillAtTime
  18. StopTime
  19. AoEEndDamage
  20. AoEKBPower
  21. BouncePower
  22. LastTerrainZ
  23. InitialTerrainZ
  24. UnitInitialHeight
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Not talking about the list, I'm talking about the hashtable, as in Bribe's and Vexorian's Table, why would you need those?
 
Level 18
Joined
Sep 14, 2012
Messages
3,413
JASS:
struct MMS4D extends array
    private unit KBed_Unit
    private unit TargetedUnit
    private unit Damager
    
    private string EndFx
    private string AoEEndFx
    private string Fx
    private string Attach
    private string BounceFx
    private string LineFx

    private (static ?) integer InstanceOnUnits
    
    private static group BounceGroup (I really hope it is static)
    private static group LineDamageGroup (I really hope it is static)

    private boolean IsUnitBeingKbed
    private boolean IsZNotNull
    private boolean DisableUnit
    private boolean UnpathableStop
    private boolean DestroyTrees
    private boolean IsSpeedPositive
    private boolean SpeedChanger
    private boolean A Boolean
    private boolean KillWhenUnit
    private boolean EndWhenHit
    private boolean FaceAngle
    private boolean KillIfOutsider
    private boolean AllowOutSiding
    private boolean EndWhenDead
    private boolean KBTarget
    private boolean AoEKB
    private boolean iKB
    private boolean KillAtEnd
    private boolean GroundDamage
    private boolean D_STRUCTURE
    private boolean D_MECHANICAL
    private boolean D_MAGIC_IMMUNE
    private boolean D_ALLY
    private boolean D_ENEMY
    private boolean D_RESISTANT
    private boolean D_FLYING
    private boolean JumpOverCliff
    private boolean A Boolean
    private boolean DestroyDestructable
    private boolean BounceUnit
    private boolean BounceTarget
    private boolean EndOnObstacle
    private boolean EndOnTargetBounce

    private real Range
    private real Speed
    private real Acceleration
    private real Angle
    private real Time
    private real Zoffset
    private real ZSpeed
    private real ZAccel
    private real UnitPropWindow
    private real ImpactDamage
    private real LoopDamage
    private real TargetDamage
    private real LineDamage
    private real AoE
    private real ArcAngle
    private real AoEDamage
    private real KillAtTime
    private real StopTime
    private real AoEEndDamage
    private real AoEKBPower
    private real BouncePower
    private real LastTerrainZ
    private real InitialTerrainZ
    private real UnitInitialHeight

    private thistype prev
    private thistype next
   
    private static integer count 

    ...
endstruct
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
JASS:
    private boolean D_STRUCTURE
    private boolean D_MECHANICAL
    private boolean D_MAGIC_IMMUNE
    private boolean D_ALLY
    private boolean D_ENEMY
    private boolean D_RESISTANT
    private boolean D_FLYING

That's gonna have problems on submission dude, you know the rules.

@chobi, no, if it was ONLY for me to use it, i will not use a unit indexer
Don't tell that to me, tell the mods, that's how they want things with vjass.

EDIT: If you're going to think like that, might as well drop this system, vjass exists so that people could reuse code, not the other way around.
 
Level 18
Joined
Sep 14, 2012
Messages
3,413
Hashtables are slow so table are.

Unit Indexer isn't really needed.
I found a way to not use unit indexer by using a group.

JASS:
struct Test extends array
    unit caster
    real temp
    static timer period = CreateTimer()
    static group g = CreateGroup()
    //! runtextmacro LL_Alloc()
    
    static method periodic takes nothing returns nothing
        local thistype this = first
        loop
            exitwhen this == 0
            set this.temp = this.temp - 0.0312500
            if this.temp <= 0 then
                call GroupRemoveUnit(g,this.caster)
                call this.unchain()
                call this.deallocate()
                if empty() then
                    call PauseTimer(period)
                endif
            endif
            set this = this.next
        endloop
    endmethod

    static method add takes unit u, real temp returns nothing
        local thistype this = thistype.allocate()
        set this.caster = u
        set this.temp = temp
        call GroupAddUnit(g, u)
        if empty() then
           call TimerStart(period, 0.0312500, true, function thistype.periodic)
        endif
        call this.chain() 
    endmethod
endstruct
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Just lowercase them.. (If that's the prob)
That is the problem, you know how strict the standards are. That was just a heads up.

And what is the prob with using table?
Because a unit indexer is far more efficient, the mods will tell you to use it. Personally, I'd rather use a hashtable too, because I hate dependencies.

@Malhorne: That is slower, IsUnitInGroup isn't O(1), actually it gets worse (O(N) as opposed to O(log N), I dunno why so don't ask me haha xD) as the number of units increase. I'd rather use a hashtable.

EDIT: You guys could ask Troll-Brain, he knows a lot of things.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Yeah, but you can't attach data to units using a group Mal, you'd still need a hashtable or a UnitUserData (which implies a unit indexer library) for that.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
• You don't need to attach 2 values, just one integer, the struct instance.

So, hashtables? No delendecies of other libraries
• Expect the mods to insist using a unit indexer. Don't worry though, Mal got his way after all haha xD

a static variable and a non static one
• A static member isn't an array.
static group TempGroup = group TempGroup
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Struct Instance; saving to a hashtable:

JASS:
struct data
 boolean flying
 integer kbCounter
endstruct

function ...
 local data this = LoadInteger(...)
endfunction

function ...
 local data this = data.create()
 set this.flying = true
 set this.kbCounter = 0
 call SaveInteger(...,this)
endfunction
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
i made the new terrain :3
wfhe.png
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
up until now, is there something wrong?
JASS:
library MMS4D

globals
    public real Range
    public real Speed
    public real Angle
    public real BouncePower
    public real Arc
    public real AoEEndFx
    public real AoEEndDamage
    public real AoEKBPower
    public real EndOnTime
    public real KIllAtTime
    public real Accel
    public real AoE
    public real AoEDamage
    public real ImpactDamage
    public real LineDamage
    public real LoopDamage
    public real TargetDamage
    public real ZOffset
    public boolean T_Ally
    public boolean T_Mechanical
    public boolean T_Structure
    public boolean T_Enemy
    public boolean T_Flying
    public boolean T_MagicImminue
    public boolean w
    public boolean e
    public boolean r
    public boolean t
    public boolean y
    public boolean u
    public boolean i
    public boolean o
    public boolean p
    public boolean a
    public boolean s
    public boolean d
    public boolean f
    public boolean g
    public boolean h
    public boolean j
    public boolean k
    public boolean l
    public boolean z
    public boolean x
    public boolean c
    public boolean v
    public boolean b
    public boolean n
    public boolean m
endglobals

endlibrary
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Clarify your question, I didn't get it. I just saved 1 hashtable call, how is that adding more code?

EDIT: I'm getting a bit annoyed again, I'm sparing time for you instead of helping Wrathion. I'm teaching you how to use structs with hashtables efficiently and you blatantly throw it off my face saying I "added more code".
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
forget the hashtable for now
and see if there is any problem with making this:
JASS:
library MMS4D

globals
    public          real          Range                  =     0.00
    public          real          Speed                  =     0.00
    public          real          Angle                  =     0.00
    public          real          BouncePower            =     1.00
    public          real          Arc                    =     0.00
    public          real          AoEEndDamage           =     0.00
    public          real          AoEKBPower             =     1.00
    public          real          EndOnTime              =     0.00
    public          real          KIllAtTime             =     0.00
    public          real          Accel                  =     0.00
    public          real          AoE                    =     0.00
    public          real          AoEDamage              =     0.00
    public          real          ImpactDamage           =     0.00
    public          real          LineDamage             =     0.00
    public          real          LoopDamage             =     0.00
    public          real          TargetDamage           =     0.00
    public          real          ZOffset                =     0.00
//------------------------------------------------------------------
    public          boolean       T_Ally                 =     false
    public          boolean       T_Mechanical           =     false
    public          boolean       T_Structure            =     false
    public          boolean       T_Enemy                =     true
    public          boolean       T_Flying               =     false
    public          boolean       T_MagicImminue         =     false
    public          boolean       SpeedChanger           =     false
    public          boolean       HomingMissile          =     false
    public          boolean       BounceUnit             =     false
    public          boolean       BounceTarget           =     false
    public          boolean       EndOnTargetBounce      =     false
    public          boolean       DestroyDestructables   =     false
    public          boolean       EndOnObstacle          =     false
    public          boolean       AoEKB                  =     false
    public          boolean       EndWhenDead            =     true
    public          boolean       GroundDamage           =     false
    public          boolean       KBTarget               =     false
    public          boolean       KillAtEnd              =     false
    public          boolean       AllowOutsiding         =     false
    public          boolean       DestroyTrees           =     true
    public          boolean       DisableUnit            =     false
    public          boolean       EndWhenHit             =     false
    public          boolean       FaceAngle              =     false
    public          boolean       iMovement              =     true
    public          boolean       KillWhenHit            =     false
    public          boolean       KillIfOutsider         =     false
    public          boolean       JumpOverCliff          =     false
    public          boolean       UnpathableStop         =     true
endglobals

endlibrary
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
We can't forget it for now, because it's a vital part of your system.
And I'd rather use struct members for those, since those are instance data...
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
We can't forget it for now, because it's a vital part of your system.
i won't ignore it, i will go back to it after i've done basics
And I'd rather use struct members for those, since those are instance data...
i thought you were going to say this, those aren't for the instances or such, those are for setting the features, like when you usually do (in KB3D)
JASS:
set udg_KB3D_Unit = Unit
set udg_KB3D_Range = 900
set udg_KB3D_Speed = 1200
set udg_KB3D_Angle = 180
call ExecuteFunc("KB3D_Registration")

So it will look like this (in MMS4D)
JASS:
set MMS4D_Unit = unit
set MMS4D_Range = 900
set MMS4D_Speed = 1200
set MMS4D_Angle = 180
call MMS4D.Apply()
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
i thought you were going to say this, those aren't for the instances or such, those are for setting the features, like when you usually do (in KB3D)

Those are instance data... *sigh* because you set them before calling the system. Use static members. Also, drop that format, it sucks, use multiple methods for different purposes;

JASS:
 MM3D.missile
 MM3D.missile.move

 MM3D.kb
 MM3D.kb.move

 //etc...

Using that old method will be bad (slow execution), if you want to insist on that, don't use vjass, stay on jass.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
@Malhorne: Yeah, that was what I was saying.

EDIT:
I already told you, drop that technique (don't use it anymore), vjass can help you achieve the same technique without the performance issue... Those bulk data ain't going to be needed anymore. For example; a knockback can be called like so: MM3D.kb.apply(target_of_kb, distance, angle, other arguments)

EDIT: Hey Malhorne, I think Jad only trusts your opinion, so I'm leaving you with the rest.
 
Status
Not open for further replies.
Top