ok so as Max uses a rather different system for paths and AI compared to classic i'll post my findings here in the hope that others will find it helpful
first - this does NOT use the .byc file, that is a whole other subject
so make sure your entity is a character - i.e. ischaracter = 1 in the .fpe
(you can tell this by the extra "character settings" panel in the Max editor when you select your model on the map)
for paths you will need to place flags, link them together and link 1 to your character
now your code will need the following logic
Quote: "GetEntityRelationshipID(a, b)"
this returns the entity number of the item connected to item (a) in index (b)
or return 0 if no entity is connected
the index is in range of 0 ~ 9 (inclusive)
Quote: "local entitye = GetEntityRelationshipID(e, 0)"
returns the entity number for first connected entity to your current entity
for paths (or flags as they are named in Max) you want to check the returned value against a special markermode value
Quote: "if GetEntityMarkerMode(entitye) == 11 then "
where entitye is the entity number you want to check and 11 is the value for a flag (i'm not sure where these are set, probably some hard coded list somewhere)
now that you know you are connected to a flag you can repeat the process with the flag entity number to find any flags it is connected to and thus create your path
to begin moving your AI you need to first find a path
to get a path call
Quote: "RDFindPath(x,y,z, tx,ty,tz)"
x,y,z is the starting location (i.e. the location of the entity you want to move)
tx,ty,tz is the destination location (i.e. the location of the player or entity you want to move to etc)
this will generate a bunch of connected points along a path that navigate around obstacles etc
this path can be checked by
which will return the number of points in the generated path - values greater than 0 mean the path is valid
now that you have a path you can tell your AI to start moving
Quote: "StartMoveAndRotateToXYZ(e, move_speed, turn_speed, tilt, stopping_dist)"
e - the entity you want to move
move_speed - the speed it should move - this can now be got from the character settings by GetEntityMoveSpeed(e)
turn_speed - the rotation speed the entity turns with - this can be got with GetEntityTurnSpeed(e)
tilt - i'm not sure but i think this is to do with going up or down slopes, not really sure the values on this one
stopping_dist - stops the entity when it gets within this range of the destination
*note* GetEntityMoveSpeed() and GetEntityTurnSpeed() are both 100 by default which is way too fast, the stock script divides the move speed by 100 and the turn speed by 4 rather than setting an appropriate default value (unfortunately) which means you will likely want to do the same to make your characters also work nicely with any stock scripts
(optionally) after you have started moving you can call
Quote: "MoveAndRotateToXYZ(e, move_speed, turn_speed,stop_dist)"
basically the same as StartMoveAndRotateToXYZ() but no tilt, not sure why not.
this will return the index of the generated path you are moving along
*note: it is required you call StartMoveAndRotateToXYZ() first and not just MoveAndRotateToXYZ() as your character will not move unless you do*
*note2: it is not required to call MoveAndRotateToXYZ() at all if you don't need it*
you don't need to generate the path more than once unless you need to calculate for moving obstacles or if you need a new target location etc.
you only need to call StartMoveAndRotateToXYZ() the first time you want to start your character moving along the new path unless you stop the character.
*note* to make a character move it seems they also need to be animating, not sure why - default characters use "walk_loop" or
to stop a character you can set the move_speed to 0
i have attached a basic script which will give a working example of the above commands to allow a character to walk a patrol path