Modify unit data via triggers?

BiGyElLoWhAt

New Member
Reaction score
1
I'm having trouble figuring this out, and google's not helping.

I have a quest in which your character approaches one of various obelisks which contain ancient knowledge. I want to add new buildings and such to a unit's build ability. I can't figure out how to modify the units built with triggers. I feel like this should be pretty easy, but I can't find it. Any help?
 

BiGyElLoWhAt

New Member
Reaction score
1
More specifically: I want to modify the Techtree: Structures Built value for the worker (blood elf) unit via triggers. By default it's set to a Town hall building and a lumber mill building. I want to add a blacksmith style building which I will trigger to modify items purchased other places.
 

jonas

You can change this now in User CP.
Reaction score
67
Not possible (unit data can't be modified like this). You might go with a completely triggered spellbook approach, or make the buildings dependent on some tech which you enable with the obelisks, or it might be possible to set the max tech allowed from 0 to 1. Either way, the field can't be modified
 

BiGyElLoWhAt

New Member
Reaction score
1
Even in jass you can't modify these? That seems like a major downfall. Could you elaborate on this max tech thing you're talking about? I don't want the buildings to appear in the build bar before they are discovered (I don't want the player to know that they exist).
 

BiGyElLoWhAt

New Member
Reaction score
1
well, I think what I'm going to do is to just make new workers, is there an easy way to kill off all the workers that I have, and say I have 5 workers mining gold, to detect that I have 5 workers mining gold, and create 5 upgraded workers making gold? Also it seems as though my editor is starting to get a little laggy as I modify fields/create new units/abilities, is this normal? This is my first extensive project with the world editor.
 

jonas

You can change this now in User CP.
Reaction score
67
1. Download Jass Pack New Gen if you haven't
2. The sluggishness can be fixed with some option in the world editor, I forgot which but you could search
3. I'm not aware of an easy way to do that
4. Tech max allowed = Construction Availability, search for it in the trigger editor
 

BiGyElLoWhAt

New Member
Reaction score
1
Ok a couple of things. First off the sluggishness was the brush list. Just disable it and it goes away (in case anyone else was wondering).
Second off, I ended up just saying screw it and just triggered and engineer in. In this scenario you only really need one, not exactly how I wanted to do it, but it works. I'm actually having a problem with one of my triggers now though. I'm not sure if I should start a new thread (I don't feel like flooding the forum with a bunch of new threads with little questions).

I have a safe vault thing. and I want it to be defended (lightly though). I want the defenders to engage only when you're within close proximity, and disengage when you leave a relatively small region.

The engage trigger
Attack
Events
Unit - A unit enters Region 005 <gen>
Conditions
((Triggering unit) is in Defenders) Equal to False
Actions
Unit Group - Add (Triggering unit) to Intruder
Unit Group - Order Defenders to Attack (Triggering unit)
Set Intruders = (Intruders + 1)

The disengage trigger
Back off
Events
Unit - A unit leaves Region 007 <gen>
Conditions
((Triggering unit) is in Intruder) Equal to True
Actions
Set Intruders = (Intruders - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Intruders Equal to 0
Then - Actions
Unit - Order Chaplain 0050 <gen> to Move To (Center of Region 008 <gen>)
Unit - Order Chaplain 0051 <gen> to Move To (Center of Region 009 <gen>)
Unit - Order Captain 0052 <gen> to Move To (Center of Region 013 <gen>)
Else - Actions
Do nothing

They attack if my hero goes in, but not if my feral wolves (feral spirit ish) go in. Why won't they attack my summoned creatures? (I probably need to account for members dying, but that's not my problem atm)

For clarification, Intruder is a unit group variable, and Intruders is an integer variable. I want them to only stop attacking when all of your units leave the region (or die, again, I need to account for this, but that's not my question)
I also had to add in the check to make sure they weren't in the group defenders, because they would kill each other once you dragged them out a little bit (ha)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top