1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Map Initialization Bug

Discussion in 'World Editor Help Zone' started by FrostCyrus, Oct 26, 2007.

  1. FrostCyrus

    FrostCyrus

    Joined:
    Jul 26, 2004
    Messages:
    100
    Resources:
    2
    Icons:
    1
    Skins:
    1
    Resources:
    2
    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])
     
  2. YoshiRyu

    YoshiRyu

    Joined:
    Jun 26, 2007
    Messages:
    686
    Resources:
    0
    Resources:
    0
    some action can't be performed at map init
    try to make these one after a 0.10 seconds wait
     
  3. FrostCyrus

    FrostCyrus

    Joined:
    Jul 26, 2004
    Messages:
    100
    Resources:
    2
    Icons:
    1
    Skins:
    1
    Resources:
    2
    The thing is, the lines that no longer work... used to before I messed around with the map some (added gold cost to monster wave units for training).
     
  4. Wraithwynd

    Wraithwynd

    Joined:
    Feb 20, 2007
    Messages:
    338
    Resources:
    0
    Resources:
    0
    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.
     
  5. iron_warrior

    iron_warrior

    Joined:
    Jun 18, 2004
    Messages:
    568
    Resources:
    1
    Models:
    1
    Resources:
    1
    Easy way to check...change Map Init to Elapsed Time - 2 seconds or something. Then see what happens.
     
  6. YoshiRyu

    YoshiRyu

    Joined:
    Jun 26, 2007
    Messages:
    686
    Resources:
    0
    Resources:
    0
    the gate doesn't meet the condition...

    You can't do that in a single trigger, actions are performed one by one

    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
    so that's something in the stuff he has added that makes these line uneffective
     
  7. FrostCyrus

    FrostCyrus

    Joined:
    Jul 26, 2004
    Messages:
    100
    Resources:
    2
    Icons:
    1
    Skins:
    1
    Resources:
    2
    Can you modify a player's gold amount at map initialization? That may be the problem... at least I hope it is...
     
  8. YoshiRyu

    YoshiRyu

    Joined:
    Jun 26, 2007
    Messages:
    686
    Resources:
    0
    Resources:
    0
    you should... disable this action and see what is appenning
     
  9. FrostCyrus

    FrostCyrus

    Joined:
    Jul 26, 2004
    Messages:
    100
    Resources:
    2
    Icons:
    1
    Skins:
    1
    Resources:
    2
    Turns out, everything after my "divert player income tax" line was nullified. Just removed the line and it worked out fine.