Page 1 of 2 1 2 LastLast
Results 1 to 30 of 31

Thread: Info: scripting language

  1. #1
    Vushum
    Chieftain Vushum's Avatar
    Join Date
    20 Oct 2002
    Location
    Hell
    Posts
    39
    Country
    This is Vushum's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    Tell me about the scenario editor and triggers please. I've been wanting to know this for ages!

  2. #2
    MarkG
    Apolyton CS Co-Founder MarkG's Avatar
    Join Date
    01 Aug 1998
    Location
    Macedonia, Greece
    Posts
    24,504
    Country
    This is MarkG's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    13:48
    the scenario editor is not included in the preview betas.
    there is a whole scripting language with functions, variables, and everything that will give lots of powers to scenario makers
    triggers are like writing an if statement...
    Co-Founder, Apolyton Civilization Site
    Co-Owner/Webmaster, Top40-Charts.com | CTO, Apogee Information Systems
    giannopoulos.info: my non-mobile non-photo news & articles blog

  3. #3
    MarkG
    Apolyton CS Co-Founder MarkG's Avatar
    Join Date
    01 Aug 1998
    Location
    Macedonia, Greece
    Posts
    24,504
    Country
    This is MarkG's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    13:48
    i found an example of a trigger from the world conquest campaign
    Code:
      trigger (num_type(PLAYER1, "general") == 0) {
        player1_timer = time_sec() + general_defeat;        
        if (player2_timer < 0) {    
          print_game_msg("Your general has been killed!  Your 
    army will disintegrate in " + general_defeat + "seconds.");    
        }
      }
    Co-Founder, Apolyton Civilization Site
    Co-Owner/Webmaster, Top40-Charts.com | CTO, Apogee Information Systems
    giannopoulos.info: my non-mobile non-photo news & articles blog

  4. #4
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    Originally posted by MarkG
    i found an example of a trigger from the world conquest campaign
    Code:
      trigger (num_type(PLAYER1, "general") == 0) {
        player1_timer = time_sec() + general_defeat;        
        if (player2_timer < 0) {    
          print_game_msg("Your general has been killed!  Your 
    army will disintegrate in " + general_defeat + "seconds.");    
        }
      }
    Cool.

    The whole RT thing will make timings a whole new game in scripting me thinks, but it looks very good. And in-script message text is a big plus on SLIC
    Concrete, Abstract, or Squoingy?
    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

  5. #5
    MarkG
    Apolyton CS Co-Founder MarkG's Avatar
    Join Date
    01 Aug 1998
    Location
    Macedonia, Greece
    Posts
    24,504
    Country
    This is MarkG's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    13:48
    i hope bhg doesnt mind

    here is the 1st tutorial script
    Code:
    /******************************************/
    /*************RISE OF NATIONS**************/
    /***************TUTORIAL ONE***************/
    /**************Big Huge Games**************/
    /********Scripted by: Joshua Mitnick*******/
    /*******Storyboarded by: Doug Kaufman******/
    /***************July 25, 2002**************/
    /******************************************/
    
    /*******************************************************
    Scenario 1 - Boudicea vs. the Romans
    
    Map: A Briton village, bounded by mountains and forests.
    A Roman camp (obs tower and maybe a barracks) nearby.
    
    Setup: Several combat units on both sides. The Britons
    outnumber the Romans. The Britons have a scout, multiple
    slingers, and a few each of bowmen and hoplites. A
    Boudicea unit is in the lower left.
    ********************************************************/
    
    include "scripts.bhh"
    
    scenario {
    
      // nations
      labels {
        HUMAN = 1,
        COMPUTER = 2,
      }
    
      labels {
        FLAG_X           = 27,
        FLAG_Y           = 50,
        FLAG2_X          = 25,
        FLAG2_Y          = 33,
        BONUS_LEGIONS_X  = 35,
        BONUS_LEGIONS_Y  = 28,
        ARMY_CREATE_X    = 35,
        ARMY_CREATE_Y    = 28,
        ATTACK_TO_X      = 37,
        ATTACK_TO_Y      = 30,
      }
    
      static boudicea_id        = 19;  // HACK!!  find_unit(HUMAN, "BOUDICEAN");
      static briton_id          = find_city_id("Briton");
      static Briton_X           = object_position_x (HUMAN, briton_id);
      static Briton_Y           = object_position_y (HUMAN, briton_id);
      static Legions_create_X   = Briton_X;
      static Legions_create_Y   = Briton_Y;
      static barracks_id        = find_build(COMPUTER, "barracks");
      static R_Barracks_X       = object_position_x (COMPUTER, barracks_id);
      static R_Barracks_Y       = object_position_y (COMPUTER, barracks_id);
      static lookout_id         = find_build( COMPUTER, "lookout" );
      static lookout_x          = object_position_x( COMPUTER, lookout_id );
      static lookout_y          = object_position_y( COMPUTER, lookout_id );
      static tower_destroyed    = false;
      static barracks_destroyed = false;
    	static army_destroyed     = false;
      static objective_delay    = 60;
    
      run_once {
        bubble_text_hide();
        set_explored(HUMAN, ( (R_Barracks_X + lookout_x ) / 2) , ( ( R_Barracks_Y + lookout_y ) / 2 ), 10);
        disable_all_triggers();
        set_unique_unit( "BOUDICEAN", "Boudicea" );
        set_object_type_max_health( "barracks", 250 );
        set_object_type_max_health( "lookout", 125 );
        disable_type("Citizen");
    		set_music_volume(50);
        enable_trigger("Global");
        enable_trigger("Start");
        set_timer("progress_check",objective_delay );
      }
    
    	trigger Objective_Reminder( timer_expired("progress_check") && sound_finished() ) {
    		clear_all_arrows();
    		draw_screen_arrow_line(200, 0, 200, 90, 10 );
    		play_sound("objective.wav");
        if(objective_delay < 300) {
         objective_delay = objective_delay * 2;
        } else {
         objective_delay = 300;
        }
    		set_timer("progress_check", objective_delay);
    		enable_trigger("Objective_Reminder");
    	}
    
      trigger Start () {
        //WAV: We must remove the Romans from the lands of Briton.  Lead Boudecia back to the city 
    	//     where we will muster our troops to drive the Romans out.
        play_sound ("boudicea.wav");
        enable_trigger("Select_a_unit");
        enable_trigger("Select_Boudicea");
        enable_trigger("Objective_Reminder");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Select_a_unit( sound_finished() ) {
    
        //WAV: "You must select a unit before you can give it orders. Move the mouse over Boudicea and left click to 'select' her."
        add_objective("Left click on Boudicea.", "Select_boudicea", "select_boudicea.wav");    
    		play_objective_sound("Select_boudicea");
    
        enable_trigger ("Select_Boudicea");
        enable_trigger ("Ping_Boudicea");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Select_Boudicea( object_selected(HUMAN, boudicea_id ) ) {
        disable_trigger ("Ping_Boudicea");
        disable_trigger("Select_a_unit");
    		objective_complete("Select_boudicea");
    
        // WAV: "Well done. You can be sure you have the right unit by looking at the name of 
    	// the unit you've selected in the lower right panel. Now you can give Boudicea orders."
        play_sound("boudicea_selected.wav");
    
        // draw arrow to unit display info
        unit_display_left = get_button_left("right_window");
        unit_display_top  = get_button_top("right_window");
        draw_screen_arrow_line( unit_display_left - 100, unit_display_top - 100, unit_display_left, unit_display_top, 0 );
    
        enable_trigger ("Move_a_unit");
        enable_trigger ("Deselect_Boudicea");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Deselect_Boudicea( !object_selected(HUMAN, boudicea_id )) {
        play_sound ("lostboud.wav");
        //WAV: Left-clicking on the map will clear all selections. To regain control of Boudicea, left click on her, then
    	//     right click where you want her to go.***/
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Ping_Boudicea( sound_finished () && !object_selected(HUMAN, boudicea_id ) ) {
        ping_object (1, 1, 1, boudicea_id);
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Move_a_unit( sound_finished () &&  object_selected(HUMAN, boudicea_id ) ) {
        clear_all_arrows();
    		add_objective("Select Boudicea and right click on the flag.", "Move_boudicea", "move_boudicea.wav");
        play_objective_sound("Move_boudicea");
        //WAV: "To move a unit, select it and then right-click on the map where you want it to go. 
        //      With Boudicea selected, move her toward the flag in the upper right.
        add_flag (FLAG_X, FLAG_Y);
        enable_trigger("Flag");
        enable_trigger("reveal_flag");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger reveal_flag(sound_finished() ) {
        set_explored( HUMAN, FLAG_X, FLAG_Y, 5 );   
      }
    
      trigger Flag(object_near (HUMAN, boudicea_id, FLAG_X, FLAG_Y, 2)) {
        disable_trigger("reveal_flag");
        objective_complete("Move_boudicea");
        clear_flags ();
        play_sound ("at_flag.wav");
        // WAV: "Very good. Now we'll guide your boudicea back to the village and rally the troops."
    		disable_trigger("Deselect_boudicea");
        enable_trigger ("Learn_scroll");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Learn_scroll (sound_finished ()) {
        // WAV: Briton is off the screen to the upper right.  To see off the screen, move the mouse cursor to the edge of the screen and a little beyond.
        //      This is called scrolling.  Scroll to find Briton in the upper right now.
    		add_objective("Locate Briton by scrolling to the upper right.", "Find_briton", "learnscroll.wav");
    		draw_screen_arrow_line (get_screen_width() - 100, 100, get_screen_width(), 0, 10 );
    		play_objective_sound("Find_briton");	
    		set_timer("progress_check",objective_delay);
    		enable_trigger("camera_over_village");
      }
    
    	trigger camera_over_village( is_on_screen (object_position_x(HUMAN, BRITON_ID)-1, object_position_y(HUMAN, BRITON_ID)-1)){
        clear_all_arrows();
    		objective_complete("Find_briton");
        // wav:  Very good.  You found the city of Briton.  Now, right click to move boudicea to the flag outside the village.
    		add_objective("Right click to move your unit to the flag.", "Move_to_briton", "move_b_village.wav");
        add_flag (FLAG2_X, FLAG2_Y);
    		enable_trigger("Deselect_boudicea");
    		play_objective_sound("Move_to_briton");
    		enable_trigger("Knows_moving");
    	}
    
      trigger Knows_moving (object_near_build (HUMAN, boudicea_id, HUMAN, BRITON_ID, 8)) {
        objective_complete("Move_to_briton");
        clear_flags();
        play_sound ("boudicearejoins.wav");
        //WAV: "Good work! You've successfully guided Boudica back to Briton so we can start rallying our troops. But before we attack, we must first we must find our hated foe."
        disable_all_triggers ();
    		disable_trigger("Deselect_boudicea");
        enable_trigger ("Global");
        enable_trigger ("Learn_zoom");
    		enable_trigger ("Objective_Reminder");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Learn_zoom (sound_finished ()) {
        scrolling_lock ();
      /***WAV: "To see more of the map and have a better chance of locating the Romans,"
        "zoom out by rolling the mousewheel backward (or pressing the Page Up key twice)."***/
        add_objective("Roll the mousewheel back or press PageUp twice to zoom out.", "zoom_out", "learnzoom.wav");
    		play_objective_sound("zoom_out");
        enable_trigger ("Zoom_out");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Zoom_out (is_zoomed_out ()) {
        scrolling_unlock ();
    		objective_complete("zoom_out");
    
        add_objective("Locate the Roman camp by scrolling the map to the bottom right.", "find_camp", "zoomlearned.wav");
        play_objective_sound("find_camp");
      //WAV: Well done. Now that you know how to zoom out, it will be easier
      //to locate the Roman camp. Scroll to the bottom right until you find it.
        draw_screen_arrow_line (get_screen_width() - 100, get_screen_height() - 100, get_screen_width(), get_screen_height(), 10 );
        enable_trigger ("Find_camp");
      }
    
      trigger Find_camp (is_on_screen (R_Barracks_X+10, R_Barracks_Y+10)) {
        clear_all_arrows();
        //ping_object (1, 1, 2, barracks_id);
      
        mid_x = ( R_Barracks_X + lookout_x ) / 2;
        mid_y = ( R_Barracks_Y + lookout_y ) / 2;
    
        ping(1, 1, mid_x, mid_y );
        add_flag( mid_x, mid_y );
    		objective_complete("find_camp");
        play_sound ("foundcamp.wav");
      //WAV: "Excellent, you've found the Roman camp. Now let's take a"
      //"closer look at their defenses."
        enable_trigger ("Mouseover");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Mouseover (sound_finished ()) {
        clear_flags();
        ping_object (1, 1, 2, barracks_id);
        //WAV: Moving the mouse over anything in the game will show you the help text in the lower
        //     left corner.  Move your mouse over the Roman Barracks.
    		add_objective("Move your mouse over the Roman barracks", "over_barracks", "mouseover.wav" );
    		play_objective_sound("over_barracks");
        enable_trigger("Over_tower");
        enable_trigger("Over_barracks");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Over_tower( sound_finished() && get_object_type_at_mouse (COMPUTER, "Lookout") ) {
        play_sound("over_tower.wav");
        //WAV: You have highlighted the roman tower.  The barracks are just below it and to the right.
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Over_barracks( sound_finished() && get_object_type_at_mouse (COMPUTER, "Barracks") ) {
        objective_complete("over_barracks");
        disable_trigger("Over_tower");
        play_sound ("overbarracks.wav");
      /***WAV: "Notice the help text in the lower left--it says this building is used to produce troops.
      We'd better destroy it quickly! Let's get our units organized and attack!"***/
    		enable_trigger("scouting_complete");
      }
    
    	trigger scouting_complete( sound_finished() ) {
    		play_sound("knowrposition.wav");
              //WAV: Excellent! Now you know a lot about the Roman position. Let's get our units organized, and attack.
    
    		enable_trigger("Attack_the_Romans");
    		set_timer("progress_check", objective_delay);
      }
    
      trigger Attack_the_Romans (sound_finished ()) {
        center_camera_on (HUMAN, find_military (HUMAN));
    		add_objective("Select all troops with a drag box.", "all_troops", "multiselect2.wav");
    		play_objective_sound("all_troops");
      /***WAV: "You can select your whole army at once with a drag box."
          "Hold the mouse near your units, left-click, then drag the mouse
          "to create a box around all your troops."***/
        enable_trigger ("All_troops");
        enable_trigger ("Not_all_troops");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Not_all_troops ( (num_unit_selected (HUMAN) > 1) && (num_unit_selected (HUMAN) < num_military_units (HUMAN) )) {
        play_sound ("notall.wav");
      /***WAV: You selected some, but not all, of your troops. Try again, and make a bigger box.***/
    		set_timer("progress_check",objective_delay);
      }
    
      trigger All_troops (all_military_selected (HUMAN)) {
        disable_trigger ("Not_all_troops");
        objective_complete("all_troops");
    		add_objective("Right-click to move your troops into the Roman camp.","destroy_camp", "alltroops.wav");
    		play_objective_sound("destroy_camp");
        
        mid_x = ( R_Barracks_X + lookout_x ) / 2;
        mid_y = ( R_Barracks_Y + lookout_y ) / 2;
    
        ping(1, 1, mid_x, mid_y );
        add_flag( mid_x, mid_y );
      /***WAV: "Good work. You successfully selected all of your troops.  Now send"
          "your troops toward the Roman position. If they stop close to an enemy building"
          "or unit, they'll attack automatically. Destroy the Roman camp.  We'll teach them"
          "to march into our town!"***/
    	  enable_trigger ("Deselect_army");
        set_timer("deselect_timer", 1 );
    		enable_trigger("Destroy_camp");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Global (have_fought (HUMAN, COMPUTER)) {
    		
        clear_flags ();
        clear_all_arrows ();
        scrolling_unlock ();
        create_unit(COMPUTER, R_Barracks_X - 4, R_Barracks_Y, "Legions", 2);
    
        if (is_trigger_enabled ("Destroy_camp")) {
          play_sound ("attackbegun.wav");
          //WAV: "The attack is begun! To attack specific targets, select the attacking
          //unit and right click on an enemy.  If you want a better view of the action, 
          // you can zoom in by rolling the mouse wheel forward or pressing the page down key multiple times.
          enable_trigger ("See_health");
          enable_trigger ("Deselect_army");
        } else {
          play_sound ("earlyattack.wav");
      /***WAV: Good work General. Apparently you don't need any help in order to conquer the Romans. Good luck!***/
          clear_objectives();
          disable_all_triggers ();
          enable_trigger ("Destroy_camp");
        }
    
    		objective_complete("destroy_camp");
    		add_objective("Destroy Roman army",     "destroy_army",     "alltroops.wav" );
    		add_objective("Destroy Roman barracks", "destroy_barracks", "alltroops.wav");
    		add_objective("Destroy Roman lookout",  "destroy_lookout",  "alltroops.wav");
        enable_trigger ("Destroy_tower");
        enable_trigger ("Destroy_barracks");
    		enable_trigger ("Destroy_army");
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Deselect_army (sound_finished () && (num_unit_selected (HUMAN) == 0 ) && timer_expired("deselect_timer") ) {
        play_sound ("lostarmy.wav");
      /***WAV: You have troops that are not selected who are not attacking. Select them with a left click or
          drag box and get them in the fight!***/
    		enable_trigger("Deselect_army");
        set_timer("deselect_timer", 10);
      }
    
      trigger See_health (sound_finished ()) {
        play_sound ("damage.wav");
      /***WAV: As the fight progresses, you can see units and buildings taking damage. Each selected unit and building has a green
          bar above it when it's at full strength. As they are hit by the enemy, this bar shrinks and becomes yellow and then
          red. When the health bar is all gone, the unit or building is destroyed.***/
    		set_timer("progress_check",objective_delay);
      }
    
      trigger Destroy_tower (building_type_destroyed (COMPUTER, "Lookout")) {
        tower_destroyed = true;
    		objective_complete("destroy_lookout");
      }
    
      trigger Destroy_barracks (building_type_destroyed (COMPUTER, "Barracks")) {
        barracks_destroyed = true;
    		objective_complete("destroy_barracks");
      }
    
    	trigger Destroy_army( num_military_units(COMPUTER) < 1 ) {
    		army_destroyed = true;
    		objective_complete("destroy_army");
    	}
    
      trigger Destroy_camp (tower_destroyed && barracks_destroyed && army_destroyed) {
        disable_all_triggers ();
        play_sound ("congrats.wav");
      /***WAV: Congratulations!  You've leveled the Roman camp.  But it won't be long before"
          "they'll be back in strength.  We'd best be ready.***/
        enable_trigger ("Bonus");
    		disable_trigger("Objective_Reminder");
      }
      //==========================================================
    
    
      //Putting it all together===================================
      trigger Bonus (sound_finished ()) {
        set_timer ("Help", 4);
        Legions = create_unit (COMPUTER, BONUS_LEGIONS_X, BONUS_LEGIONS_Y, "Legions", 1);
        unit_attack_order(COMPUTER, Legions, HUMAN, BRITON_ID);
    		zoom_in_on(HUMAN, BRITON_ID);
        enable_trigger ("Help_out");
        enable_trigger ("The_end");
      }
    
      trigger Help_out (timer_expired ("Help")) {
      /***WAV: The vile Romans have launched a sneak attack against Briton! We must come to her aid.***/
    		center_camera_on(HUMAN, find_military(HUMAN) );
    	  add_objective("Briton is under attack! Right-click to move your troops to defend the city!", "sneak_attack", "sneakattack.wav");
    		play_objective_sound("sneak_attack");
        enable_trigger ("Reinforce");
    		enable_trigger("Deselect_army");
      }
    
      trigger Reinforce (num_military_units (HUMAN) < 1) {
        create_unit (HUMAN, ARMY_CREATE_X, ARMY_CREATE_Y, "Hoplites", 7);
        for (i = 0; i < num_military_units (HUMAN); i++) {
          ID = find_military (HUMAN);
          unit_attack_to_order (HUMAN, ID, ATTACK_TO_X, ATTACK_TO_Y);
        }
      }
    
      trigger The_end (num_military_units (COMPUTER) < 1) {
        objective_complete("sneak_attack");
    		play_sound ("victory.wav");
    		/***WAV: Congratulations! You have fended off the evil Romans***/
        enable_trigger("The_real_end");
      }
    
      trigger The_real_end( sound_finished() ) {
        victory( HUMAN );
      }
      //==========================================================
    }
    Co-Founder, Apolyton Civilization Site
    Co-Owner/Webmaster, Top40-Charts.com | CTO, Apogee Information Systems
    giannopoulos.info: my non-mobile non-photo news & articles blog

  6. #6
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    Thanks Markos
    Concrete, Abstract, or Squoingy?
    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

  7. #7
    Peter Triggs
    King
    Join Date
    25 Jan 2000
    Location
    Gone Fishin, Canada
    Posts
    1,059
    Country
    This is Peter Triggs's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    You bet. Lots of new stuff to learn about! Thanks again Markos.

  8. #8
    Locutus
    Deity Locutus's Avatar
    Join Date
    23 Nov 1999
    Location
    De Hel van Enschede
    Posts
    11,705
    Country
    This is Locutus's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    13:48
    Good stuff, thanks Markos

    Very C-like language, from the looks of it - more so than CtP's SLIC anyway. That's good news for programmers () but might make things a bit harder to get into for non-programmers (). Let's hope there will be good newbie-friendly documentation...

    Assuming there are sufficent functions and triggers (and this certainly looks promising), this could turn out to be a very powerful and versatile scripting language. Hats off to BHG
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

  9. #9
    Vushum
    Chieftain Vushum's Avatar
    Join Date
    20 Oct 2002
    Location
    Hell
    Posts
    39
    Country
    This is Vushum's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    Will the language be simplified so the people who can't read it can?

  10. #10
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    Pray for documentation

    If not, I'm sure somebody who does figure it out pretty quick will write a helpful "How To" guide.
    Concrete, Abstract, or Squoingy?
    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

  11. #11
    adaMada
    King adaMada's Avatar
    Join Date
    19 Mar 2000
    Location
    "The Iron" Stadium, Ubergorsk, Apolytonia (C3DG)
    Posts
    1,848
    Country
    This is adaMada's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    06:48
    WoW! That looks AWSOME!

    I've never actually worked on game modding/scn making much, but I might have to with such a wonderful looking language. Locutus is right, though -- being a C programmer, I'm thrilled, but non-programmers might not have it quite so easy.

    -- adaMada
    Civ 3 Democracy Game:
    PTW Game: Proud member of the Roleplay Team, and Ambassador to Glory of War
    Intersite PTW Game: Member of Apolyton

  12. #12
    tniem
    King
    Join Date
    04 Apr 2000
    Location
    Hope College
    Posts
    2,232
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    06:48
    Wow! Allowing full scripting language for scenarios is incredibly powerful and fantastic for the game and the community.

    Does anyone know the following questions:

    Is there going to be a scenario editor that is easier than a scripting language?

    Can we edit AI strategies with the scripting language?
    About 24,000 people die every day from hunger or hunger-related causes. With a simple click daily at the Hunger Site you can provide food for those who need it.

  13. #13
    Viking Berserk
    Chieftain Viking Berserk's Avatar
    Join Date
    03 Nov 2002
    Location
    of Hammerfest
    Posts
    69
    Country
    This is Viking Berserk's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    12:48
    cant scenarios be made the old editor way???
    i dont even understand that kind of scripts.

  14. #14
    MarkG
    Apolyton CS Co-Founder MarkG's Avatar
    Join Date
    01 Aug 1998
    Location
    Macedonia, Greece
    Posts
    24,504
    Country
    This is MarkG's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    13:48
    scripting is for doing things like triggering events, etc
    civ editing, city placement, etc will have nothing to with the scripting
    Co-Founder, Apolyton Civilization Site
    Co-Owner/Webmaster, Top40-Charts.com | CTO, Apogee Information Systems
    giannopoulos.info: my non-mobile non-photo news & articles blog

  15. #15
    Peter Triggs
    King
    Join Date
    25 Jan 2000
    Location
    Gone Fishin, Canada
    Posts
    1,059
    Country
    This is Peter Triggs's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    Yes, Tim Train confirmed that there will be the standard sort of scenario editor.

    I think, but am not sure about this, that there may be some sort of intermediate scripting editor which will simplify writing triggers.

  16. #16
    Viking Berserk
    Chieftain Viking Berserk's Avatar
    Join Date
    03 Nov 2002
    Location
    of Hammerfest
    Posts
    69
    Country
    This is Viking Berserk's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    12:48
    what about the old way of triggering???

  17. #17
    Peter Triggs
    King
    Join Date
    25 Jan 2000
    Location
    Gone Fishin, Canada
    Posts
    1,059
    Country
    This is Peter Triggs's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    What do you mean "the old way"? What game are you talking about? (Civ2?) If not, could you give an example of a trigger?

  18. #18
    Vushum
    Chieftain Vushum's Avatar
    Join Date
    20 Oct 2002
    Location
    Hell
    Posts
    39
    Country
    This is Vushum's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    I thinkk maybe AoK or SWGB, that sort of thing, just with more options. All we would like to know BHG- Will it be simplified or will have to wait for a patch or for fellow players to make one?

  19. #19
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    The AoK system was quite good, but it could have been improved significantly by adding loops and global variables to act as yes/no things, rather than being forced to use unit existance or something.
    Concrete, Abstract, or Squoingy?
    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

  20. #20
    Peter Triggs
    King
    Join Date
    25 Jan 2000
    Location
    Gone Fishin, Canada
    Posts
    1,059
    Country
    This is Peter Triggs's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    Obsidian has just posted a very lengthy account of the recent Fanstock event at BHG's headquarters:

    http://ron.heavengames.com/press/eve...ock/day1.shtml

    Herer's the part that's relevent to this thread:


    Scenario Editor

    Now for the part all you scenario designers have been waiting for, the Scenario Editor. One of the first things you do when you start the editor is select your map size. This gives you a large square area to work with as the starting template for the map. On this square you can draw a rough outline of your map. This keeps you from having to draw the entire map out tile by tile when you are starting your work. Scott began by drawing out a rough version of the boot shape for the Italian peninsula. With a simple click, the entire map was generated to reflect what he had drawn. After the map was created, the process of adding things like mountains, forests, cities and units to the scenario involved simply selecting what you wanted and clicking on where it should go.

    [Scott Lewis, the Scenarios and tools programmer] created the city of Rome and gave it some citizens as well as a few Praetorian Guards for defense. We then went to the north and created a small city for the barbarians that we would be using to attack the city of Rome. It was here that Scott showed us the scripting engine that the game uses for its Scenarios. I’ll start by saying that when I saw what this thing was capable of, my jaw dropped.[My emph] The scripting language in and of itself was structured very similar to C++ or javascript. There are of course some proprietary commands that are specific to the game, but the syntax is very similar so anyone familiar with those languages should feel right at home. Scott wrote a small script that would cause the enemy city to the north to select an idle set of troops every few seconds and send them down to attack the city of Rome.

    This is the part where the game really impressed me. You could set actual breakpoints in your scripts to verify that the script was executing as designed. “Why did that guy go over there? That’s not what I wanted him to do” Just set the break point in the script and you can start seeing where things went wrong. They have also included the ability to reference other scripts in your current script. So if I wrote an AI script that improved on the way the computer organized forces for attacks, all you would need to do is provide the path to the location of my script and you would have all the functionality available to you. About the only thing that is missing from the editor at this point is an immediate window where you can check the values of variables on the fly and intellesense. For those unfamiliar with intellisense, it is a nifty little feature where the editing screen gives you information about the command you are typing. It really helps in keeping all those function calls straight and free of errors. When I mentioned this to Scott he said that it was actually something they were considering adding.
    It just keeps getting better, eh.

  21. #21
    HuangShang
    King HuangShang's Avatar
    Join Date
    15 Jul 2002
    Location
    Berkeley
    Posts
    1,376
    Country
    This is HuangShang's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    04:48
    didnt nVidia come out w/ a new language for games?
    i dont know how this all works but i read news about that
    i understand the senario editor is very important in any game, but EE and starcraft definately had some of the best

  22. #22
    Locutus
    Deity Locutus's Avatar
    Join Date
    23 Nov 1999
    Location
    De Hel van Enschede
    Posts
    11,705
    Country
    This is Locutus's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    13:48
    Sounds VERY, VERY impressive... MrOgre but especially Mike Breitkreutz could learn something from this...
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

  23. #23
    WarpStorm
    King WarpStorm's Avatar
    Join Date
    07 Nov 2001
    Location
    Right down the road
    Posts
    2,321
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    06:48
    This is awesome. It looks like they opened up total control. Thanks Brian, Jason, Jason, and co.

    To give Mike B some credit, he didn't design the original Civ3 engine or editor. Adding something like this after the fact will be much tougher than designing it in from the beginning.

  24. #24
    St Leo
    King of Scenario League St Leo's Avatar
    Join Date
    13 Jul 2005
    Location
    In search of pants
    Posts
    5,085
    Country
    This is St Leo's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    07:48
    didnt nVidia come out w/ a new language for games?

    That has to do with game graphics and not the real meat. Most games are still bein programmed in C++ and no replacement is likely to appear.
    Blog | Civ2 Scenario League | leo.petr at gmail.com

  25. #25
    WarpStorm
    King WarpStorm's Avatar
    Join Date
    07 Nov 2001
    Location
    Right down the road
    Posts
    2,321
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    06:48
    The only other language I've seen a mainstream game done in lately is Python. Even then the time intensive portions were written in C++.

  26. #26
    Amesjustin
    Warlord Amesjustin's Avatar
    Join Date
    18 Feb 2002
    Location
    of nothing
    Posts
    287
    Country
    This is Amesjustin's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    04:48
    I CANNOT WAIT! I haven't really been been following RON all that much, and am surprised by this. As a VFP/VB/C#/HTML/SQL developer, this kind of open-source coding in a game of this magnitude REALLY appeals to me. Just imagine the scenarios everyone will be making....

  27. #27
    Peter Triggs
    King
    Join Date
    25 Jan 2000
    Location
    Gone Fishin, Canada
    Posts
    1,059
    Country
    This is Peter Triggs's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    This isn't really about scripting, but is more info on RoN's modifiability. Rohag posted on the WebQuad forums:

    http://www.webquad.com/forums/index....ST&f=23&t=1285

    One of the reasons I became interested in RoN is that the game’s developer, Big Huge Games of Baltimore, Maryland USA, seems to be relatively open to discussing the ideas behind the game and the design process.

    I gather that in the process of design and coding developers have a number of in-game “tools” they use to modify, tweak and debug progressive builds of a game. Sometime last summer (?) the BHG design team decided to leave some of these tools in RoN for fans to use after release. Yes, there will be an editor, but these “sandbox” features (I’m using the term Brian Reynolds used) can be accessed directly from game setup.

    You can set up a single-player “game” with all the players “human” – you can control everyone with or without a supporting national-level AI (unit-level AI remains). All you need do is click on a unit or building and you take control of that nation; you can repeatedly switch among allies and enemies. I took advantage of this in the Preview Beta to set up the Nuke Effects screens: I chose two human-controlled nations in the Modern Age without national-level AI support, developed one to attack and one to be attacked, advanced the target nation to the Information Age, took the "before" shot and saved the game, switched control to the attacker, sent over the Modern Age nuke, took the screenshot, reloaded the saved game, advanced the attacker to Information and developed ICBMs, attacked again and took the third screenshot.

    After RoN is released I’m interested in using the editor and these sandbox features to set up some historical battles, with me controlling both sides. While paused I’ll give orders to both sides and then watch the action, trying out all sorts of maneuvers and what-ifs.

    I would imagine if you’re really in for a single-player challenge, you could set up a game with several nations with national-level AI support for all. You could jump from nation to nation either helping the victors or the underdogs, perhaps your self-imposed goal being to keep every nation in the game until the Information age.

    Well, these are pre-publication musings. I hope BHG retains all the sandbox features they now have. It was always fun in my days of cardboard counters and map gaming to play solitaire and set plan against plan.
    The more tools, the better.

    BTW: What, no arrays !

  28. #28
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    Woo yeah! Tools are great.

    No arrays PATCH!!
    Concrete, Abstract, or Squoingy?
    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

  29. #29
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    If you do maths, just imagine a matrix...

    Bascially, arrays are variables that can store more than one value. Pretty much like a table. For example, in SLIC, the CtP/2 scripting language, you can have (one-dimensional) arrays that act like a row of a table, storing numbers for example.
    In other languages they can store other variable types, strings, integers, etc.

    One-D array with size 3:
    defined as Array[3]


    012


    It was hoped that RoN scripting would allow multi-dimensional scripting, so that each array index (position in the array) would act as a row in itself, or in other words form a proper "table"

    2D array with size 3,3
    defined as: Array[3][3]




    000102
    101112
    202122



    So a string array defined:
    array NewArray[];
    NewArray[0] = "Hello "
    NewArray[1] = "Tassandar"
    NewArray[2] = "5000"

    print(NewArray[0] + NewArray[1] + NewArray[2])

    would give "Hello Tassandar5000"

    But of course their use is far more flexible, because it allows you to access the indices within 'for' loops and such, so it has a distinct advantage over just using many variables, not to mention the lines/time spent defining and remembering what each variable would otherwise be.

    eg.
    for(i=0; i < 3; i ++){
    print(NewArray[i])
    }

    would again bring out "Hello Tassandar5000"
    Last edited by Immortal Wombat; March 31, 2003 at 17:11.
    Concrete, Abstract, or Squoingy?
    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

  30. #30
    Immortal Wombat
    Prince Immortal Wombat's Avatar
    Join Date
    30 Dec 2000
    Location
    in perpetuity
    Posts
    4,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    April 23, 2014
    Local Time
    11:48
    Code:
    static boudicea_id        = 19;  // HACK!!  find_unit(HUMAN, "BOUDICEAN");
    Incidentally...

    good thing: units are integers
    bad thing: no sign of direct DB access to them

    good thing: units are also strings
    bad thing: find_unit(player, unit) only works on strings??
    Concrete, Abstract, or Squoingy?
    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

Page 1 of 2 1 2 LastLast

Similar Threads

  1. SLIC2-Scripting-Language
    By Martin Gühmann in forum CtP2 Creation
    Replies: 0
    Last Post: November 26, 2010, 19:07
  2. Will Civ3 Have A Scripting Language?
    By Peter Triggs in forum Civ3-General-Archive
    Replies: 67
    Last Post: October 8, 2001, 06:04
  3. SLIC Scripting Language
    By Mr Ogre in forum Call to Power 1
    Replies: 0
    Last Post: July 27, 1999, 15:04

Visitors found this page by searching for:

disable_type rise of nations

rise of nations scripting language

rise of natuons scripting objectives

info on scripting language

rise of nations boudicea

Bookmarks

Posting Permissions