In the next release, whatever that will be named, there will be a new script function pickDroidStructLocation(). I had to introduce this function because the pickStructLocation() and pickStructLocationB() function calls do not check that you can actually build on the position the function returns. See #1626 for a closer explanation of the issue. Future code should use the new pickDroidStructLocation() rather than the other two. Parameter wise it is the same as pickStructLocationB() except it has a new first parameter that is the droid to build the structure. If it returns true, the coordinates it sets are guaranteed to be reachable by that droid.
The default AI scripts will be updated to use this function as time permits.
New scripting function - pickDroidStructLocation
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
-
DylanDog
- Code contributor

- Posts: 347
- Joined: 08 Apr 2009, 15:15
- Location: Germany
Re: New scripting function - pickDroidStructLocation
pickDroidStructLocation(droid, defStructs[count], ref buildX, ref buildY, me, -1)
What is the meaning of the last parameter (-1) ?
What is the meaning of the last parameter (-1) ?
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: New scripting function - pickDroidStructLocation
IIRC, the last parameter is, like for pickStructLocationB, the maximum number of blocking tiles adjacent to the building. -1 means any number is allowed (useful for defenses).
-
DylanDog
- Code contributor

- Posts: 347
- Joined: 08 Apr 2009, 15:15
- Location: Germany
Re: New scripting function - pickDroidStructLocation
This new function has a bug: #1755 opened