• 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.

Need help with a trigger

Status
Not open for further replies.
Level 2
Joined
Apr 30, 2010
Messages
20
Hello,
I want to make a game with elements of "The Settlers 3". That means you start with normal Villagers then you have to upgrade them in the barracks or whatever to a Soldier etc. At the beginning my idea was to edit the "sacrifice"-ability from the undead acolyte but you cant edit that damn ability... So i thought of triggers but after 4 painful hours i quit cause it doesnt work.
Maybe one of you guys has an idea??

I'm pretty new with triggering but i know a few basics :) Oh.. and i'm german so excuse my english.

Sir Fondor
 
You can do this:
  • Trig
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Upgrade Unit
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Villager) and do (Actions)
        • Loop - Actions
          • Unit - Replace (Picked unit) with a Soldier using The new unit's default life and mana
      • Player - Limit training of Villager to 0 for (Owner of (Triggering unit))
This will pick every current unit you have. In order to apply the effect on your newly trained units, you can either add them to your barracks or use a trigger like this:
  • Tr
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Villager
      • (Current research level of Upgrade Unit for (Owner of (Triggering unit))) Greater than 0
    • Actions
      • Unit - Replace (Trained unit) with a Soldier using The new unit's default life and mana
 
Level 13
Joined
May 11, 2008
Messages
1,198
yeah replacing the unit action is probably the way to go.

it sounded like you want to upgrade the units individually rather than all at once like troll berserker, if that's true i would say the best way to do that is to give the settlers the ability to upgrade. you can give the spell a casting time according to how long it takes to upgrade the unit...you need a trigger that detects the event of a unit starting the effect of a spell. you can set make a new upgrade if you want and the ability could require the upgrade. if you do that then you have to research the ability to upgrade. not sure if you wanted to do that or not, but that's super easy...
 
Level 2
Joined
Apr 30, 2010
Messages
20
Thanks for the fast response.

To the trigger:

Ok but that would mean the villager turns into a soldier everywhere, wouldn't it? I tried with many triggers to let the villager go to the (training) barracks and turns there into a soldier. Is that possible?

> I need to go to work now but when i'm back i'll immediately start to create this trigger.

Sir Fondor
 
Level 9
Joined
May 27, 2006
Messages
498
That would require another set of triggers, which could look like that;
  • Trig1
  • Events
  • Conditions
    • Unit type of (Triggering unit) equal to Villager
    • Current research level of your_upgrade for (Owner of (Triggering unit)) greater than 0
  • Actions
    • Unit - Replace (Triggering unit) with your_unit using new units default life and mana
  • Trig2
  • Events
    • Unit - A unit finishes construction
  • Conditions
    • Unit type of (Constructed unit) equal to Barracks
  • Actions
    • Trigger - Add to Trig1 <gen> the event (Unit - A unit comes within 400.0 of (Constructed unit))
 
Level 2
Joined
Apr 30, 2010
Messages
20
That looks good too but that would mean if a villager comes within range of the barracks then he automatically turns into an soldier. So it costs no money etc. Furthermore the villager is just the basic unit. Later you can build a church and mage-academy so the villager can turn into a priest (who also can turn into a zealot or acolyte) or other units.

OT: My idea is that you cant "build" or train units but you can get new villagers from other villages. In this map i dont want units to appear from the sky ^^
 
Level 13
Joined
May 11, 2008
Messages
1,198
well to get new villagers from other villages it shouldn't be hard to make them initially a neutral player's villagers and then when the active player comes to the village make them owned by the player. if you're still having trouble with the barracks transforming villagers, try my idea that i gave you already.
 
Level 2
Joined
Apr 30, 2010
Messages
20
KK I will try that trigger of yours and the idea with the villagers from other towns was just mentioned but thanks nevertheless ;)
 
Status
Not open for further replies.
Top