• 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.

"Build Menu" Next Page Button

Status
Not open for further replies.
Level 2
Joined
Aug 24, 2014
Messages
8
Hey Everybody :)

I am trying to create a different version of a Wintermaul (some of you may know this ;)) and I got some kind of "problem". I've got 15 races, but one builder can only have 11 buildings in the Menu. I saw in other maps some kind of "next page" Button, but I don't remember the map (or I don't have it anymore), or I cannot open it because it is protected. I looked up the seach function, but the only kinda useable way offered was the spellbook - version, but this is not recommended (since it's a normal unit and no hero) and I would like to play it with people not knowing wc 3 that good.

If you know a way without Jass (No Skills yet, want to try it on later maps), I would be very thankful.
___
Since my mothertongue is german and not english, there could be some mistakes in my spelling or sentence-construction. Be merciful :)

With greetings,
Scaraset

PS: Link to spellbookthread: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/mysteries-spellbook-33039/
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
You can use a Spellbook with no problem, just make it a spellbook looking like regular building thing (icon etc.) but handle the available buildings with the build ability (I think it's an item ability that enables building something), and add the "Next page" ability that just orders the builder to use a hidden spellbook ability that has the rest of the building.

Alternatively, you can make "generic" build boxes based on the building size, which you can later (once built/placed) be upgraded to the real buildings. Like

2x2 Building
Can be upgraded to:
- Defense tower
- Sentry watch
- Mana pool

3x3 Building
Can be upgraded to:
- Town Hall
- Barracks
- Hero's Altar
 
Level 2
Joined
Aug 24, 2014
Messages
8
well thank you for commenting it that quick :)

I don't find a way to make the tiny buildings cost gold and lumber, but if I try it in a melee map, they cost that. How can I change this?

I came up with another question while thinking bout this. The Section Game constants comes up with a part "Advanced buildings" and "normal Buildings". Is there a way for me to use these advanced buildings? I don't remember seeing them in my whole warcraft life, neither in campaign.


EDIT: While looking up for the Spellbook thing, I found a way I am more comfortable with: The Druid of the Claw ability, where he changes to his alternate form. Juest tried it out and it works perfectly well. If you would still answer my questions, you'd be great, but it's not neccessary now :)
 
Last edited:
Level 2
Joined
Aug 24, 2014
Messages
8
that's exactly the thing I'm working on. But I've just discovered that I can't build in bear form?!? I made 2 Builder (Race Chooser and Race Chooser 2). I got them the switch ability based on bearform. But if I change the Race Chooser to RC 2, he can't build anything. I set the order, the lumber will be removed, but as he "starts" building, he stops, I get the lumber back and nothing really happened. Same if I try it with RC 2 at first. He can build, the changed form can't.

Any idea?

EDIT: I use a trigger now, that replaces the casting unit (RC) with RC2 and changed, seemes to work way better, but still no idea why morph won't work..
 
Last edited:
Level 15
Joined
Oct 29, 2012
Messages
1,474
that's exactly the thing I'm working on. But I've just discovered that I can't build in bear form?!? I made 2 Builder (Race Chooser and Race Chooser 2). I got them the switch ability based on bearform. But if I change the Race Chooser to RC 2, he can't build anything. I set the order, the lumber will be removed, but as he "starts" building, he stops, I get the lumber back and nothing really happened. Same if I try it with RC 2 at first. He can build, the changed form can't.

Any idea?

EDIT: I use a trigger now, that replaces the casting unit (RC) with RC2 and changed, seemes to work way better, but still no idea why morph won't work..

Be sure to remove leaks, and make it MUI if your map is Multiplayer's.
Leaks will affect that much.

I am not sure why Morph doesn't work but I guess it's Warcraft nativity since Morphing units aren't used to build.
 
Level 2
Joined
Aug 24, 2014
Messages
8
Be sure to remove leaks, and make it MUI if your map is Multiplayer's.
Leaks will affect that much.
[...]

What do you mean with the first part. MUI?


It probably is hard coded. Note that replacing units removes all variable references.

Only to understand: I have RC in a unit group, so if I replace it, it will be automaticly removed of the group? If yes, I can delete one line *yey* :D

Another Question: The Units stuck with themselves if I play a race, where almost everyone has a cold attack. Sometimes it happens, that the unit seemes to "lag" (move pause move etc.) Any idea how to fix this?

EDIT: Could fix the question; explaination: I made several frost attacks due to different graphics, but then I removed it in the ablility and moved it to the unit itself. Now i reduced the several spells to one and it seems to work for now
 
