Announcement

Collapse
No announcement yet.

Looking for water

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

  • Looking for water

    Has anyone had any luck with either of these functions:


    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

  • #2
    Unfortunatyl I never tried them, that is I found in Locutus' version of the SLIC1 documentaion:

    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!"

    Comment


    • #3
      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

      Comment

      Working...
      X