Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
17 years ago
This tutorial has been made an official page on Generals World.
  • C&C Generals: Zero Hour: World Builder: Tutorials: Using Markers as Script Conditions, Instead of Flags 
  • ----

    There are times when you would like to communicate between player folders when writing scripts. This however is not possible.

    The Value of a Marker
    In case some of you don't understand how a Marker could be used, let me give you an example.
    Let's say you have a four player map but only want supply docks where a person or computer AI is playing. (You hate the scramble for those extra supplies or something.)

    *Name your supply piles. (You've probably done that already to adjust the cash amount.)

    *Place any civilian non-moving unit for each start position in the Combat Zone and name them something like 1NotPlaying, 2NotPlaying ect.

    *In each AI folder make a script that would remove this marker if AI is playing.

    *** IF ***
    Player '' starting position is 1 .
    *** THEN ***
    Unit '1NotPlaying' is removed from the world.

    Make a script like this for each start position in each AI folder.

    Then in your civilian folder make a script to look for these markers.

    *** IF ***
    Unit '2NotPlaying' is inside area 'CombatZone'
    *** THEN ***
    Unit 'Supply2' is removed from the world.
    Unit '2NotPlaying' is removed from the world.

    Then also make a script to remove the marker where the local player is playing.

    *** IF ***
    Player '' starting position is 1 .
    *** THEN ***
    Unit '1NotPlaying' is removed from the world.

    And of course cover all start locations for each of these scripts.
    And there you have it.
    All markers are removed from the map as well as supplies where no one is playing.

    Note: You need to load skirmish scripts into your map for this to work.

    Download Attachment: UserPostedImage AI_Scripts.zip 
    229.98 KB

    NOTE: The removal of supplies from a non-active location really doesn't require all this. I just used that as an example. I am now using markers more than flags for setting conditions as I find them more reliable and they work across Player folders. They can be spawned underground and removed as conditions change. A very useful tool I think.
    Sponsor
    MicScoTho
    17 years ago
    This tutorial has been made an official page on Generals World. Thanks for your contribution and permission, Drummin!

    http://www.cncgeneralsworld.com/generals/zerohour/worldbuilder/tutorials/using-markers-as-script-conditions.aspx 
    UserPostedImage