User:EAi/Tasks: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: <task name="CTaskComplexDriveToPoint" parent="CTaskComplexCarDrive"> <constructor> <param name="vehicle" type="vehicle" /> <param name="target" type="vector" /> ...)
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
A proposed way to expose tasks to scripts, and perhaps allow network syncing. Hasn't really been fully explored...
  <task name="CTaskComplexDriveToPoint" parent="CTaskComplexCarDrive">
  <task name="CTaskComplexDriveToPoint" parent="CTaskComplexCarDrive">
     <constructor>
     <constructor address="0x1234567">
         <param name="vehicle" type="vehicle" />
         <param name="vehicle" type="vehicle" />
         <param name="target" type="vector" />
         <param name="target" type="vector" />
Line 7: Line 9:
     </constructor>
     </constructor>
     <members>
     <members>
         <variable name="target" type="vector" />
         <variable name="target" type="vector" sync="true" />
         <variable name="mode" type="integer" />
         <variable name="mode" type="integer" />
         <padding length="4" />
         <padding length="4" />
         <variable name="hasAchievedTarget" type="bool" />
         <variable name="hasAchievedTarget" type="bool" />
     </members>
     </members>
    <functions>
        <function name="isTargetBlocked" address="0x12345678">
            <param name="ped" type="ped" />
        </function>
    </functions>
  </task>
  </task>
This file would generate some interface for lua to create these tasks, set the members and call their functions. It should also let these things be mapped to gta classes (using the addresses). The order of the members and constructor params matters. The members directly lay out the order of members in the class and hence has to match exactly.
Implementation is probably a 2-3 days work and if implemented well some aspects could be used to help export other game-level functions.

Latest revision as of 22:01, 20 March 2009

A proposed way to expose tasks to scripts, and perhaps allow network syncing. Hasn't really been fully explored...

<task name="CTaskComplexDriveToPoint" parent="CTaskComplexCarDrive">
    <constructor address="0x1234567">
        <param name="vehicle" type="vehicle" />
        <param name="target" type="vector" />
        <param name="cruiseSpeed" type="float" />
        ...
    </constructor>
    <members>
        <variable name="target" type="vector" sync="true" />
        <variable name="mode" type="integer" />
        <padding length="4" />
        <variable name="hasAchievedTarget" type="bool" />
    </members>
    <functions>
        <function name="isTargetBlocked" address="0x12345678">
            <param name="ped" type="ped" />
        </function>
    </functions>
</task>

This file would generate some interface for lua to create these tasks, set the members and call their functions. It should also let these things be mapped to gta classes (using the addresses). The order of the members and constructor params matters. The members directly lay out the order of members in the class and hence has to match exactly.

Implementation is probably a 2-3 days work and if implemented well some aspects could be used to help export other game-level functions.