• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Pages for more upgrades

Status
Not open for further replies.
Level 5
Joined
Jun 8, 2020
Messages
28
Is there any chance to create a PAGES for upgrades? I have only one building (main base) and i want to have 16 different kind of upgrades in this building, BUT there is only 12 avaliable slots. It means i can see only 12 of 16 upgrades. Any chance to solve it?
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
You can try using triggers, two buildings, and two abilities. Firstly, create two abilities based on instant cast ability such as roar or thunder clap. Don't forget to set their mana cost to 0. Name them "previous page" and "next page". Your main building needs to have the next page ability and your second building needs to have the previous page ability. Then we start using triggers. Your main building will be the "first page" and your second building will be the "second page".

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Next Page
  • Actions
    • Unit - Replace (Triggering unit) with a Blacksmith (Second) using The old unit's relative life and mana
    • Selection - Select (Last replaced unit) for (Owner of (Triggering unit))
This will give you your "Second Page" of upgrade list. To return to the main page, just make another trigger and do exactly the same.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Previous Page
  • Actions
    • Unit - Replace (Triggering unit) with a Blacksmith (Main) using The old unit's relative life and mana
    • Selection - Select (Last replaced unit) for (Owner of (Triggering unit))
This trick should work. This way you should have 11 available slots for each building but you can go back and forth between the pages to see all 16 of them. Maybe someone has a better solution but if not, feel free to try this one. ^_^
 
Last edited:
Level 22
Joined
Aug 27, 2013
Messages
3,973
Haven't tried this in practice but I wonder, wouldn't it also work to give a building a
shape shift ability (like Druid of the Claw/Talon) to turn into "another building" as well?
If it worked, that could have the same result without requiring a seperate trigger.
Supposedly, yes! It's a brilliant idea that I never thought of before!
I gave it a try right away but the building is stuck on its birth animation as soon as I used the morph ability (I used crow form and bear form). I'm not sure which part I did wrong. I don't understand why this happened.
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,687
By limiting the research level of an upgrade you're able to hide it from a unit's command card:
  • Player - Set the max research level of Iron Forged Swords to 0 for Player 1 (Red)

So you can avoid replacing/morphing your unit by creating a triggered system that limits research based on the unit's current page. These pages can be managed with abilities.

So if you had 24 upgrades in total on your unit, Page 1 would use upgrades 1 - 12 and page 2 would use upgrades 13 - 24. You'd need to limit (hide) upgrades 13 - 24 by default since the unit will start on page 1, and adjust these limitations when going from page 1 to page 2 and vice versa.

Although, you'll want to leave room for your Page abilities so 10 upgrades per page would probably be your limit.

It's not that difficult to do with some Arrays and For Loops.
 
Level 5
Joined
Jun 8, 2020
Messages
28
Yesterday i tested this method adding page. Actualy it is working good but couple of bugs appearing.
First thing is when i clicking next page building sometimes changing its position, it is visual bug.
Second is problem with slaves around. They stop bringing resourses.
Third is (in case if building is main base) after changibg page and replacing building with same type but (castle replacing by castle) for some reason requirement "Castle" apperaing on upgrades or buildings. If to change chapter back ( bring back castle old type) requirement disappearing.
Last to bugs i think have same case. Can not find solution yet, but still looking.
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
Second is problem with slaves around. They stop bringing resourses.
Most likely because the building they're supposed to return their resources to is gone (Because we replaced it with the new building). So you'll have to re-order them to do their job.

Third is (in case if building is main base) after changibg page and replacing building with same type but (castle replacing by castle) for some reason requirement "Castle" apperaing on upgrades or buildings. If to change chapter back ( bring back castle old type) requirement disappearing.
Once again, most likely because we have two separate buildings. Once you replace the building with the new one, the old building gets removed and your requirement becomes unfulfilled but when you replace it again with the old building, it becomes fulfilled once again.

These could be the cons of the trick. I'm not sure yet how to solve them as they might require a little bit more tinkering for a workaround to be found. However, I got a new idea thanks to Uncle's suggestion.

You can make two triggers. For the first one, we'll use it to hide the next page since very beginning. So you need to decide which upgrades are going to be on the second page and set their max research level to 0. Just like what I did down below.
  • Events
    • Map initialization
  • Conditions
  • Actions
    • -------- Initially Hide Next Pages --------
    • Player - Set the max research level of Long Rifles to 0 for Player 1 (Red)
    • Player - Set the max research level of Improved Lumber Harvesting to 0 for Player 1 (Red)
    • Player - Set the max research level of Magic Sentry to 0 for Player 1 (Red)
    • Player - Set the max research level of Flare to 0 for Player 1 (Red)
    • Player - Set the max research level of Control Magic to 0 for Player 1 (Red)

