Thread Tools
Old March 22, 2003, 22:46   #1
ahenobarb
Prince
 
ahenobarb's Avatar
 
Local Time: 22:20
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
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

??
ahenobarb is offline  
Old March 23, 2003, 16:52   #2
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 00:20
Local Date: November 2, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
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!"
Martin Gühmann is offline  
Old March 26, 2003, 13:24   #3
ahenobarb
Prince
 
ahenobarb's Avatar
 
Local Time: 22:20
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
Quote:
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.
ahenobarb is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 18:20.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team