• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Get your art tools and paintbrushes ready and enter Hive's 34th Texturing Contest: Void! Click here to enter!

Lumber Income via Upgrade

This bundle is marked as lacking. It fails to meet the standard requirements and may only have minor use.
Here is a simple JASS that after a certain upgrade is researched, will check on every 15 seconds and give 25 pieces of lumber for EACH Lumber Mill owned, only for USER players (not computers). A message will also display for the same player "You have received X lumber from your Lumber Mills" being x the amount of lumber gained;

You need to researched the new custom upgrade "Sawmill" on the Lumber Mill building to start the trigger;

The lumber mills need to be at 100% health to count.

1. To change the Upgrade ID;
"GetPlayerTechCount(p, 'R01M', true)"
(R01M) = Sawmill custom upgrade ID
[Press Ctrl + D on WE to check ID's]

2. To change the building or Unit ID;
"GetUnitTypeId(u) == 'hlum' then"
(hlum) = Lumber Mill ID
[Press Ctrl + D on WE to check ID's]


3. To change how much lumber is provided;
"set lumberIncome = 25 * lumberMills";
(Is set to 25 lumber)

4. To change the interval when the trigger will run;
"call TriggerRegisterTimerEventPeriodic(t, 15.0)"
(Is set to 15 seconds)

5. To change the message displayed;
"|cff00ff00You have received " + I2S(lumberIncome) + " lumber from your Lumber Mills.|r".
Contents

Sawmill (Map)

Reviews
Antares
You want to put the configurable parts of your system into the header of your script as constants, such as globals constant real INCOME_PER_LUMBER_MILL = 25 endglobals That way, the user doesn't have to scour your code for the point of where to...

Antares

Spell Reviewer
Level 33
Joined
Dec 13, 2009
Messages
1,020
You want to put the configurable parts of your system into the header of your script as constants, such as
JASS:
globals
    constant real INCOME_PER_LUMBER_MILL = 25
endglobals
That way, the user doesn't have to scour your code for the point of where to edit that number. This is not a problem for a script as small as this one, but it becomes a necessity if it grows.

The filter of using 100% health to determine whether the Lumber Mill is fully constructed is quite awkward. You can use
JASS:
GetUnitAbilityLevel(structure, 'ABnP') == 0 //Ability Building in Progress
to determine whether a building is fully constructed.

Even with those fixes, this is a overly simple and specific system and I don't see a reason why someone looking for something like this wouldn't just write it themselves. For it to be approved, it needs to be more flexible or do something less basic.

Rejected
 
You want to put the configurable parts of your system into the header of your script as constants, such as
JASS:
globals
    constant real INCOME_PER_LUMBER_MILL = 25
endglobals
That way, the user doesn't have to scour your code for the point of where to edit that number. This is not a problem for a script as small as this one, but it becomes a necessity if it grows.

The filter of using 100% health to determine whether the Lumber Mill is fully constructed is quite awkward. You can use
JASS:
GetUnitAbilityLevel(structure, 'ABnP') == 0 //Ability Building in Progress
to determine whether a building is fully constructed.

Even with those fixes, this is a overly simple and specific system and I don't see a reason why someone looking for something like this wouldn't just write it themselves. For it to be approved, it needs to be more flexible or do something less basic.

Rejected
thank you for the feedback @Antares!!
 

Antares

Spell Reviewer
Level 33
Joined
Dec 13, 2009
Messages
1,020
I'll try to get more moderators' opinions on this.

But I think @domagatos should post his or her code snippets in the Triggers & Scripts forum or in the hive discord modding channel to get feedback.

Sorry for rejecting both your resources. I don't want to discourage you from posting your code here on hive, but I think this is just the wrong section for them at the moment.
 
I'll try to get more moderators' opinions on this.

But I think @domagatos should post his or her code snippets in the Triggers & Scripts forum or in the hive discord modding channel to get feedback.

Sorry for rejecting both your resources. I don't want to discourage you from posting your code here on hive, but I think this is just the wrong section for them at the moment.
I'am new to everything related to WE, and even more so on JASS, so sorry for any trouble here, and thank you for the consideration @Antares , I don't feel discouraged, you are just doing your part, I get that.

Also your tip on "GetUnitAbilityLevel(structure, 'ABnP') == 0 //Ability Building in Progress" is woking far better, thank you for that aswell!
 
Top