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

Simple Ques

Status
Not open for further replies.
Level 9
Joined
Dec 15, 2009
Messages
625
Can this trigger be used to modify unit build time ingame?
  • Unit - Set (Triggering unit) construction progress to 50%
 
Level 7
Joined
May 13, 2011
Messages
310
If it exists (I dunno), then it seems so.

However, notice that it says "construction progress". Therefore I would assume that it sets how far the unit is finished with construction to exactly halfway done. This would hinder the construction if it was over 50%, rather than slow the process. The unit would still continue to be constructed at the same rate.

I haven't actually tried it of course, but that's my theory. I don't know how else it would work.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Here's what I got from my experiment of this action:
1. I create 1 custom unit and named it "Farm Slow"
2. Another farm is the default Farm.
3. I use this trigger to differs the Farm Slow from the default Farm:
  • Experiment Number 23
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Unit-type of (Constructing structure)) Equal to Farm Slow
    • Actions
      • Unit - Set (Constructing structure) construction progress to 1%
4. I put 2 Peasants inside the test map
5. I ordered both of them to construct each different building (one is Farm Slow, another one is default Farm)
6. Judging by the trigger, the Farm Slow build time should be slowed down to 1% of its original build time but the result was, 2 of the farms were constructed at the same time
7. Maybe my method was wrong, or does this action, bugged on its own ?

Opinions please :)
 
Level 7
Joined
May 13, 2011
Messages
310
As I said: the trigger sets the construction progress, not the construction speed. This means that since you put the construction progress to 1% for the Farm Slow, it made (near to) no difference to the other Farm. If you were to set the construction progress to, say, 50% instead, the Farm would already be halfway done as soon as the Peasant starts building.

I even tried it out and got the exact results I expected:

  • Events
    • Unit - A unit Begins construction
  • Conditions
    • (Unit-type of (Constructing structure)) Equal to Chicken Farm
  • Actions
    • Wait 0.10 seconds
    • Unit - Set (Constructing structure) construction progress to 50%
By the way, note that for this to work the Wait action is required. So even if you had used something like 50% in your example, defskull, it wouldn't have worked. I don't know why, probably a conflict between beginning construction and setting the construction progress at exactly the same time.
 
Level 7
Joined
May 13, 2011
Messages
310
Wait... what do you mean, "it's capped"? Do you mean that's the WC3 framerate?
And how do you mean "useless"? I'm using it right here!
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
What I meant was, if you put a value of Wait under 0.27 second, it won't work because the game Wait action is capped/maxed out at 0.27 second, understand ?
That action you used (in post #6), the actual value of your Wait action is actually 0.27 second, not 0.10 second, understood ?

Any value under 0.27 second, it will be turned to 0.27 second instead.
 
Level 7
Joined
May 13, 2011
Messages
310
Ah, I see now. I thought might have meant that.

So, in a way, it'd be overall better to set 0.27 seconds rather than 0.10, so that you don't get confused. Like for example, if you do Wait for 0.10 seconds, and then do it again (for whatever reason) you'll get 0.54 seconds, not 0.20.

Right?
 
Level 7
Joined
May 13, 2011
Messages
310
I see. Since the Wait Event can hold that little, then WarChasers can literally use the 0.10 seconds time period.

But still, in the case of our construction progress trigger, a Wait Action of 0.27 seconds is probably best. I didn't notice any hindering really, 0.27 seconds is such a small amount of time, my Farm was halfway constructed pretty much straight away.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
So that "Wait" does the trick :)
But be careful, any Wait action below 0.27 second is useless because it is capped at 0.27 second and it is hard-coded engine in warcraft mechanics.

Waits below 0.27 are not useless :)

And you propably meant to say that it is a hard-coded mechanic in WC engine. Which would still be untrue.

Any value under 0.27 second, it will be turned to 0.27 second instead.

It is said that you can't get values under (approximately) 0.27 seconds in multiplayer. In single player you can.

What I meant was, if you put a value of Wait under 0.27 second, it won't work because the game Wait action is capped/maxed out at 0.27 second, understand ?

Waits are not "capped/maxed out" at 0.27 seconds. That would mean you can't get over 0.27 seconds in any case which is not true.

That action you used (in post #6), the actual value of your Wait action is actually 0.27 second, not 0.10 second, understood ?

The trouble with waits is that the time is unreliable. It will vary.

You can try this kind of trigger yourself:
  • Untitled Trigger 074
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Countdown Timer - Start timer as a One-shot timer that will expire in 1.00 seconds
      • Wait 0.10 seconds
      • Countdown Timer - Pause timer
      • Game - Display to Player Group - Player 1 (Red) the text: (String((Elapsed time for timer)))
I got values between 0.175 and 0.30.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
But when you're trying to "move" a unit from time to time (basically we use a 0.03 second timer, right?) but instead, try use Wait + Loop Like this:
  • For each (Integer A) from 1 to 5, do (Actions)
    • Loop - Actions
      • Wait 0.03 seconds
      • Unit - Move Blood Mage 0001 <gen> instantly to ((Position of Blood Mage 0001 <gen>) offset by 10.00 towards (Facing of Blood Mage 0001 <gen>) degrees)
And compare to this:
  • Untitled Trigger 001
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit - Move Blood Mage 0001 <gen> instantly to ((Position of Blood Mage 0001 <gen>) offset by 10.00 towards (Facing of Blood Mage 0001 <gen>) degrees)
You will notice the Wait value is NOT 0.03, because it will move the unit in a choppy behavior while for the 2nd trigger, it moves smoothly because it truly obeys the 0.03 second per loop

Also, the minimum Wait value is not 0.27 I think, because, I replace the 0.03 second of Event in 2nd trigger with 0.27 and I compare the speed and movement of the 2 triggers
Result was, the Wait has a little more fast loop (Wait movement speed > Event movement speed) than the Event timer of 0.27
So I'm guessing that Wait value has a lower minimum value of 0.27 but instead maybe around 0.15 ~ 0.20
 
Level 7
Joined
May 13, 2011
Messages
310
I said that it's not wrong to use Wait but it is wrong to use Wait value under the value of 0.27 second, get it ?
Also, using Wait can destroy a "MUI-ness" of a spell (I hope you understand what is MUI)

Yeah, I get it. So, the moral is that a Wait action has a limitation while the Wait event doesn't (or nearly doesn't). Right?

In any case, I think we've answered Nightblade's question. Here is the summary:

The "Set unit's construction progress" trigger set's how far the unit is completed. It does not modify how fast it is constructed, that is, the rate at which the worker unit builds it.
 
Status
Not open for further replies.
Top