1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. The 15th Mini-Mapping Contest came to an end. The Secrets of Warcraft 3 are soon to be revealed! Come and vote in the public poll for your favorite maps.
    Dismiss Notice
  3. The 12th incarnation of the Music Contest is LIVE! The theme is Synthwave. Knight Rider needs a song to listen to on his journey. You should definitely have some fun with this theme!
    Dismiss Notice
  4. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Building birth problems

Discussion in 'World Editor Help Zone' started by xYours Trulyx, Feb 6, 2016.

  1. xYours Trulyx

    xYours Trulyx

    Joined:
    Jan 9, 2016
    Messages:
    794
    Resources:
    0
    Resources:
    0
    How do we change the building birth effects for each building?Does is depends on the building's race?
     
  2. Legal_Ease

    Legal_Ease

    Joined:
    Feb 8, 2013
    Messages:
    1,455
    Resources:
    28
    Icons:
    11
    Packs:
    1
    Skins:
    2
    Maps:
    10
    Template:
    1
    Tutorials:
    3
    Resources:
    28
    Birth "effects" as you called them are actually part of the model. It is a sequence of the models animation. Models often have several animations, i.e. attack, stand, death, birth, etc. Only some doodads and effects have only one animation. All building's in the default version of Blizzard's Warcraft III have only one birth animation which it the same for the race. So you can't "change it" without editing the model. You can, however, add animation models with triggers to create the appearance of a specific birth animation. Since it is shared, you might use it for all the buildings you want to "change."

    There are 3 such models "hidden" in the game and you can use them by referencing the pathname. These pathnames are as follows:

    SharedModels\NEBirth.mdl
    SharedModels\UBirth.mdl
    buildings\naga\TidalGuardian\NagaBirth_Small

    Other models can be imported and are available in our model section:

    http://www.hiveworkshop.com/forums/models-530/forgotten-one-birth-64872/?prev=search%3Dbirth%26d%3Dlist%26r%3D20
    http://www.hiveworkshop.com/forums/models-530/birth-mesh-161322/?prev=search%3Dbirth%26d%3Dlist%26r%3D20
    http://www.hiveworkshop.com/forums/models-530/nerubian-birth-267174/?prev=search%3Dbirth%26d%3Dlist%26r%3D20
    http://www.hiveworkshop.com/forums/models-530/ne_birth_corrupt-110551/?prev=search%3Dbirth%26d%3Dlist%26r%3D20

    I hope I helped answer your question.
     
  3. xYours Trulyx

    xYours Trulyx

    Joined:
    Jan 9, 2016
    Messages:
    794
    Resources:
    0
    Resources:
    0
    Technically, you did answered my question.Since the effects are part of the model,I can't do anything about it.I'll figure it out in the trigger section.Until then,have a rep.
    -Solved
     
  4. WereElf

    WereElf

    Joined:
    Jan 2, 2016
    Messages:
    953
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I kind a want to do the same thing on my map.
    Can you post the trigger(s) how to do this?

    And some of the buildings I'm building don't have birth animation - they look "already build" when I start building them. Would doing it this way just add the birth model, or will it REPLACE their model (during building)?
     
  5. xYours Trulyx

    xYours Trulyx

    Joined:
    Jan 9, 2016
    Messages:
    794
    Resources:
    0
    Resources:
    0
    It's a working progress.But maybe this would help.Just read its description.
     
  6. WereElf

    WereElf

    Joined:
    Jan 2, 2016
    Messages:
    953
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Yes, this helped :)
    + rep

    The only thing that is bothering me now is the "building stages"
    the animation has several stages, but with this trigger - it will just end before the animation is over, or it may even start another animation before the building is built... Is there any way to control the animation speed?
     
  7. xYours Trulyx

    xYours Trulyx

    Joined:
    Jan 9, 2016
    Messages:
    794
    Resources:
    0
    Resources:
    0
    Hmm...I do believe you must make dummies to control the animation speed.
     
  8. WereElf

    WereElf

    Joined:
    Jan 2, 2016
    Messages:
    953
    Resources:
    1
    Spells:
    1
    Resources:
    1
    You mean:
    Event: a unit starts construction
    Actions: make the structure transparent
    create 1 dummy builder at temp_point (location of construction)
    if Constructing Structure unit-type is equal to '1'
    order last created unit to build '1(model)'
    elseif constructing structure unit-type is equal to '2'
    order last created unit to build '2(model)'
    etc..?

    Where '1(model) has build time equal to '1's build time, and the desired construction model, and locust ability.

    EDIT: Actually no need to answer.. I guess I'll just try it myself. I got enough information now :p
     
  9. Legal_Ease

    Legal_Ease

    Joined:
    Feb 8, 2013
    Messages:
    1,455
    Resources:
    28
    Icons:
    11
    Packs:
    1
    Skins:
    2
    Maps:
    10
    Template:
    1
    Tutorials:
    3
    Resources:
    28
    This is how I did it, but I am sure there is a better way.
    simple way
    • Hut Birth
      • Events
        • Unit - A unit Begins construction
      • Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • (Unit-type of (Constructing structure)) Equal to Pandaren Hut
            • (Unit-type of (Constructing structure)) Equal to Death Tower
      • Actions
        • Set tempp1 = (Position of (Constructing structure))
        • Unit - Create 1 Build Dummy for Neutral Passive at tempp1 facing Default building facing degrees
        • Unit - Add a 37.00 second Generic expiration timer to (Last created unit)
        • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 70.00%, 100.00%) with 0.00% transparency
        • Special Effect - Create a special effect attached to the origin of (Last created unit) using SharedModels\NEBirth.mdl
        • Set T_Fx[(Integer((X of tempp1)))] = (Last created special effect)
        • Custom script: call RemoveLocation(udg_tempp1)


    • Birth Animation Stop
      • Events
        • Unit - A unit Finishes construction
        • Unit - A unit Cancels construction
        • Unit - A unit Dies
      • Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • (Unit-type of (Triggering unit)) Equal to Pandaren Hut
            • (Unit-type of (Triggering unit)) Equal to Death Tower
            • (Unit-type of (Constructing structure)) Equal to Corruption Tower
      • Actions
        • Set tempp1 = (Position of (Triggering unit))
        • Special Effect - Destroy T_Fx[(Integer((X of tempp1)))]
        • Custom script: call RemoveLocation(udg_tempp1)

    It's not perfect, but it looks alright. I used the NE birth animation to create a birth for the fishing villiage huts.

    Another way I did this for a different unit was to slowly increase the size of the unit being built.

    This was a Goblin Hut. I make it small and added a dust animation. It looks the the birth animation from the Dalaran Ruins tower birth.
    slightly more advanced way
    • Goblin birth animation
      • Events
        • Unit - A unit Begins construction
      • Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • (Unit-type of (Constructing structure)) Equal to Goblin Hut
            • (Unit-type of (Constructing structure)) Equal to Goblin Factory
      • Actions
        • Set GH_Int = (GH_Int + 1)
        • Set GH_Counter[GH_Int] = 100
        • Set GH_Hut[GH_Int] = (Constructing structure)
        • Set GH_Loc[GH_Int] = (Position of GH_Hut[GH_Int])
        • Unit Group - Add GH_Hut[GH_Int] to GH_Group
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Constructing structure)) Equal to Goblin Hut
          • Then - Actions
            • Animation - Play GH_Hut[GH_Int]'s stand work animation
          • Else - Actions
        • Custom script: call RemoveLocation(udg_GH_Loc[udg_GH_Int])
        • Trigger - Turn on GH birth animation loop <gen>

    • GH birth animation loop
      • Events
        • Time - Every 0.50 seconds of game time
      • Conditions
      • Actions
        • For each (Integer GH_LoopIndex) from 1 to GH_Int, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • GH_Counter[GH_LoopIndex] Greater than 0
                • (GH_Hut[GH_LoopIndex] is alive) Equal to True
              • Then - Actions
                • Set GH_Fx[GH_LoopIndex] = (Last created special effect)
                • Set GH_Counter[GH_LoopIndex] = (GH_Counter[GH_LoopIndex] - 1)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Unit-type of GH_Hut[GH_LoopIndex]) Equal to Goblin Hut
                  • Then - Actions
                    • Animation - Change GH_Hut[GH_LoopIndex]'s size to ((60.00 - ((Real(GH_Counter[GH_LoopIndex])) x 0.60))%, 100.00%, 100.00%) of its original size
                  • Else - Actions
                • Special Effect - Create a special effect attached to the origin of GH_Hut[GH_LoopIndex] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
                • Set GH_Fx[GH_LoopIndex] = (Last created special effect)
                • Special Effect - Destroy GH_Fx[(GH_LoopIndex - 1)]
              • Else - Actions
                • Special Effect - Destroy GH_Fx[GH_LoopIndex]
                • Unit Group - Remove GH_Hut[GH_LoopIndex] from GH_Group
                • Set GH_Hut[GH_LoopIndex] = No unit
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Number of units in GH_Group) Equal to 0
                  • Then - Actions
                    • Trigger - Turn off (This trigger)
                    • Set GH_Int = 0
                  • Else - Actions
    I hadn't learned to de-index properly back then, but that's the basic idea.

    The other way would be to edit the model with a third-party model editing program.
     
  10. xYours Trulyx

    xYours Trulyx

    Joined:
    Jan 9, 2016
    Messages:
    794
    Resources:
    0
    Resources:
    0
    I will keep it simple (from Bribe) as possible,so I'll take the first way.
     
  11. Legal_Ease

    Legal_Ease

    Joined:
    Feb 8, 2013
    Messages:
    1,455
    Resources:
    28
    Icons:
    11
    Packs:
    1
    Skins:
    2
    Maps:
    10
    Template:
    1
    Tutorials:
    3
    Resources:
    28
    The loop is nice because it lets the building grow out of the animation.

    The first one just adds the two together. It looks so-so, but better than nothing.

    You could even make it so the building was semi-transparent like the UD birth instead of (or in addition to) growing.
     
  12. xYours Trulyx

    xYours Trulyx

    Joined:
    Jan 9, 2016
    Messages:
    794
    Resources:
    0
    Resources:
    0
    naaahhh,still prefers the simplest way possible
     
  13. WereElf

    WereElf

    Joined:
    Jan 2, 2016
    Messages:
    953
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Code (vJASS):
    function UT_Comparison takes integer ut returns integer
        if ut == 'n00N' then
            return 1
        elseif ut == 'n002' or ut == 'n00O' then
            return 2
        elseif ut == 'n00M' or ut == 'e005' then
            return 3
        elseif ut == 'n00P' then
            return 4
        endif
        return 0
    endfunction

    function Cosmetics takes nothing returns boolean
        local unit u = GetTriggerUnit()
        local real x = GetUnitX(u)
        local real y = GetUnitY(u)
        local unit c
        local integer i = UT_Comparison(GetUnitTypeId(u))
        if i != 0 then
            call SetUnitVertexColor( u , 100, 100, 100, 1 )
            set c = CreateUnit( GetOwningPlayer(u), 'n01F', x , y , 0.00 )
            if i == 3 then
                call SetUnitScalePercent( c , 100, 100, 100 )
            elseif i == 4 then
                call SetUnitScalePercent( c , 160, 160, 160 )
            endif
            call SetUnitAnimation( c , "birth" )
            call SaveUnitHandle(udg_Cosmetic_Table, GetHandleId(u), 0 , c)
        endif
        return false
    endfunction

    function Cosm_Removal1 takes nothing returns boolean
        local unit u = GetTriggerUnit()
        local unit c
        local real x
        local real y
        local integer i = UT_Comparison(GetUnitTypeId(u))
        if i != 0 then
            set c = LoadUnitHandle(udg_Cosmetic_Table, GetHandleId(u), 0 )
            call RemoveUnit(c)
            call SetUnitVertexColorBJ( u , 100, 100, 100, 0.00 )
            if i == 1 then
                set x = GetUnitX(u) - 110
                set y = GetUnitY(u) + 25
                set c = CreateUnit( GetOwningPlayer(u), 'h00F', x, y, 270.00 )
                call SaveUnitHandle( udg_Cosmetic_Table, GetHandleId(u), 0 , c )
            endif
            call SaveBoolean( udg_Cosmetic_Table, GetHandleId(u), 1, true )
            set c = null
        endif
        set u = null
        return false
    endfunction

    function Cosm_Removal2 takes nothing returns boolean
        local unit u = GetTriggerUnit()
        local unit c
        local real x
        local real y
        local effect e
        local integer i = UT_Comparison(GetUnitTypeId(u))
        if i != 0 then
            if LoadBoolean( udg_Cosmetic_Table, GetHandleId(u), 1 ) then
                if i == 1 then
                    set c = LoadUnitHandle(udg_Cosmetic_Table, GetHandleId(u), 0 )
                    set x = GetUnitX(c)
                    set y = GetUnitY(c)
                    call RemoveUnit(c)
                    set e = AddSpecialEffect("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", x, y)
                    call DestroyEffect(e)
                    set e = null
                endif
            else
            set c = LoadUnitHandle(udg_Cosmetic_Table, GetHandleId(u), 0 )
            call RemoveUnit(c)
            call FlushChildHashtable(udg_Cosmetic_Table, GetHandleId(u))
            set c = null
            endif
        endif
        set u = null
        return false
    endfunction

    //===========================================================================
    function InitTrig_Building_models takes nothing returns nothing
        local trigger t = CreateTrigger()
        local trigger r = CreateTrigger()
        set gg_trg_Building_models = CreateTrigger(  )
        call TriggerRegisterAnyUnitEventBJ( gg_trg_Building_models, EVENT_PLAYER_UNIT_CONSTRUCT_START )
        call TriggerAddCondition( gg_trg_Building_models, Condition(function Cosmetics) )
        call TriggerRegisterAnyUnitEventBJ( r , EVENT_PLAYER_UNIT_DEATH )
        call TriggerRegisterAnyUnitEventBJ( t , EVENT_PLAYER_UNIT_CONSTRUCT_FINISH )
        call TriggerRegisterAnyUnitEventBJ( r , EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL )
        call TriggerAddCondition( t , Condition(function Cosm_Removal1) )
        call TriggerAddCondition( r , Condition(function Cosm_Removal2) )
        set t = null
        set r = null
    endfunction
     

    That's what I'm doing (still got work on it, but from my tests so far - it looks nice) :)
     
    Last edited: Feb 6, 2016
  14. xYours Trulyx

    xYours Trulyx

    Joined:
    Jan 9, 2016
    Messages:
    794
    Resources:
    0
    Resources:
    0
    I'm not really a JASS user,but whatever it is you're doing,keep up the good work
     
  15. WereElf

    WereElf

    Joined:
    Jan 2, 2016
    Messages:
    953
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Okay, now I have another problem...
    When I replace the night elf's building animation with human building animation - the special effect still remains - it looks like a human construction with green glow above it.. any way to get rid of this?
     
  16. xYours Trulyx

    xYours Trulyx

    Joined:
    Jan 9, 2016
    Messages:
    794
    Resources:
    0
    Resources:
    0
    I absolutely have no idea about what do to with it.One of the ways that I know is by using model editor.launch your model,go to Windows > Texture Manager and find anything texture that are related to green.Replace it with a blank image.That is all I know.Are you choosing green TC when testing it?
     
  17. WereElf

    WereElf

    Joined:
    Jan 2, 2016
    Messages:
    953
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Well, I think it's more like a lightning effect, related to the model. Not so much a 'model' itself.
     
  18. xYours Trulyx

    xYours Trulyx

    Joined:
    Jan 9, 2016
    Messages:
    794
    Resources:
    0
    Resources:
    0
    That's all the knowledge I can offer.You should go create a thread discussing about deleting that little glow at Warcraft Editing Tools topic.