Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > CtP2-Creation/AI/Mods/Scenarios-Archive > Exchange city
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread   
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:16
  Old Post 19-12-2001 03:00 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#31 Report this post to a moderator
Tired of ads?

I'm gonna look into this into more detail tonight, hopefully I'll be able to address all your issues tomorrow...

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:16
  Old Post 19-12-2001 15:53 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#32 Report this post to a moderator
Support Apolyton, buy Civilization 2

I almost got it to work myself but the computer did not like the find get nearest city command.

I will tell you what I was going to do anyway I was going to find the nearest city every time a barbarian moved and then match the city over the captured one to find the owner

As you may be a ware there are a few errors already in your script so to save you time here is were they are

if (IsHumanPlayer(LOQ_oldCityOwner) {

needs to be changed to

if (IsHumanPlayer(LOQ_oldCityOwner)) {

and

if (LOQ_capturedCity.owner = 0) {

should be

if (LOQ_capturedCity.owner == 0) {

that was it with the errors if you could help me with the find nearest city bit I may be able to sort it.

any way I am here will Friday and then its Christmas

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:16
  Old Post 19-12-2001 18:40 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#33 Report this post to a moderator
Put an end to popups!

I ran the code (after fixing the typos you already mentioned) and had no problems whatsoever with it: it (seemed to) work exactly as advertised. Could you explain in more detail what exactly goes wrong according to you?

As far as nearest city goes, I'll post a bit more about that tonight, don't have much time now. What exactly did is wrong with it? Did you get an error while using it or does it just not do what it should or whatever?

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:16
  Old Post 20-12-2001 15:48 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#34 Report this post to a moderator
Support Apolyton buy from Amazon

right when the barbarians capture one of my cities .
I don't get the message box up .

when I look at the code I notes that the city is changed to barbarian and then you take the city owner which at this time is now barbarian. so it does not work.

it loads up ok just the function it is meant to do does not work.
it just sends the barbarian money around in a circle.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:16
  Old Post 20-12-2001 17:09 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#35 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

Actually, as you can see in this event:

code:
// when a city is captured, store old owner HandleEvent(CaptureCity) 'LOQ_BarbCaptureCityPre' pre { LOQ_capturedCity = city[0]; LOQ_oldCityOwner = city[0].owner; }


the owner is stored PRE, so before a city is captured. I used the same code to store the old owner of a captured city for the Militia code of the MedMod (and Cradle and Alex and whatever) and it works just fine there. Executing the code on my system, like I said before, also works perfectly. Perhaps you forgot to #include the file or something silly like that (happens to the best of us)? In any case, you can check if the code is actually being executed by putting in an addition messagebox somewhere with "Message(1, 'GotHere') and make a messagebox that displays a simple text message ("Got Here" ). If this doesn't work in the game, the code obviously isn't being executed at all, otherwise you have a very weird problem

I'm afraid I didn't get around to looking into the GetNearestCity function (I'll try again tonight but no promises) but I seem to vaguely remember it being bugged. If that is the case, you could try cycling to all cities of all players and store the city with the smallest distance to the location you need. Something roughly like this:

code:
nearest = 9999999999; // rediculously large number for (i = 0; i < 32; i++) { player[0] = i; for (j = 0; j < player[0].cities; j = j + 1) { GetCityByIndex(i, j, tmpCity); if (SquaredDistance(currentLoc, tmpCity.location) < nearest) { nearest = SquaredDistance(currentLoc, tmpCity.location); nearestCity = tmpCity; } } }


PS I use SquaredDistance instead of Distance because it's (slightly) faster (obviously, since Pythagoras is used to calculate distance).

Last edited by Locutus on 20-12-2001 at 17:20

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:16
  Old Post 20-12-2001 19:51 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#36 Report this post to a moderator
Browse Apolyton AD-FREE

All I know is that every time they nick one of my cites they don't offer it me back I will try to put in a dumb msg box. and will get back to your tomorrow. not that it will do much good were braking up tomorrow at 12 GMT so I will talk more after the holidays.

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:16
  Old Post 07-01-2002 17:30 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#37 Report this post to a moderator
Suffering from ads?

i am back. with all the new threads and stuff I am like a kid in a toy shop

got it working and started to mod it. I need a bit of help with Teleporting the barbarians out of the city can you help locutos.

 
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:16.
Apolyton Time is 00:16.
    top of page
Rate This Thread:
archivepost
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0472 seconds (87.30% PHP - 12.70% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net