Feature list:
-changed max number of predefined effects from 200 to 2000
-changed max number of predefined explosions from 50 to 2000
New LowLevel script commands:
-AddPawn(scriptfile, pawnDefinition, entityname, startorder) - TESTED
-Adds a pawn to the world at place 0,0,0 with rotation 0,0,0. You can adjust it via the SetEntityProperties(...) commands.
-MaxNumber of 5120 dynamic pawns at any time - it's so high just to be sure that it is never reached. Maybe i'll set it lower again sometime. Maybe 1000 is a good number.
-The pawn starts with the highlevel order startorder
-AddActor(filename,entityname); - NOT TESTED
-Adds an actor to the game world
-RemoveActor(entityname); - NOT TESTED
-Removes an actor from the game world - ONLY USE WITH ACTORS ADDED WITH AddActor(...) OR IT COULD HAVE UNWANTED SIDE EFFECTS.
-FindPath(scriptpointName); -TESTED
-Tries to find a path to the scriptPoint called scriptpointName. If a path was found then it will return "true", otherwise "false"
-If a path was found, the currentPath will be set to that path, otherwise there will be no current path.
-To access that path, use
-FindPath(endX,endY,endZ); - NOT TESTED
-Tries to find a path to the path point nearest to (endX,endY,endZ).
-Otherwise, behaves like the other FindPath(...) command.
-GetCurrentPathPoint(); - TESTED
-Gets the name of the current point in the path
-If there is no current path it will return "(NO PATH)"
-If the end of the path was reached, it will return "(END OF PATH)"
-AdvancePath(); - TESTED
-Sets the next point in the path as the current point
An example on how to use the AddPawn(...) command:
Code: Select all
SCRIPTED_PROJ_NUMBER [0]
SCRIPTED_PROJ_NAME [NULL]
PROJECTILEPATH [projectiles\\]
AddProjectile[ ()
{
if(TARGET="FALSE")
{
return 0;
}
SCRIPTED_PROJ_NAME="SP_" # SCRIPTED_PROJ_NUMBER;
SCRIPTED_PROJ_NUMBER=Integer(SCRIPTED_PROJ_NUMBER)+1;
AddPawn(PROJECTILEPATH # "scriptedprojectile.s","Controller",SCRIPTED_PROJ_NAME,"Spawn");
SetEntityPosition(SCRIPTED_PROJ_NAME, GetBoneX(EntityName,"BIP01 R HAND"),
GetBoneY(EntityName,"BIP01 R HAND"),
GetBoneZ(EntityName,"BIP01 R HAND"));
SetEntityRotation(SCRIPTED_PROJ_NAME, self.current_pitch, self.current_yaw, 0);
//Set Parameters, accessing the fields of the pawn
@SCRIPTED_PROJ_NAME.TARGET=StringCopy(TARGET);
return 1;
} ]
Also (maybe this will be important to some of you), RF first executes all dynamic pawn scripts before heading on to the static ones. It can however not be said in which order the dynamic pawns are executed.
In the folder you will find the exe and the changed/added source code files in different archives.
http://www.mediafire.com/?sharekey=baff ... 2bd5edc68e
EDIT: somehow it did not work very well, so here are additional links:
EXE: http://www.filedropper.com/addpawnpathfindingexe
SOURCE: http://www.filedropper.com/addpawnpathfindingsource
Have fun.