Thread Tools
Old March 14, 2003, 06:51   #1
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 21:43
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
Looking for water
Has anyone had any luck with either of these functions:

Quote:

INT GetNearestWater (fromLocation, toLocation)

Return the nearest water square to fromLocation in toLocation
-------------------

INT FindCoastalCity(player, cityvar)

Find a city next to the ocean and put it in cityvar. Returns 0 if no coastal cities are found.
I keep getting 'wrong type of argument' errors
Peter Triggs is offline  
Old March 14, 2003, 14:11   #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: 23:43
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
Unfortunatyl I never tried them, that is I found in Locutus' version of the SLIC1 documentaion:

Quote:
INT GetNearestWater(location, locationvar)
Get the location of the nearest ocean square to location, putting the result in locationvar. Also returns the distance in patched version.

INT FindCoastalCity(player, cityvar)
Find a city next to the ocean and put it in cityvar. Returns 0 if no coastal cities are found.
Probably you already got what they mean. So my solution would be brute force, the Trial and Error method of testing all possible variable types. Fortunatly we only have location_t, army_t, city_t, int_t and unit_t if I did not forgot anyone. But actual stupid to give the first function a unit_t as argument.

For the second function I could give you an explanation or at least an idea, in the SLIC2 documentaion you find this:

player.owner - An integer version of the player.

That means there is a difference between integers and players, the only problem is that in most situation players and ints should be interchangable. But if you use DebugSlic=Yes you figure out that you should care attention if you are using ints or players.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old March 14, 2003, 14:42   #3
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 23:43
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
I'm pretty sure I've had both functions working, but that may have been in CtP1...

Will check my notes and do some testing if I have time tonight.
__________________
Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery
Locutus 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 17:43.


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