• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[Unsolved] Can't make refinery

Status
Not open for further replies.
Level 27
Joined
Jul 6, 2008
Messages
11,324
I have automated refinery and basic terran refinery converted into unit production structures, and I set both to play work animation while training, but for some reason regular refinery doesn't work, unlike automated refinery. Any idea what is wrong?

Automated refinery:
23anKz5.png


Refinery:
XC4P8ca.png
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,156
I am guessing it might have something to do with either not firing the event (maybe "any" is not supported for train event?) or that it is not seeing "Work D" as a valid animation.

Try applying "Work D". Or adding animation group D.

Animations are very tricky to get right. I am still learning them slowly.
 
Level 27
Joined
Jul 6, 2008
Messages
11,324
I am guessing it might have something to do with either not firing the event (maybe "any" is not supported for train event?) or that it is not seeing "Work D" as a valid animation.

Try applying "Work D". Or adding animation group D.

Animations are very tricky to get right. I am still learning them slowly.
Nope, it didn't work with event change, I had it previously set to be BarracksTrain already, this was just an experiment to see if it works this way. Also, changing it to Work D didn't change anything either, unfortunately.

Also, there is Work D and Work D 01, while automated refinery has only Work D, maybe that has something to do with it.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,156
Also, there is Work D and Work D 01, while automated refinery has only Work D, maybe that has something to do with it.
That is what animation groups are for. They specify a generic animation to play (eg attack). Which variant (00, 01, 02 etc) plays is then chosen based on animation properties such as frequency. This allows one to have rare animations such as a dog scratching itself or sniffing its behind that only get seen once in a blue-moon.

Using the explicit "play animation" you should be able to select specific animations from an animation group to play.
 
Level 27
Joined
Jul 6, 2008
Messages
11,324
That is what animation groups are for. They specify a generic animation to play (eg attack). Which variant (00, 01, 02 etc) plays is then chosen based on animation properties such as frequency. This allows one to have rare animations such as a dog scratching itself or sniffing its behind that only get seen once in a blue-moon.

Using the explicit "play animation" you should be able to select specific animations from an animation group to play.

Hmm, so play animation works only with specific animations, yes? Since I would prefer both animation (one has left robotic arm pick up the barrel, another has right arm pick up a barrel).

Anyways, um, any clue what else can be wrong if this yields no results either?
kk4uBV5.png
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,156
You will have to post the map with the refineries in it. Without being able to see all the events, and all macros attached to the refinery actors I cannot rule out that actions are not interfering with your animation play.

Specifically since the animation has barrels coming out of both sides. It sounds like it could require special ordering (to make sure a barrel does not come out of only one side). As such there might be more to it than simple animation playing.
 
Level 27
Joined
Jul 6, 2008
Messages
11,324
You will have to post the map with the refineries in it. Without being able to see all the events, and all macros attached to the refinery actors I cannot rule out that actions are not interfering with your animation play.

Specifically since the animation has barrels coming out of both sides. It sounds like it could require special ordering (to make sure a barrel does not come out of only one side). As such there might be more to it than simple animation playing.
There you go!
 

Attachments

  • NationBuilderII.SC2Map
    157.1 KB · Views: 65

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,156
Problem is because of how the work animation is implemented on the model. Automated refinery uses standard work animation practice of looping. The normal refinery has non-looping work animations.

However with a bit of hacking around I present to you the solution.
Code:
    <CActorUnit id="Refinery">
        <On index="71" Terms="UnitDeathCustomize; Option Model Low" Send="DeathCustomize Low"/>
        <On index="72" Terms="AbilTrain.BarracksTrain.Start" Send="Signal DoWork"/>
        <On index="73" Terms="AbilTrain.BarracksTrain.Finish" Send="AnimClear Work"/>
        <On index="74" Terms="AbilTrain.BarracksTrain.Cancel" Send="AnimClear Work"/>
        <On index="75" Terms="ActorCreation" Send="AnimGroupRemove A"/>
        <On index="76" Terms="ActorCreation" Send="AnimGroupRemove B"/>
        <On index="77" Terms="Signal.*.DoWork; IsStatus WorkVar 0" Send="AnimPlay Work Work,D,00"/>
        <On index="78" Terms="Signal.*.DoWork; IsStatus WorkVar 1" Send="AnimPlay Work Work,D,01"/>
        <On index="79" Terms="AnimDone.*.Complete; AnimName Work" Send="StatusIncrement WorkVar"/>
        <On index="80" Terms="AnimDone.*.Complete; AnimName Work; IsStatus WorkVar 2" Send="StatusSet WorkVar 0"/>
        <On index="81" Terms="AnimDone.*.Complete; AnimName Work" Send="Signal DoWork"/>
        <On index="82" removed="1"/>
        <On index="83" removed="1"/>
        <On index="84" removed="1"/>
        <Scale value="0.660000"/>
        <DeathActorModelLow value="UnitDeathModel"/>
        <PlacementModel value="ShapeX2"/>
        <PortraitModel value="CivilianBlurredPortrait"/>
        <StatusBarOn index="Progress" value="1"/>
    </CActorUnit>
