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

[Trigger] WC3 Triggering has a problem with the number "100"?

Status
Not open for further replies.
Level 4
Joined
Nov 6, 2011
Messages
44
  • British Isles IDs 1 to 5
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ProvinceID = 1
      • Set Province[ProvinceID] = Village 0010 <gen>
      • Set ProvincePoint[ProvinceID] = (Position of Province[ProvinceID])
      • Set ProvinceName[ProvinceID] = London
This is the trigger for a building, called a province in the map, with the ID of 1.
This trigger is needed for another trigger:

  • Province Names
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • For each (Integer ProvinceID) from 1 to 103, do (Actions)
        • Loop - Actions
          • Floating Text - Create floating text that reads ProvinceName[ProvinceID] at ProvincePoint[ProvinceID] with Z offset 200.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Custom script: call RemoveLocation(udg_ProvincePoint[udg_ProvinceID])
This trigger displays the string value of the variable "ProvinceName" as floating text over provinces with the IDs from 1 to 103(Because there are 103 provinces in the game).

e.g. It displays "London" over the province with the ID of 1.
This works properly.

  • The Balkans IDs 61 to 75
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ProvinceID = 61
      • Set Province[ProvinceID] = Village 0033 <gen>
      • Set ProvincePoint[ProvinceID] = (Position of Province[ProvinceID])
      • Set ProvinceName[ProvinceID] = Athens
This is meant to display "Athens" over the province with the ID of 61, this works fine too.

  • Set ProvinceID = 99
  • Set Province[ProvinceID] = Village 0162 <gen>
  • Set ProvincePoint[ProvinceID] = (Position of Province[ProvinceID])
  • Set ProvinceName[ProvinceID] = Smyrna
"Smyrna" over Province 99, this works fine as well(The trigger above is part of the trigger below). However . . .

  • Turkey and Cyprus IDs 96 to 103
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ProvinceID = 96
      • Set Province[ProvinceID] = Village 0035 <gen>
      • Set ProvincePoint[ProvinceID] = (Position of Province[ProvinceID])
      • Set ProvinceName[ProvinceID] = Angora
      • Set ProvinceID = 97
      • Set Province[ProvinceID] = Village 0161 <gen>
      • Set ProvincePoint[ProvinceID] = (Position of Province[ProvinceID])
      • Set ProvinceName[ProvinceID] = Bithynia
      • Set ProvinceID = 98
      • Set Province[ProvinceID] = Village 0173 <gen>
      • Set ProvincePoint[ProvinceID] = (Position of Province[ProvinceID])
      • Set ProvinceName[ProvinceID] = Anatalya
      • Set ProvinceID = 99
      • Set Province[ProvinceID] = Village 0162 <gen>
      • Set ProvincePoint[ProvinceID] = (Position of Province[ProvinceID])
      • Set ProvinceName[ProvinceID] = Smyrna
      • Set ProvinceID = 100
      • Set Province[ProvinceID] = Village 0160 <gen>
      • Set ProvincePoint[ProvinceID] = (Position of Province[ProvinceID])
      • Set ProvinceName[ProvinceID] = Adana
      • Set ProvinceID = 101
      • Set Province[ProvinceID] = Village 0177 <gen>
      • Set ProvincePoint[ProvinceID] = (Position of Province[ProvinceID])
      • Set ProvinceName[ProvinceID] = Kastamon
      • Set ProvinceID = 102
      • Set Province[ProvinceID] = Village 0176 <gen>
      • Set ProvincePoint[ProvinceID] = (Position of Province[ProvinceID])
      • Set ProvinceName[ProvinceID] = Trebizon
      • Set ProvinceID = 103
      • Set Province[ProvinceID] = Village 0041 <gen>
      • Set ProvincePoint[ProvinceID] = (Position of Province[ProvinceID])
      • Set ProvinceName[ProvinceID] = Cyprus
The lower part of this trigger does not work, it does not display the string value of ProvinceName over the provinces with ProvinceIDs from 100 and beyond.

I assume it is something wrong with "100". What could be causing it?

It is confirmed that all provinces with ProvinceIDs from 1-99 work properly as tested in-game.
 
Last edited:
Level 21
Joined
Aug 21, 2005
Messages
3,699
There's a limit of 100 floating texts. I'm not aware of workarounds.

One thing you could do is only create "visible" floating texts and destroy invisible ones. You'd periodically (i.e. every 5 seconds) check if any of the 103 provinces is within range of the game camera, and then create/destroy the relevant floating texts.
 
Level 4
Joined
Nov 6, 2011
Messages
44
There's a limit of 100 floating texts. I'm not aware of workarounds.

Even so, in the past, I ID'd provinces based on their names e.g. Village 0022 will have the ProvinceID of 22.

This resulted in me having strange ProvinceIDs, and the number of floating texts was maybe 6 - 10.