Then we'll make a second trigger. You need a boolean variable (initially false) to check whether the player already press the next page button or not. If not (which means they're still on the main page), when they do press the next page button, we'll show them the content of the next page and hide the content of the main page. But If yes (which means they're now on the second page), when they press the button again, we'll show them the content of the main page and hide the content of the next page. Like what I did here.
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Switch Page
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • NextPage Equal to False
      • Then - Actions
        • Set NextPage = True
        • -------- Show Next Pages --------
        • Player - Set the max research level of Long Rifles to 1 for Player 1 (Red)
        • Player - Set the max research level of Improved Lumber Harvesting to 2 for Player 1 (Red)
        • Player - Set the max research level of Magic Sentry to 1 for Player 1 (Red)
        • Player - Set the max research level of Flare to 1 for Player 1 (Red)
        • Player - Set the max research level of Control Magic to 1 for Player 1 (Red)
        • -------- Hide Previous Pages --------
        • Player - Set the max research level of Iron Forged Swords to 0 for Player 1 (Red)
        • Player - Set the max research level of Black Gunpowder to 0 for Player 1 (Red)
        • Player - Set the max research level of Storm Hammers to 0 for Player 1 (Red)
        • Player - Set the max research level of Iron Plating to 0 for Player 1 (Red)
        • Player - Set the max research level of Flying Machine Bombs to 0 for Player 1 (Red)
        • Player - Set the max research level of Improved Masonry to 0 for Player 1 (Red)
        • Player - Set the max research level of Defend to 0 for Player 1 (Red)
        • Player - Set the max research level of Animal War Training to 0 for Player 1 (Red)
        • Player - Set the max research level of Priest Adept Training to 0 for Player 1 (Red)
        • Player - Set the max research level of Sorceress Adept Training to 0 for Player 1 (Red)
        • Player - Set the max research level of Studded Leather Armor to 0 for Player 1 (Red)
      • Else - Actions
        • Set NextPage = False
        • -------- Show Previous Pages --------
        • Player - Set the max research level of Iron Forged Swords to 3 for Player 1 (Red)
        • Player - Set the max research level of Black Gunpowder to 3 for Player 1 (Red)
        • Player - Set the max research level of Storm Hammers to 1 for Player 1 (Red)
        • Player - Set the max research level of Iron Plating to 3 for Player 1 (Red)
        • Player - Set the max research level of Flying Machine Bombs to 1 for Player 1 (Red)
        • Player - Set the max research level of Improved Masonry to 3 for Player 1 (Red)
        • Player - Set the max research level of Defend to 1 for Player 1 (Red)
        • Player - Set the max research level of Animal War Training to 1 for Player 1 (Red)
        • Player - Set the max research level of Priest Adept Training to 2 for Player 1 (Red)
        • Player - Set the max research level of Sorceress Adept Training to 2 for Player 1 (Red)
        • Player - Set the max research level of Studded Leather Armor to 3 for Player 1 (Red)
        • -------- Hide Next Pages --------
        • Player - Set the max research level of Long Rifles to 0 for Player 1 (Red)
        • Player - Set the max research level of Improved Lumber Harvesting to 0 for Player 1 (Red)
        • Player - Set the max research level of Magic Sentry to 0 for Player 1 (Red)
        • Player - Set the max research level of Flare to 0 for Player 1 (Red)
        • Player - Set the max research level of Control Magic to 0 for Player 1 (Red)

However, this might affect all buildings of the same type. So if you switch page on one building the other buildings will have their page switched as well. I included a test map here, in case you want to try it out. Do note this trigger is far from perfect. As usual, if anyone has a better solution, please let us know. Hopefully this helps.
 

Attachments

  • Test.w3x
    761.7 KB · Views: 7

deepstrasz

Map Reviewer
Level 70
Joined
Jun 4, 2009
Messages
19,029
There are at least a couple of ways to do it, yes. There are some systems around on the site in the Spells section if I'm not mistaken.

Another sloppy way to do it, depending on your genre of map (in melee it would be a bit of a hassle) is to overlap buildings/units and have an ability that is called next page and when you click it, through triggers, one of the buildings under the main one will be selected. The buildings should have no pathing so they could be placed over each other. Or if you use simple units, they should be flying. To make them invisible simply add none.mdl to their custom model and add the Locust and Invulnerable abilities to them so they won't be selectable unless through triggers or F1 (if heroes) or through keys as from 1 to 0 if they are saved under a control group. To totally eliminate them being saved in control groups, they can be hidden and unhidden each time you press the next page ability of the visible/main building/unit. These dummy units/buildings could contain your researches.
This way you won't need to replace units via triggers so that normal pathing units that come by would get blocked or make the building appear somewhere else than where it was.
If you don't want to click a next page ability each time to get from one page to another, the main building/unit could contain abilities called page 1, 2 or maybe something more specific like footman upgrades, archer upgrades and when you click one of those, the proper dummy unit with the proper researches would be selected via triggers.

Or you could combine this with Shar Dundred's morph idea in that, you have a dummy building that has the next page(s) ability(ies) and when pressing next page, one invisible dummy unit could have the next page morph ability to shift through from page to page.
 
Last edited:
Status
Not open for further replies.
Top