New scripting function - pickDroidStructLocation

For AI and campaign script related discussions and questions
Post Reply
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

New scripting function - pickDroidStructLocation

Post by Per »

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.
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: New scripting function - pickDroidStructLocation

Post by DylanDog »

pickDroidStructLocation(droid, defStructs[count], ref buildX, ref buildY, me, -1)

What is the meaning of the last parameter (-1) ?
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: New scripting function - pickDroidStructLocation

Post by Per »

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).
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: New scripting function - pickDroidStructLocation

Post by DylanDog »

This new function has a bug: #1755 opened
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
Post Reply