ProvinceIDs 10, 9, 22, 23, and some other IDs I can't exactly remember that were below 50 had floating text functioning above them, but the ones with Province IDs 203 and 204 did not. Note that the ProvinceIDs I had just mentioned were the only Province IDs in the game i.e. below 100 provinces.
 
Level 4
Joined
Nov 6, 2011
Messages
44
However, I'd been thinking, since 100 floating texts is the limit, I can make the floating text only to be created with the player pans his/her camera over the province? I don't really know how to work with camera triggers, so that would take some time for me to do. Although, would it work?
 
Level 4
Joined
Nov 6, 2011
Messages
44
I'll start working on it
However, thanks, both of you. I never knew there was a limit to floating text.
+rep

Edit:

Okay, before I tried what I mentioned above, I first removed some triggers which create floating text for some provinces, and so the total number of floating text went down to 93. This time, the floating text over the area which is meant to be activated by the removed trigger disappeared, as intended, however, the provinces with IDs from 100 and beyond STILL do not display the floating text. What's wrong? There is definitely a problem involving "100".
 
Last edited:
Level 8
Joined
Feb 3, 2013
Messages
277
I think it's because you've looped through 1 to 100 already. Why don't you shrink the array numbers since you took out a couple locations.

Or you can check whether the variable is null or not and then set up an if statement using a custom script line
If udg_ProvinceLocation[udg_Province] != null then
that way, the game won't create texttags if the location variable returns a null value. And you won't reach 100 texttags limit until you've "actually" created a 100 text tags.

EDIT: so something like this

  • Province Names
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • For each (Integer loopInt) from 1 to 200, do (Actions)
        • Loop - Actions
          • Custom script: if udg_provinceLoc[udg_loopInt] != null then
          • Floating Text - Create floating text that reads provinceName[loopInt] at provinceLoc[loopInt] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Custom script: call RemoveLocation(udg_provinceLoc[udg_loopInt])
          • Custom script: set udg_provinceLoc[udg_loopInt] = null
          • Custom script: endif
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
What about using number models and pre-placing them at the locations? I think a modeller could make for you the numbers from 0 to 9. It shouldn't be that hard.
 
Level 4
Joined
Nov 6, 2011
Messages
44
What about using number models and pre-placing them at the locations? I think a modeller could make for you the numbers from 0 to 9. It shouldn't be that hard.

Names, not numbers are meant to be displayed over the provinces.

I think it's because you've looped through 1 to 100 already. Why don't you shrink the array numbers since you took out a couple locations.
[/trigger]

What do you mean by I've looped through 1 to 100 already? There's only one trigger in the map that does use

  • For each (Integer ProvinceID) from 1 to 103, do (Actions)
 
Level 8
Joined
Feb 3, 2013
Messages
277
^ what i mean is, You create a text tag per loop regardless if the variable ProvidenceLocation refers to an empty handle or not. So even though some indexes of ProvidenceLocation are empty, no matter what, past loop 99, you won't create any more texttags.

SO, you have 2 options.
Seeing that you have less than 100 locations, what you can do is fill the empty indexes with the ones 100 and up.
or If you're too lazy, you can just set up an if else statement.
Either way, they're both easy to do lol.
 
Level 4
Joined
Nov 6, 2011
Messages
44
^ what i mean is, You create a text tag per loop regardless if the variable ProvidenceLocation refers to an empty handle or not. So even though some indexes of ProvidenceLocation are empty, no matter what, past loop 99, you won't create any more texttags.

SO, you have 2 options.
Seeing that you have less than 100 locations, what you can do is fill the empty indexes with the ones 100 and up.
or If you're too lazy, you can just set up an if else statement.
Either way, they're both easy to do lol.

Oh, I see what you're saying. However, I plan to have more than 100 text tags.
To counter the 100 floating texts problem I'm planning to only have the floating text be made when a player pans their camera over the location of the province(and disappear when out of sight of course), which looks to be challenging to make... well, to me, that is. I don't really have a grasp over camera triggers.
 
Level 4
Joined
Nov 6, 2011
Messages
44
u can create more than 100 text tags if u use the GetLocalPlayer trick. u can then have 100 per player. so about 1600 to 1800 max text tags. in my tutorial things a guier should know there is an explanation on GetLocalPlayer. then down the bottom there is a link to a more advanced tutorial that can help u further

I'll take the time to read your guide, seems very useful. Thank you. But anyways, the plan to only make the floating text only appear when the user has his/her camera over the location and disappear when out of sight is still under play, I think it'll work.
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,993
Creating FTs locally is a bit weird in this game. I guess it's supposed to see the names of the cities for all players, so when a player has enough sight to see a ciy, it won't be seen for that player. And if you created locally on that situation, it would just stack and leak.
So it's impossible to have more than 100 FTs in a game for all players
 
Status
Not open for further replies.
Top