Announcement

Collapse
No announcement yet.

What did I click?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What did I click?

    Another one of those troublesome SLIC problems. If you are looking at one of the screens in CTP2 like the diplomacy screen, how do you tell SLIC what civilization you have selected in the menu? (i.e. just highlighted, not highlighted and then cliked through to the next screen)

    I've been trying this for cities selected in the National Manager with CitySelected and CityClicked with no luck. I am hoping someone (Locutus?) may have run across this problem while they were working on improving the diplomacy in the game.

    Also, regarding the CityClicked function; when you click a city, is the city that you clicked assigned to the variable within the parenthesis:

    city_t tmpCity
    CityClicked(tmpCity) // The City selected through the GUI is now tmpCity


    Or is it the reverse

    GetCityByIndex(g.player, 3, tmpCity); //Assigns player's city 3 to tmpCity
    CityClicked(tmpCity) // tells CTP2 that tmpCity is the CityClicked

    ??

  • #2
    CityClicked is an event and it works if you click on the city on the map, if you want to have access cia the GUI you should try the event CitySelected. The syntax you have to use should look like this:

    Code:
    city_t MGCity;
    
    HandleEvent(CitySelected)'MG_CitySelected'post{
         MGCity = city[0];
    }
    And that will save the selected city into a global city variable for use somewhere else in the script. BTW don't forget the semicolons.

    -Martin
    Civ2 military advisor: "No complaints, Sir!"

    Comment


    • #3
      Originally posted by Martin Gühmann
      CityClicked is an event and it works if you click on the city on the map, if you want to have access cia the GUI you should try the event CitySelected. The syntax you have to use should look like this:

      Code:
      city_t MGCity;
      
      HandleEvent(CitySelected)'MG_CitySelected'post{
           MGCity = city[0];
      }
      And that will save the selected city into a global city variable for use somewhere else in the script. BTW don't forget the semicolons.

      -Martin
      Thanks, Martin. It doesn't sound like either of those commands will work for what I am trying to do.

      What I am trying to do is have the City Manager screen open for a city selected in the national manager. I've added a new button to the National manager for this. The code works for OpenTrade or OpenScience commands, but it does not work for the OpenCity command because I don't know how to tell CTP2 what city I have highlighted in the Nat Man. Therefore, it doesn't know which city to open. CTP2 reads the highlighting when you click the Build Manager button, but I don't know how to do this in SLIC.

      Comment

      Working...
      X