• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Map Initialization Bug

Status
Not open for further replies.
Level 5
Joined
Jul 26, 2004
Messages
99
My map initialization trigger isn't completely executing. Not sure why. I know that SOME of it is executing, but other parts of it aren't.

I'm currently trying to figure out why this would be a problem. Lemme know if there are any general things not to do upon initialization.

Here's the trigger:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Player((Integer A))) to (Player 12 (Brown) start location) over 0.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) controller) Equal to User
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Unit - Creat 1 Hero Select Helper for (Player((Integer A))) at (Player 12 (Brown) start location) facing Default building facing degrees
              • Player - Set (Player((Integer A))) Food cap to 1
            • Else - Actions
              • Unit - Remove (Random unit from (Units owned by (Player((Integer A))) of type Personal Training)) from the game
          • Player - Make (Player((Integer A))) treat Player 11 (Dark Green) as an Ally with shared vision
          • Player - Make Player 11 (Dark Green) treat (Player((Integer A))) as an Ally with shared vision
          • Player - Divert (100 / (Number of players in (All players matching (((Picked player) slot status) Equal to Is playing))))% of the Gold income of Player 11 (Dark Green to (Player((Integer A)))
        • Player - Turn Gives bounty On for Player 12 (Brown)
        • Player - Set Player 12 (Brown) Current gold to 50000
        • Destructible - Open Gate (Horizontal) 0004 <gen> *THIS LINE DOES NOT ACTIVATE!!
        • Destructible - Pick every destructible in (Playable map area) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Or - Any (Conditions) are true
                  • (Destructible-type of (Picked destructible)) Equal to Felwood Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Felwood Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Northrend Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Northrend Canopy Tree
              • Then - Actions
                • Trigger - Add to Tree Regrowth <gen> the event (Destructible - (Picked destructible) dies)
              • Else - Actions
                • Do nothing
        • -------- Set Training Units --------
        • Set UnitType_Allies[0] = Footman
        • Set ...
        • Set UnitType_Wave5Elite[4] = Unholy Prophet (Wave 5: Elite)
        • -------- Initiate Training -------- *NONE OF THE STUFF BELOW ACTIVATES!!
        • Unit Group - Pick every unit in (Units of Type Monster Hut (Wave 1)) and do (Unit - Order (Picked unit to train/upgrade to a UnitType_Wave1[0])
        • Unit Group - Pick every unit in (Units of Type Monster Hut (Wave 1: Elite)) and do (Unit - Order (Picked unit to train/upgrade to a UnitType_Wave1Elite[0])
        • Unit Group - Pick every unit in (Units of Type Castle) and do (Unit - Order (Picked unit to train/upgrade to a UnitType_Allies[0])
 
Level 8
Joined
Feb 20, 2007
Messages
338
We need to address all of the stuff you have going on all at the same time.

You are asking the computer to pick every single destructible on the map and to do something with the ones meeting X condition. That includes the gate you want to Open. The computer may be passing up on it checking it against the condition, but you are asking the computer to do two things with the same object at the same time.

That tree picker needs to be in its own trigger, in the same folder that you have the tree regrowth trigger tied into I guess when a destructible dies. Picking all of your trees can wait for many seconds into the game - I would aim for a lapse time trigger of at least 5 seconds if not more. Come on how fast are those peons harvesting anyway? ;)

I would also have a pause between each and every "pick unit - unit group" at the bottom. I would run it like so:

Wait .01 sec
Unit Group - Pick every unit in... etcetera and so forth
Wait .01 sec
Unit Group - Pick every unit in... etcetera and so forth
Wait .01 sec
Unit Group - Pick every unit in... etcetera and so forth
Wait .01 sec

Then you can run your set variables.

Personally I set variables all together in a different trigger like your: Set UnitType_Allies[0] = Footman - these are all empty functions and I would assume that early on in the game it does not need to be done so perhaps it can be triggered at the bottom of your map initialization where supposedly the computer would have shuffled, stacked, filed and picked units and set up everything at the initialization then set all of the settings.

Also do you have a game testing map initializing trigger? Like one that sets the black mask and fog off, and perhaps helps you to skip through a lot of stuff to get to the area or thing you are testing? If so you might want to shut that off and see if things work.
 
Level 9
Joined
Jun 26, 2007
Messages
659
You are asking the computer to pick every single destructible on the map and to do something with the ones meeting X condition. That includes the gate you want to Open.
the gate doesn't meet the condition...

you are asking the computer to do two things with the same object at the same time.
You can't do that in a single trigger, actions are performed one by one

Picking all of your trees can wait for many seconds into the game - I would aim for a lapse time trigger of at least 5 seconds if not more.
And doing it in a other trigger won't avoid it to take 5 seconds

in this trigger, it's not because of the "pick tree" loop that the pointed actions doesn't work
and i guess that to test his map, he have waiting longer enough to reach the end of this trigger

has he said
the lines that no longer work... used to before
so that's something in the stuff he has added that makes these line uneffective
 
Status
Not open for further replies.
Top