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

Need help with custom script (extra resources)

Status
Not open for further replies.
Level 12
Joined
Oct 28, 2019
Messages
479
I really has problem with custom script codes how can I memorize them?
An upgrade requires "Mercury" but is not working.... whats is going wrong with this trigger
  • Tech
    • Events
      • Unit - A unit owned by Player 1 (Red) Begins an upgrade
    • Conditions
      • (Researched tech-type) Equal to Blacksmith Upgrade
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CountMercury Greater than or equal to 1
        • Then - Actions
          • Set VariableSet CountMercury = (CountMercury - 1)
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to (String(CountMercury))
          • Set VariableSet Footman_train = True
        • Else - Actions
          • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851976)
          • Game - Display to Player Group - Player 1 (Red) the text: |cffff0000Not enoug...

and the trigger to return the mercury if the tech is canceled
  • Cancel elven destroyer Copy Copy
    • Events
      • Unit - A unit owned by Player 1 (Red) Cancels an upgrade
    • Conditions
      • (Researched tech-type) Equal to Blacksmith Upgrade
      • Footman_train Equal to True
    • Actions
      • Set VariableSet CountMercury = (CountMercury + 1)
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to (String(CountMercury))
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
custom script codes how can I memorize them?
read this every day 100 times, after your daily 100 pushups, sit ups, squats and 10k run:



:ogre_hurrhurr:
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
I think this is what you want:

native BlzDecPlayerTechResearched takes player whichPlayer, integer techid, integer levels returns nothing​


Explanation:
Decreases (reduces) a specific player’s specific upgrade by a specific amount of levels.

Even though this native takes an integer and integers can be both negatives and positive numbers, in this specific case this native does not allow for an increment by setting the integer to negative.
 
Status
Not open for further replies.
Top