• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Custom Destructible questions:

Status
Not open for further replies.
Level 8
Joined
Feb 20, 2007
Messages
338
This is what I am trying to do.

None of my buildings give "food" instead the player has to raise farmers who can plant crops and harvest crops. Further I have other sources of food in the form of chickens and sheep.

Ideally the set up will be to where if the number of food is below the number of units that eat (living units) that randomly picked nonhero units will be leaving the game map (converting them to a neutral team as they walk away to a point where they are removed) and where no new units can be trained until the food supply is able to sustain them.

I have fields of corn (crops) which are destructible (see picture).

My first question related to how the corn does not go away when it is "killed". The corn remains now pathless but there is still corn. Is there away to remove the image/art/model of the corn once it dies?

2. I have it based on a tree destructible - unfortunately harvesting stacks in the lumber. Right now I have a secondary trigger that adds -10 lumber each time a corn dies (its HP gives it one trip to the barn or lumber processing station.) It then adds 1 food to the player's food - which in turn is being "eaten" a minus of 1 food per living unit (non building, non mechanical) at 19:00 (supper time) in another trigger.

Is there a better way to make my crops not add to the lumber but still have my units harvesting crops? While having trees add lumber as usual (need lumber, gold and food)?

Any suggestions, ideas or directions welcomed.
 

Attachments

  • Corn.jpg
    Corn.jpg
    76.3 KB · Views: 153
Level 2
Joined
Oct 7, 2007
Messages
19
Yeah this question should of been in a world editor help forum.

Question 1. It's because the corn doodad model has no death animation, so it remains permanantly in the game. I suggest you change the corn model from a destructable to a unit, set it's death animation time to the lowest possible and change it's death type to "can't raise, does not decay" then it's model will disappear. This will also help you out with your second problem.

Question 2. Create an ability for harvesting, maybe an autocast ability with a cast time of say 10 seconds that does a specific amount of damage to the corn unit. To make sure it only get used on the corn unit, set it's targeted as to tree, and the abilities targets allowed to tree (i think this would work, if not there should be another way around this). Then create a trigger so that every time a unit finishes casting that ability on the unit corn, the owning player gains 1 food. That way there is no lumber involved and the corn will disappear after death.
 
Level 8
Joined
Feb 20, 2007
Messages
338
Try as I might my Corn unit and spell would not work with "tree" as a classification.

So instead I used a customized "heal" spell.

And am using:

  • Corn01
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Harvest corn
    • Actions
      • 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 Corn
        • Then - Actions
          • Unit - Kill (Target unit of ability being cast)
        • Else - Actions
          • Unit - Order (Casting unit) to Attack (Random unit from (Units owned by (Owner of (Casting unit)) of type Corn))
The "else" is to move the casting unit away from any other injured units. :( I am not satisfied with this though.

I will of course add more to the 'then' area (add 1 food).

Any other suggestions?




(and too does this leak?)
 
Level 8
Joined
Feb 20, 2007
Messages
338
yeah, like banlord sayed, make the corn into units, so that instead of harvesting you are attacking, and when the unit loses say, 10 hp (whatever) then give the player food, and make the corn have no regeneration and give the unit "can't raise, does not decay", then when they die, they will go away.

btw, awsome looking map ther.

Thanks, and that map is not completed... That is just the basic doodads and structures to outline where stuff will be in future.

I like this idea of unit as crop. I now have 3 versions of my crop (new, growing and ready for harvest) This puts a bit of time between the planting and the harvest and lets the crops "grow" over time.

Of course I'm not in the process of restructuring the game here. This idea actually opened up a world of possibilities for me.
 
Status
Not open for further replies.
Top