1. The contestants were to create water structures for the 20th Terraining Contest. Choose one in the public poll!
    Dismiss Notice
  2. 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
  3. The Melee Mapping Contest #4: 2v2 - Results are out! Step by to congratulate the winners!
    Dismiss Notice
  4. We're hosting the 15th Mini-Mapping Contest with YouTuber Abelhawk! The contestants are to create a custom map that uses the hidden content within Warcraft 3 or is inspired by any of the many secrets within the game.
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice

Change Corpse Type

Discussion in 'World Editor Help Zone' started by sanitoeter, Feb 3, 2013.

  1. sanitoeter

    sanitoeter

    Joined:
    May 17, 2008
    Messages:
    46
    Resources:
    0
    Resources:
    0
    Hey, couldn't find this anywhere.
    What I want to do, is to modify corpses. Case in point: Vegetarian Corpses.

    I made a unit called "Mushroom", that on death is supposed to leave a fermented mushroom. These fermented mushrooms can be eaten by Vegetarian animals, such as Stags or feminists. The cannibalism skill is supposed to regenerate Mana instead of health (Mana is the hunger, has a negative regeneration).

    Problem: I can't find a way to change a units corpse type or model, or even make new corpse types. Would be amazing if you could help!
     
  2. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Unit dies
    Unit type condition
    --Replace unit
    --Kill last replaced unit
     
  3. DESTROYER123

    DESTROYER123

    Joined:
    Jul 12, 2011
    Messages:
    1,199
    Resources:
    0
    Resources:
    0
    The only way to change the corpse is to edit the model's decay(or somehting like that) animation.
    However, you can also hide the unit after his death animation and change it to the models you want.

    Example.
    A footman dies.
    Wait some seconds until he falls in the ground.
    Hide the unit and create a dummy unit that would be a dead footman with blood on his armor or a rusty armor e.t.c.:wink:


    Edit:
    Maker is so fast!!!!
     
  4. sanitoeter

    sanitoeter

    Joined:
    May 17, 2008
    Messages:
    46
    Resources:
    0
    Resources:
    0
    hmmm thanks guys, very helpful. And how can I make a modified graveyard (=oasis) that spawns those fermented mushrooms for deers to eat?
     
  5. DESTROYER123

    DESTROYER123

    Joined:
    Jul 12, 2011
    Messages:
    1,199
    Resources:
    0
    Resources:
    0
    Try doing something with the pocket factory ability or via triggers that spawn units every x seconds of the game.
     
  6. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Pocket Factory ability.

    EDIT: DESTROYER123 is so fast...
     
  7. DESTROYER123

    DESTROYER123

    Joined:
    Jul 12, 2011
    Messages:
    1,199
    Resources:
    0
    Resources:
    0
  8. sanitoeter

    sanitoeter

    Joined:
    May 17, 2008
    Messages:
    46
    Resources:
    0
    Resources:
    0
    I already thought of that, but if the food source is there from the beginning and will stay there forever, it will overflood the game with mushrooms, because you can't set a limit, right?
     
  9. DESTROYER123

    DESTROYER123

    Joined:
    Jul 12, 2011
    Messages:
    1,199
    Resources:
    0
    Resources:
    0
    Here's an old trigger of mine:
    • Spawn in Region 015
      • Events
        • Time - Every 5.00 seconds of game time
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in SkeletalSmallMinionsReg15) Less than 7
          • Then - Actions
            • Unit - Create 1 Skeletal Minnion (1) for Neutral Hostile at (Random point in Region 015 <gen>) facing (Random angle) degrees
            • Unit Group - Add (Last created unit) to SkeletalSmallMinionsReg15
          • Else - Actions


    • Region 015 conditions
      • Events
        • Unit - A unit Dies
      • Conditions
        • ((Dying unit) is in SkeletalSmallMinionsReg15) Equal to True
      • Actions
        • Unit Group - Remove (Dying unit) from SkeletalSmallMinionsReg15

    Edit it a bit and will be ok
    it leaks points.http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/ make sure you fix them
    SkeletalSmallMinionsReg15 is a unit group
     
  10. sanitoeter

    sanitoeter

    Joined:
    May 17, 2008
    Messages:
    46
    Resources:
    0
    Resources:
    0
    Okay, thanks destroyer!
    Will work great.
    Next question: How can I change the target of cannibalism to just one single unit type (equals Mushroom). The Mana regeneration instead of health will work just fine by triggers, but the targeting is causing me some trouble..
     
  11. DESTROYER123

    DESTROYER123

    Joined:
    Jul 12, 2011
    Messages:
    1,199
    Resources:
    0
    Resources:
    0
    You can order the unit to stop when he casts the ability on a unit different from the mushrooms.
     
  12. sanitoeter

    sanitoeter

    Joined:
    May 17, 2008
    Messages:
    46
    Resources:
    0
    Resources:
    0
    Hmmm.. that would catch the unit in a vicious loop of eating stones, since I'm trying to create a whole eco-system of triggered eating habits.
    Another idea: Can I use a channeling ability, such as mana or life steal, and make the deer target only doodads of the type of "EatableMushroom"?
    Edit: I would know how to build this trigger, but I'm not sure if it would make for complications
     
  13. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    You know you can use Unit-type Comparison in the Conditions, right ?
    Use this to tackle the problem.

    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Unit-type of (Target unit of ability being cast)) Equal to Mushroom
      • Then - Actions
        • -------- DO SOMETHING --------
      • Else - Actions
        • Game - Display to (All players) the text: You MUST target Mushroom !
     
  14. sanitoeter

    sanitoeter

    Joined:
    May 17, 2008
    Messages:
    46
    Resources:
    0
    Resources:
    0
    Thanks, I already solved it!
    And yeah I know that, but as I said it's part of an AI / self-regulating system. It checks every 0.5 seconds if one of the units' (controlled by neutral passive) mana is 20 or lower, and if it is, it orders the unit to move to one of the feeding zones. Then it gets the order "Cast EatShroom (based on life leech)" (string actually is hex), on "random unit in Unitgroup(Shrooms[1])"
    Conditions are:
    Mana of picked unit is smaller or equal to 20
    Ability being cast is not equal to EatShroom
    Picked Unit is in NonWander (group variable, not important here) equals false
    Or (multiple) - Unit type comparison.

    For some reason, the unit still is stuck in some weird loop.. it vibrates because it tries to target a different shroom every 0.5 seconds. The "Ability being cast is not equal to EatShroom" doesn't work here, as it seems.. Do you know what the problem is?
    I'm really desperate.. Got the map to a really good point by now, but I'm caught in a spiral..

    Edit: One day I will have to figure out how to write those fancy triggers on Hive..
     
  15. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    When you give the order, you can for example add the unit into a unit group. Before giving the order, you check that the unit is not in the group.

    When the unit finishes casting, you can remove it from the group.

    http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/