Paste this over the Refinery actor entry in your map. To do this open Data editor, go to actor catalog and then enable XML View (either from menus or with hotkey Ctrl + 3). Paste over the current entry (which runs from opening tag to closing tag).

How it works is that it explicitly plays the Word D animation. When any Work D animation expires it plays Work D again. So that it reliably varies which side it uses a Status is kept by the actor. This is incremented after every work animation completion and bounded to have values of only 0 and 1. To prevent action duplication a signal to play work animation is used so that the animation sequence can be started initially when training begins and so that it can be looped once it finishes. In response to the signal it either players variation 0 of the animation or variation 1 depending on what the current status is.

Result is that when training a Marine from it, canisters appear to be constantly loaded into the middle section from both sides in sequence.
 
Level 27
Joined
Jul 6, 2008
Messages
11,324
Problem is because of how the work animation is implemented on the model. Automated refinery uses standard work animation practice of looping. The normal refinery has non-looping work animations.

However with a bit of hacking around I present to you the solution.
Code:
    <CActorUnit id="Refinery">
        <On index="71" Terms="UnitDeathCustomize; Option Model Low" Send="DeathCustomize Low"/>
        <On index="72" Terms="AbilTrain.BarracksTrain.Start" Send="Signal DoWork"/>
        <On index="73" Terms="AbilTrain.BarracksTrain.Finish" Send="AnimClear Work"/>
        <On index="74" Terms="AbilTrain.BarracksTrain.Cancel" Send="AnimClear Work"/>
        <On index="75" Terms="ActorCreation" Send="AnimGroupRemove A"/>
        <On index="76" Terms="ActorCreation" Send="AnimGroupRemove B"/>
        <On index="77" Terms="Signal.*.DoWork; IsStatus WorkVar 0" Send="AnimPlay Work Work,D,00"/>
        <On index="78" Terms="Signal.*.DoWork; IsStatus WorkVar 1" Send="AnimPlay Work Work,D,01"/>
        <On index="79" Terms="AnimDone.*.Complete; AnimName Work" Send="StatusIncrement WorkVar"/>
        <On index="80" Terms="AnimDone.*.Complete; AnimName Work; IsStatus WorkVar 2" Send="StatusSet WorkVar 0"/>
        <On index="81" Terms="AnimDone.*.Complete; AnimName Work" Send="Signal DoWork"/>
        <On index="82" removed="1"/>
        <On index="83" removed="1"/>
        <On index="84" removed="1"/>
        <Scale value="0.660000"/>
        <DeathActorModelLow value="UnitDeathModel"/>
        <PlacementModel value="ShapeX2"/>
        <PortraitModel value="CivilianBlurredPortrait"/>
        <StatusBarOn index="Progress" value="1"/>
    </CActorUnit>
Paste this over the Refinery actor entry in your map. To do this open Data editor, go to actor catalog and then enable XML View (either from menus or with hotkey Ctrl + 3). Paste over the current entry (which runs from opening tag to closing tag).

How it works is that it explicitly plays the Word D animation. When any Work D animation expires it plays Work D again. So that it reliably varies which side it uses a Status is kept by the actor. This is incremented after every work animation completion and bounded to have values of only 0 and 1. To prevent action duplication a signal to play work animation is used so that the animation sequence can be started initially when training begins and so that it can be looped once it finishes. In response to the signal it either players variation 0 of the animation or variation 1 depending on what the current status is.

Result is that when training a Marine from it, canisters appear to be constantly loaded into the middle section from both sides in sequence.
Oh wow, it worked! Thank you for your fantastic wizardry!
 
Status
Not open for further replies.
Top