Last edited:
Level 28
Joined
Sep 26, 2009
Messages
2,520
MUI means Multi-Unit Instanceability. It means that even if multiple units use your *system/spell/whatever* at the same time, it will work for all of them. It requires you to use arrays and an indexing method to correctly save all units currently using the system.
 
Level 2
Joined
Aug 24, 2014
Messages
8
MUI means Multi-Unit Instanceability. It means that even if multiple units use your *system/spell/whatever* at the same time, it will work for all of them. It requires you to use arrays and an indexing method to correctly save all units currently using the system.


Well I use the arrays in some ways but I doN't know how to use them in your way. Could you go further?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Well, arrays are variables with multiple slots where each slot has its own index number so you have easy access directly to each slot.
This is how an array would look like graphically (the red number is the index of the slot)
Code:
 ______________________
|[U]  [SUP][COLOR="Red"]0[/COLOR][/SUP]|  [SUP][COLOR="Red"]1[/COLOR][/SUP]|  [SUP][COLOR="Red"]2[/COLOR][/SUP]|  [SUP][COLOR="Red"]3[/COLOR][/SUP]|  [SUP][COLOR="Red"]4[/COLOR][/SUP]| ...[/U] and so on up to index 8191

Indexing works by having an integer variable that keeps the current amount of used slots (so you don't loop through all 8192 slots if only 3 units are indexed) - this variable is usually called <name of system>_Index or something similar so you know immediately what it is for.
If you have three units which are indexed in the following order: Footman first, Peasant second, Rifleman third, then the unit array would have them indexed like this:
Code:
 _________________________________________
|[U] Footman [SUP][COLOR="Red"]1[/COLOR][/SUP]| Peasant [SUP][COLOR="Red"]2[/COLOR][/SUP]| Rifleman [SUP][COLOR="Red"]3[/COLOR][/SUP]|  [SUP][COLOR="Red"]4[/COLOR][/SUP]| ...[/U]
and ..._Index variable having value 3.
Notice we started with index 1. While arrays start with index 0, it is just the mapper's convenience to start with number 1 as first indexing slot, there's nothing else in it.

All things related to this unit in other arrays (for example an array that keeps how much damage they did) are saved into arrays under same index. So all things in some system related to Footman are saved under index 1, because that's how we saved that footman in our system.

Now there's deindexing. That's when the unit no longer uses the system and it is a way to clear the unit and its data out of all arrays.
If we only removed the unit, we would have holes in our array. Look at how would our array look if we removed Peasant from the array:
Code:
 __________________________________
|[U] Footman [SUP][COLOR="Red"]1[/COLOR][/SUP]|  [SUP][COLOR="Red"]2[/COLOR][/SUP]| Rifleman [SUP][COLOR="Red"]3[/COLOR][/SUP]|  [SUP][COLOR="Red"]4[/COLOR][/SUP]| ...[/U]
and ..._Index variable having value 3.
Notice the game would still need to loop through index 1 to 3 and so it makes 1 extra useless loop (loop through index number 2) because that index is empty. It is very inefficient even if you try to re-use those empty slots for new units.

So to solve this problem during deindexing you remove the unit in question and all its data from arrays and place there the last indexed unit. Then you decrease the ..._Index variable by 1. Let's say Footman is deindexed. The array would look like this:
Code:
 __________________________________
|[U] Rifleman [SUP][COLOR="Red"]1[/COLOR][/SUP]| Peasant [SUP][COLOR="Red"]2[/COLOR][/SUP]|  [SUP][COLOR="Red"]3[/COLOR][/SUP]|  [SUP][COLOR="Red"]4[/COLOR][/SUP]| ...[/U]
and ..._Index variable having value 2.
We removed footman and into his slot we put the last indexed unit, which in this case was the rifleman. We also decreased the ..._Index variable by 1 (so the final value is number 2) and so we loop only two times.

It may seem complicated, but once you grasp the concept it's actually simple.
I would, however, advise you to look at the tutorial section in the Trigger (GUI) section and search for tutorials about MUI and indexing - those will explain it better and in more detail than I did.
 
Level 2
Joined
Aug 24, 2014
Messages
8
Instead of replacing unit with a trigger, use Hero passive transformation, so some things won't be messed up (buffs, references to the unit, items...).

Since it's only a race chooser, and all other replacings work fine, I think I just change the RC. My only different replacement was the random race --> dummy tower changes to Tier X [random int] (you see, I use arrays :D). No need for buffs or anything else to last.
 
Status
Not open for further replies.
Top