SC2Mapster Forums

Resources > Tutorials

[Data] Constructing a Building from an Item

  • 4 posts
    #1 Nov 30, 2012 at 22:23 UTC - 0 likes

    Description

    • This will allow an item to fake being built when created from an item
    • It figured it out from exploring the Infestor - Infested Marine ability.
    • This will create an item that you can place on the ground using a footprint once placed it will take 7 seconds before the building is considered complete
    • Once the Morph is over the building is the new one.

    Sample Map

    Download Map

    Tutorial Map Image

    What we will need

    • 3 Units
    • 3 Actors
    • 2 Models
    • 1 Item
    • 2 Abilities
    • 3 effect
    • 1 behaviour

    NOTE:
    You will need a unit with an inventory
    to use the item i will not be covering that


    Creating the Effects


    1

    Name:ApplyMorphOrderSmallTentEffect
    EffectType:Apply Behavior
    Parent:Default Ability (CEffectApplyBehvior)


    2

    Name:ConstructionUnitMorphToSmallTentEffect
    EffectType:Issue Order
    Parent:Default Effect (CEffectIssueOrder)


    3

    Name:CreateSmallTentEffect
    EffectType:Create Unit
    Parent:Default Effect (CEffectCreateUnit)


    Creating the Behaviour


    1

    Name:ConstructionUnitMorphSmallTentBuff
    BehaviorType:Buff
    Parent:Default Behavior (CBehaviorBuff)


    Creating the Abilities


    1

    Name:BuildSmallStructureAbility
    AbilityType:Effect - Target
    Parent:DefaultAbility (CAbilEffectTarget)


    2

    Name:ConstructionUnitMorphSmallTentAbility
    AbilityType:Morph
    Parent:Default Ability (CAbilMorph


    Creating the Item


    1

    Name:BuildTentItem
    ItemType:Ability
    Parent:CItemAbil(Unnamed)


    Creating the Models


    1

    Name:ConstructionModel
    ModelType:Generic
    Parent:CModel


    2

    Name:TentModel
    ModelType:Generic
    Parent:CModel


    Creating the Unit


    1

    Name:BuildHuntersTentUnit
    UnitType:Generic
    Parent:Default Settings(Unit)


    2

    Name:ConstructionSmallUnit
    UnitType:Generic
    Parent:Default Settings(Unit)


    3

    Name:HuntersTentUnit
    UnitType:Generic
    Parent:Default Settings(Unit)


    Creating the Actors


    1

    Name:BuildHuntersTentActor
    ActorType:Unit
    Parent:GenericUnitStandard


    2

    Name:ConstructionSmallActor
    ActorType:Unit
    Parent:GenericUnitStandard


    3

    Name:HuntersTentActor
    ActorType:Unit
    Parent:GenericUnitStandard


    Behaviors


    Setting up the ConstructionUnitMorphSmallTentBuff

    Effect: Expire EffectConstructionUnitMorphToSmallTentEffect
    Stats: Duration0.5000


    Effects


    Setting up the ApplyMorphOrderSmallTentEffect

    Effect: BehaviorConstructionUnitMorphSmallTentBuff


    Setting up the ConstructionUnitMorphToSmallTentEffect

    Effect: AbilityConstructionUnitMorphSmallTentAbility


    Setting up the CreateSmallTentEffect

    Effect: Effect - SpawnApplyMorphOrderSmallTentEffect
    Effect: Spawn UnitConstructionSmallUnit
    Target: Location +(None):Target Point


    Abilities


    Setting up the BuildSmallStructureAbility

    Ability: Commands -
    Ability: Execute -
    Ability: Default ButtonBuild ArmoryYou can pick any default button
    Ability: Place UnitConstructionSmallUnit
    Ability: Produced UnitConstructionSMallUnit
    Effect: Effect +CreateSmallTentEffect
    Stats: Range5


    Setting up the ConstructionUnitMorphSmallTentAbility

    Ability: Commands -
    Ability: Execute -
    Ability: Default ButtonBuild ArmoryYou can pick any default button
    Ability: Info -
    Ability: Index 0 -
    Ability: Collision Range5
    Ability: Sections -
    Ability: Abilities -
    Ability: Duration -
    Ability: Delay7
    Ability: Actor -
    Ability: Duration -
    Ability: Delay7
    Ability: Stats -
    Ability: Duration -
    Ability: Delay7
    Ability: UnitHuntersTentUnit
    Stats: Flags -
    Stats: Show ProgressEnabled


    Items


    Setting up the BuildTentItem

    Basic: AbilityBuildSmallStructureAbility
    Basic: FaceBuild Armory
    Basic: Flags +Can Drop, Destroy When Depleted


    Units


    Setting up the BuildHuntersTentUnit

    Stats:ItemBuildTentItem


    Setting up the ConstructionSmallUnit

    Ability:Abilities +ConstructionUnitMorphSmallTentAbility
    Movement: Collide +Ground, Structure
    Movement: Pathing FootprintFootprint 1x1
    Movement: Pathing Footprint - PlacementFootprint 1x1


    Setting up the HunterTentUnit

    Movement: Collide +Ground, Structure
    Movement: Pathing FootprintFootprint 1x1
    Movement: Pathing Footprint - PlacementFootprint 1x1

    Models


    Setting up the ConstructionModel

    Art: ModelAssets\Textures\CustomBuildAnimation7.m3This will be the placement model


    Setting up the TentModel

    Art: ModelAssets\1Tents\gnolltent02.m3This will be the Building that gets built


    Actors


    Setting up the BuildHuntersTentActor

    Art: ModelShapeDiamond
    Art: Model (Build)ShapeDiamond
    Art: Model (Editor)(None)
    Art: Model (Placement)ShapeDiamond
    Art: Model (Portrait)(None)
    Event: Events +UnitBirth.BuildHuntersTentUnitMsg Type: Unit Birth
    Source Name: BuildHuntersTentUnit
    Sub Name: (Any)
    -Create
    UnitDeath.BuildHuntersTentUnitMsg Type: Unit Death
    Source Name:BuildHuntersTentUnit
    Sub Name: (Any)
    -Destroy


    Setting up the ConstructionSmallActor

    Art: ModelConstructionModel
    Art: Model (Build)ConstructionModel
    Art: Model (Editor)(None)
    Art: Model (Placement)ConstructionModel
    Art: Model (Portrait)(None)
    Event: Events +abilMorph.*.FinishMsg Type: Ability Morph
    Source Name: (Any)
    Sub Name: Finish
    ->MorphTo HuntersTentUnit
    -Destroy
    UnitBirth.ConstructionSmallUnitMsg Type: Unit Birth
    Source Name: ConstructionSmallUnit
    Sub Name: (Any)
    -Create
    UnitDeath.ConstructionSmallUnitMsg Type: Unit Death
    Source Name: ConstructionSmallUnit
    Sub Name: (Any)
    -Destroy


    Setting up the HuntersTentActor

    Art: ModelTentModel
    Art: Model (Build)TentModel
    Art: Model (Editor)(None)
    Art: Model (Placement)TentModel
    Art: Model (Portrait)(None)
    Event: Events +abilMorph.*.FinishMsg Type: Ability Morph
    Source Name: (Any)
    Sub Name: Finish
    ->MorphTo HuntersTentUnit
    ->MorphFrom ConstructionSmallUnit
    -Create
    UnitBirth.HuntersTentUnitMsg Type: Unit Birth
    Source Name: HunterTentUnit
    Sub Name: (Any)
    -Create
    UnitDeath.HunterTentUnitMsg Type: Unit Death
    Source Name: HunterTentUnit
    Sub Name: (Any)
    -Destroy

    Pictures To Come

    Last edited Dec 01, 2012 by zaysite
    #2 Dec 01, 2012 at 15:16 UTC - 0 likes

    Why not just use a Target type item instead of an Ability type item and skip the ability? You can get placeholder models to be created through events.

    Last edited Dec 01, 2012 by DrSuperEvil
    #3 Dec 01, 2012 at 16:25 UTC - 0 likes

    @DrSuperEvil: Go

    from what i have tried it is hard to get the footprint to show up when placing the unit. In my original map i was using a Target Item type But it would not allow you to place the structure if you have a working example i would love to see what you mean.

    #4 Dec 01, 2012 at 17:20 UTC - 0 likes

    @zaysite: Go

    Would love too but still have a large backlog of projects and demo maps in the pipeline. Also not getting alot of time each week to work on em.

  • 4 posts

You must login to post a comment. Don't have an account? Register to get one!