Task
Written by: Alian713, Kramb
1. xsTaskAmount¶
Returning Type: void
Prototype: void xsTaskAmount(int taskFieldId, float value)
Parameters:
int taskFieldId: Specifies which property of the task to change. Refer to cTaskAttr constantsfloat value: The value to set the task field to
Sets the value of the given field of the global XS task struct to the provided value. See also xsTask. It is recommended to always set all values before inserting or updating a task otherwise the insert/update might fail.
2. xsResetTaskAmount¶
Returning Type: void
Prototype: void xsResetTaskAmount()
Resets all the values of the global XS task struct to their defaults. See also xsTask.
3. xsGetObjectTaskCount¶
Returning Type: int
Prototype: int xsGetObjectTaskCount(int objectId, int playerId)
Parameters:
int objectId: The ID of the object to get the number of tasks forint playerId: The player whose object to get the number of tasks for
Returns the number of tasks the specific object for the given player has
4. xsGetUnitTaskCount¶
Returning Type: int
Prototype: int xsGetUnitTaskCount(int unitId)
Parameters:
int unitId: The ID of the object to get the number of tasks for
Returns the number of tasks the given unit has
5. xsObjectTaskAmount¶
Returning Type: bool
Prototype: bool xsObjectTaskAmount(int objectId, int playerId, int taskId)
Parameters:
int objectId: The ID of the object to get the task forint playerId: The player whose object to get the task forint taskId: The ID (index) of the task to get
Copies the provided task of the specific object from the given player into XS' global task struct
6. xsUnitTaskAmount¶
Returning Type: bool
Prototype: bool xsUnitTaskAmount(int unitId, int taskId)
Parameters:
int unitId: The ID of the unit to get the task forint taskId: The ID (index) of the task to get
Copies the provided task of the specific unit into XS' global task struct
7. xsGetTaskAmount¶
Returning Type: float
Prototype: float xsGetTaskAmount(int taskFieldId)
Parameters:
int taskFieldId: The task field to ge the value for. Refer to the Constant Reference for all the different task field IDs
Returns the given task field from XS' global task struct.
8. xsModifyObjectTasks¶
Returning Type: bool
Prototype: bool xsModifyObjectTasks(int objectId, int playerId, int taskId, bool edit)
Parameters:
int objectId: The ID of the object to modify the task forint playerId: The player whose object to modify the task forint taskId: The index to insert the task at- (Optional)
bool edit: If true, edit the task at the given index instead of inserting (ignored with negative indices)
A copy of the global XS task struct is inserted at the provided index in the task list of the specified object for the given player.
- ID N will insert the task at index N
- When edit = true, edit an existing task instead of inserting one.
- ID -(N+1) will remove the task at index N
9. xsModifyUnitTasks¶
Returning Type: bool
Prototype: bool xsModifyUnitTasks(int unitId, int taskId, bool edit)
Parameters:
int unitId: The ID of the unit on the map to modify the task forint taskId: The index to insert the task at- (Optional)
bool edit: If true, edit the task at the given index instead of inserting (ignored with negative indices)
A copy of the global XS task struct is inserted at the provided index in the task list of the specified unit.
- ID N will insert the task at index N
- When edit = true, edit an existing task instead of inserting one.
- ID -(N+1) will remove the task at index N
10. xsTask¶
Returning Type: void
Prototype: void xsTask(int objectOrClassId, int actionType, int targetObjectOrClassId, int playerId)
Parameters:
int objectOrClassId: The object or class ID to add the task toint actionType: Task type. Refer to cTaskType constants- (Optional)
int targetObjectOrClassId: Target object or class ID for the task to filter by. - (Optional)
int playerId: The player to whose objects the task will be inserted. If unspecified or -1, applies to all players except Gaia.
Adds a new (or edits an existing) task with the fields previously defined by calls to xsTaskAmount for the specified object at the end of the task list (see A.G.E.). If a task with the specified actionType, objectId, and Search Wait Time (set by xsTaskAmount) already exists, it is edited instead of a new one being added.
Note that xsTaskAmount modifies a global task struct which is re-used every time xsTask is called (For non programmers, this is similar to filling out a form once (the calls to xsTaskAmount) and then submitting multiple copies of it for different people)
11. xsRemoveTask¶
Returning Type: void
Prototype: void xsRemoveTask(int objectOrClassId, int actionType, int targetObjectOrClassId, int playerId)
Parameters:
int objectOrClassId: The object or class ID to remove the task from.int actionType: Task type. Refer to cTaskType constants- (Optional)
int targetObjectOrClassId: Target object or class ID for the task to filter by. - (Optional)
int playerId: The player from whose objects the task will be removed. If unspecified or -1, applies to all players except Gaia.
Removes a task from a object if the specified actionType, objectId, and Search Wait Time (set by xsTaskAmount) match an existing task in a object. No other fields are used for filtering (same as when xsTask edits instead of adding a new task)