• 🏆 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!

Crafting/Survival Game. Questions #3

Status
Not open for further replies.
Level 3
Joined
Mar 24, 2015
Messages
43
*Note: Thank you to the community for answering my questions so far. I love the fast replies! It seems like the answers to my questions are all starting to revolve around triggers, so if this continues, I will move my future questions to the appropriate forum/sub-forum! I’m still very new to WE.

I am creating a crafting/survival game. Players will be using a basic unit most likely a peasant.
It might help to think of my game in relation to the “Wilderness Survival” game by Jay. That game has a lot of mechanics/inner workings that I need to adapt for my game...

1. At the start, I don’t want players to be able to chop trees for wood. However, after finding the right materials to craft a woodcutting axe, then I want them to be able to chop trees(or attack them), and get the items that the trees will drop. How is this done? My guess would be to remove the gather ability(i know how), and then somehow make my woodcutting axe (custom item/i know how) allow the player to attack trees(I don’t know how). I should also point out that I don’t want a player to be able to attack a tree with any other item/weapon.

2. Very-Early game, players will only have melee weapons. Super simple example, a stick (lol). How can I make this item show up as if the player is actually holding that stick?

3. Later in the game, players will be able to craft bows & arrows and other range weapons. Again, I want it to show the player actually holding the weapon. But also, how can I change the peasant’s melee attack into a ranged attack, and show the projectile (arrow) fly towards the enemy?

I know in some games, you can equip a bow & arrow, and it changes your peasant into an archer unit. However, that wouldn’t make sense for my game. Any other ideas or tips are appreciated.
 
Level 9
Joined
May 21, 2014
Messages
580
*Note: Thank you to the community for answering my questions so far. I love the fast replies! It seems like the answers to my questions are all starting to revolve around triggers, so if this continues, I will move my future questions to the appropriate forum/sub-forum! I’m still very new to WE.

I am creating a crafting/survival game. Players will be using a basic unit most likely a peasant.
It might help to think of my game in relation to the “Wilderness Survival” game by Jay. That game has a lot of mechanics/inner workings that I need to adapt for my game...

1. At the start, I don’t want players to be able to chop trees for wood. However, after finding the right materials to craft a woodcutting axe, then I want them to be able to chop trees(or attack them), and get the items that the trees will drop. How is this done? My guess would be to remove the gather ability(i know how), and then somehow make my woodcutting axe (custom item/i know how) allow the player to attack trees(I don’t know how). I should also point out that I don’t want a player to be able to attack a tree with any other item/weapon.

2. Very-Early game, players will only have melee weapons. Super simple example, a stick (lol). How can I make this item show up as if the player is actually holding that stick?

3. Later in the game, players will be able to craft bows & arrows and other range weapons. Again, I want it to show the player actually holding the weapon. But also, how can I change the peasant’s melee attack into a ranged attack, and show the projectile (arrow) fly towards the enemy?

I know in some games, you can equip a bow & arrow, and it changes your peasant into an archer unit. However, that wouldn’t make sense for my game. Any other ideas or tips are appreciated.

#2
You need a stick model created by some modeler out there. You need to import that model, then use any skill as an attachment for the skill, then by triggers, give your peasant the skill.

#3
There are certain ways of doing this. Have you observed that there are 2 attacks available for a unit? If you don't want your unit to be replaced with an archer unit, you would need to make use of this. There are skills/upgrades (I forgot which) that lets you enable the 1st attack and 2nd attack. Make use of that. Or you could just make another unit completely the same as the peasant and just give it the skill with a bow attachment, then edit it's attack. Whenever the Peasant (Melee) gets a bow, replace the unit with a Peasant (Ranged).

For your number 1 question, I'll leave others to explain it since I never had actual experience manipulating much around trees. I just know that you can change Targets Allowed to enable to attack Trees.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
1st - If you look closely at the peasant unit, you will notice that it has an ability "Harvest (Gold and Lumber)". Start with copying that. You have 2 options here.
Option 1 -Make a custom upgrade and make it a requirement for the freshly copied ability.
You will need to somehow research this, so it will need a building or something of the sort.

I should start reading more carefully. Nice that you have noticed the Harvest (Gold and Lumber).
So, this will require triggering :|
You want to do something like:

Event - Unit acquires item
Conditions - Item being manipulated == Chopping Axe
Actions - Add Harvest(Gold and Lumber) to (Triggering unit)

Then you have another trigger saying:

Event - A unit loses an item
Conditions - Item being manipulated == Chopping Axe
Actions - Remove Harvest(Gold and Lumber) from (Triggering unit)

And now your heroes can join the army of peasants. But what will happen if the hero has 2 axes and drops one ? He will not be able to harvest anymore. So if you do something like:

For loop Integer 1 to 6
Item carried by hero in slot Integer
Skip remaining actions

  • Allow Treecutting
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Chopping Axe
    • Actions
      • Unit - Add Harvest (Gold and Lumber) to (Triggering unit)
      • Game - Display to (All players) the text: You can now cut down trees.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Chopping Axe
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Chopping Axe
            • Then - Actions
              • Skip remaining actions
            • Else - Actions
      • Game - Display to (All players) the text: Nuooooh
1st - That is actualy very simple. In WE go into your Object Editor >> Items, Add the "Harvest (Gold and Lumber)" ability to the item. And now your heroes can join the army of peasants... or cut trees alone in the woods...

2nd - You may want to check this tutorial http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/how-attach-weapons-units-allready-have-weapons-without-modelling-59356/

3rd - @blancfaye7 - Correct, but at the same time wrong. You can not use ranged attack animation because he just does not have any , it will look weeeeeeiiiiird. There was a nice model of a villager in the spell section with ~hundred different animations, you may want to use that.

Other way of handling this is replacing the units. Lets say if you hold a sword change with footman unit, if you are holding bow change with archer unit, if you are holding axe change with peasant. I assume that would be done with iteams and a hero unit.
 
Level 3
Joined
Mar 24, 2015
Messages
43
Use this model: http://www.hiveworkshop.com/forums/models-530/villager-64141/
It has animations for sword fighting, bow use, etc

Use the trigger action "animation - add unit animation tag" to change the unit's animation set.

Very nice! I already set up the peasant unit for the map, but I will redo it with the villager. I originally looked for that in the units pallete, but couldn't find it anywhere. Thank you!

I will also be adding you to my special thanks section of my map :D
Much appreciated. Being new to the site, I didn't expect people to be this helpful. :thumbs_up:
 
Level 3
Joined
Mar 24, 2015
Messages
43
*** NEW QUESTION ***
So now I have the villager model successfully in my game, modeling the regular unit "Peasant".

From now on, when I want to change the settings for this character (like atk dmg, HP, etc) will I still use the Peasant unit in Object Editor ?
I guess the model is just an outer visual shell with the working parts of a peasant underneath?
 
Last edited:
Status
Not open for further replies.
Top