• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

different hero, different army

Status
Not open for further replies.
Level 16
Joined
May 2, 2011
Messages
1,351
hi guys
in a map I edited,I wanted that a player can build specific units,or do certain upgrades only if he has specific hero.
for that I used the specific hero in the tech-tree requirements
the problem I am facing is that I want some units to be built with more then a hero(e.g. if a player want to build a sorcerer he has to have a bloodmage or an archmage,not with any other hero)
does anybody have an Idea how to do this
please tell if there is previously-opened thread discussing this Issue.
thank you
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Use a trigger system to disable the units and technologies based on hero.

To do this you could make a table to map a list of exclusions to hero types. Thus when a hero is choosen, you itterate through all the exclusions setting them in place. For the table I would advise a hashtable as you can use one of the parent/child fields for the hero type. You could then eithor use the other to make the list or store an index to an array list system.
 
Level 16
Joined
May 2, 2011
Messages
1,351
Use a trigger system to disable the units and technologies based on hero.

To do this you could make a table to map a list of exclusions to hero types. Thus when a hero is choosen, you itterate through all the exclusions setting them in place. For the table I would advise a hashtable as you can use one of the parent/child fields for the hero type. You could then eithor use the other to make the list or store an index to an array list system.
Hashtable!!this is to hard for me,is there no easier way?
I think I am going to use the map constants for tier 4 and let the sorcerer to depend(in techtree) requirements on tier 4
thank for the reply
 
Level 5
Joined
Sep 1, 2010
Messages
168
There is an easier solution than hashtables.
Add all the upgrades you want in a building to it.
Use a trigger that disables all upgrades (means sets current and max research levels of that upgrade/number of trained units of type to 0) for every player that are not for everyone to use one by one on map initialisation

use another trigger
even - unit enters playable map
condition - none
actions
if (triggering unit == unit type) (e.g. paladin)
then (set max research research level of upgrade to whatever you desired max is for owner of triggering unit) -> You can have players have the same ability with different ranges of how many upgrades of an ability they have and at which level they start (set current level of upgrade to YXZ).

Just make a condition for each hero type.
Not too sure how this works if you want the same with units from buildings that all players can build but might be worth a try too :thumbs_up:
 
Level 5
Joined
Sep 1, 2010
Messages
168
I fear that limiting the training of unit type / set avalability of unit type must be 1 command line for each unit type you want to disable.
If you're lost in your trigger, make for each builder a a trigger that you run (run trigger without checking conditions) where you limit training of unit types / set availability. Remember that the trigger should have no condition and no event, but needs via global variable (integer where you stored the player number of triggering player) to know for whom to set the stuff.
This way you keep the detection trigger slim and still get everything done the way you need to.
Hope this helps a bit :)
 
Level 16
Joined
May 2, 2011
Messages
1,351
I found an easy way.
it is just to use the the techtree proprieties under scenario menu to enable/disable melee,campaign and custom units initially,instead of the too long trigger.
and then using the trigger u talked about to enable what I want.
maybe this method does not go well some units(like orc warlock).
thank you so much for your help :)
 
Level 16
Joined
May 2, 2011
Messages
1,351
What do you think of these triggers about the mercenary case I explained(It did not work)
  • NBP
    • Events
      • Time - Every 110.00 seconds of game time
    • Conditions
      • NB Less than 4
    • Actions
      • Set NB = (NB + 1)
  • NBM
    • Events
      • Unit - Mercenary Camp (Village) 0047 <gen> Sells a unit
    • Conditions
      • (Triggering unit) Equal to Mercenary Camp (Village) 0047 <gen>
      • (Unit-type of (Sold unit)) Equal to Brigand
    • Actions
      • Set NB = (NB - 1)
  • mercenary
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Cheif Zalbag The Mighty
    • Actions
      • Neutral Building - Add Brigand to Mercenary Camp (Village) 0047 <gen> with NB in stock and a max stock of 4
      • Neutral Building - Add Rogue to Mercenary Camp (Village) 0047 <gen> with NR in stock and a max stock of 4
      • Neutral Building - Add Assassin to Mercenary Camp (Village) 0047 <gen> with NA in stock and a max stock of 4
      • Neutral Building - Add Enforcer to Mercenary Camp (Village) 0047 <gen> with NE in stock and a max stock of 4
 
Level 16
Joined
May 2, 2011
Messages
1,351
why is the third trigger not connected,I made the third trigger because what want is that only players with that hero can hire the human mercenaries(the orcs cannot hire human mercenaries).
and for that ,I wanted the building to have no units to hire.But when the that hero enter the region I specified (it contains the building and when the hero enter it, he gets near the building),when he enter that region, human mercenaries will be added to that mercenary camp,is it clear now?
what is not working is that when the hero enters,no units are added to the building.
 
Level 16
Joined
May 2, 2011
Messages
1,351
but how would it be if I want them to be in the beginning 0 so if someone tries to buy in the early game he cannot. But after while(e.g. 210 second for the assassin) when the variable becomes it's initial value+1=0+1=1, after that time when the hero enter the region the unit will be added to that shop with number of 1(in our e.g. is should be 1 assassin is added to the shop), why does that not happen in my trigger?
 
Status
Not open for further replies.
Top