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

Game Maximums and triggering

Status
Not open for further replies.
Level 3
Joined
Aug 21, 2004
Messages
57
I have three questions which I really want answers to. (of course, that's why people ask questions :roll:)

1) I know that there is a current maximum of 25 skeletons per player at any given time. Can this maximum be changed, and if so, how?

2) Does the trigger term (Last Created Unit) only apply to the last unit made using the (Create Unit) function in THAT one trigger, or does (Last Created Unit) refer to the last unit made using the (Create Unit) function in ANY of your triggers?

3) What in the world are Arrays and how do you use them? :? I've never been able to figure it out myself >< Could someone please explain to me what Arrays are and perhaps show me an example of how to use them please?

Thanks in advance. :)
 
Level 4
Joined
Aug 31, 2004
Messages
106
1. Don't think I can help you much on this one, but if it can be changed, it will be in "gameplay constants" under the "advanced" menu.
2. I'm pretty sure it refers to the one in that trigger, but that again needs a second opinion.
3. Arrays are just groups of variables. for example, if you had an array of string variables, they would all have the same name but there is a number after it called in index, so if you stored "monkey" in yourvar[1] and "brains" in yourvar[2], that would be using the array. It is just a convenient way of grouping similar variables.

Where this can come really useful is with integer loops, for example, you can say,
For each integer from 1 to 10, do actions:
loop - actions: set yourvar[forloop integer A] to true

That would be in case of a boolean array, where you can instantly turn all your variables into something with only one command.
 
Level 8
Joined
Apr 3, 2004
Messages
507
Did you try what he suggested? You need to tell us where you're at in trying to solve your problem.

(Last Created Unit), unless it's extremely unique as far as standard variables, almost certainly counts the last unit created by any trigger.

The only reason that the last created unit wouldn't be from the same trigger that you call for that variable in is if you have a game-wait, and during that game-wait another trigger runs that creates a unit.
 
Level 9
Joined
Sep 8, 2004
Messages
633
(last created unit) refers to the last unit that came to existance in the game, in any way, triggered, built, trained, summoned.

Also, if a unit is created (whatever way), and no other units are created from that moment on, for the rest of the map, last created unit will always refer to that unit, which was the last one to be created.
 
Level 3
Joined
Aug 21, 2004
Messages
57
1) I've looked many times in Game Constants and the Object Editor before, but I can't find anything on the skeleton maximum. I found out the 25 skeletons per player limit on Internet. Still not sure whether it can be changed.

2) Thanks.

3) Erm.... arrays >< still not too sure.... can someone give another example for me please? ^_^'
 
Level 3
Joined
Jul 27, 2004
Messages
28
Arrays:
A good example would be setting a unit equal to a variable. Lets say the units are the same, but controlled by different people or on different teams. Lets say the unit is a paladin. Rahter than making two variables Paladin1 and Paladin2, you can make a variable Paladin an array with an index of 2. This way the first paladin is equal to Paladin[1] and the second paladin is equal to Paladin[2].

Arrays are just a way to cut down on the number of variables used. They are especially nice when you have lots of similar things.
 
Level 3
Joined
Aug 21, 2004
Messages
57
1) Can anyone give me any confirmation for this? The Raven? Vexorian? Darky? lol
2) Covered.
3) Thanks. I'll have to try using arrays from now on. :)
 
Level 3
Joined
Aug 21, 2004
Messages
57
Eusira said:
Have you looked at the Raise Dead ability itself?

yea..... can't find any maximums there... I'm still not sure... can't seem to find the skeleton maximum anywhere >< I really want to have more than 25 skeletons at a time :D
 
Level 8
Joined
Apr 3, 2004
Messages
507
misaki, there's already a GUI trigger to limit any unit-type you want.

(Last Created Unit) does not, I believe, include units made by anything but the Create Unit(s) triggers.

The reason that variable arrays are the most useful is that you can use variable to reference the array index.

Say that you wanted to track the number of, oh, say, kills for each player. You can make an integer array, let's call it intArKills, and store the value for each player in an index corresponding to that player's number. So, whenever a player kills a unit, you increase intArKills[(Player Number of (Owner of (Killing Unit)))] by one. Thus, intArKills[1] is the kills for player 1, intArKills[2] is for player 2, etc.

The other thing that arrays are most useful for is storing information about ability levels. For example, if you want to trigger increased movement speed for a unit for each level of Hex it has, you can make a trigger that fires when a unit learns a level of Hex and gives it realArMovespeed[(Level of (Hex) for (Learning Hero))] extra movement speed.
 
Status
Not open for further replies.
Top