Reality Factory Community Release April 2008
Posted: Thu Apr 24, 2008 11:30 pm
This is a release built onto the physics release which contains:
-Particle Wind (without Wind Generator, just enable/disable it)
-Physics
-Scripted Projectiles
-GlobalValueArrays for easy exchange of data between scripts
-speed optimization in the ActorManager: Searching for the same actor repeatedly is now faster
-Enhanced Weapon system as in the first community release.
-this release is backwards compatible to the first community release and to the physics release
I made a sample projectile script, sample projectile definition ini file and sample script which adds a scripted projectile. More documentation may come later, source code will come later too (It is late and i wanted to release it today, docs and source code may still take a few days, depending on how much time i have). I also did not have much time to test the release, so there may be bugs. Please post bugs regarding this release in this topi only to avoid confusion.
A short overview over the added features (a full, detailed list will come with the documentation)
ScriptedProjectile short reference:
Commands
Move(); Move(x,y,z,speed); //Move into current direction or to target with the current speed, or move manually into a direction specified, with a speed specified
CheckForCollision(); //Checks if collision occours. 0=Nothing, 1=Liquid, 2=Actor, 3=Model, 4=Level or StaticMesh
SetDirection(x,y,z); //Set direction manually
NormalizeDirection(); //Use to bring direction to a lenght of 1 (if it isn't 1 then Move() might move too slow or too fast)
SetSpeed(speed);
SetDestinationPoint(x,y,z); //Sets direction so that the projectile will fly towards the destination point
SetTarget(char* ename); //sets a target, use SetTarget(""); to un-set target
Remove(); //Delete it. The current order will still be executed to its end
GetHitName(); //Retrieves EntityName of hit entity, if possible. (Only possible for Liquid, Actor, and Model, if it's a model it will return the entityname of the DestroyableModel)
DamageActor(char* name, char* attribute, float amount); //Damages an actor
DamageModel(char* name, char* attribute, float amount); //Damages a model
GetAttribute(char* attrib, (char* entity));
SetAttribute(char* attrib, float amount, (char* entity));
FaceActor(char* name); //Rotate to face actor immeadiately
Transform(x,y,z,roll,yaw,pitch); //Used to transform a point (x,y,z) to a specific direction (roll, yaw, pitch), Example: Transform(0,0,1,self.current_roll, self.current_yaw, self.current_pitch); transforms the point 0,0,1 with the current roll,yaw and pitch, this returns the current direction
GetTransformX(); // Get X,
GetTransformY(); // Y,
GetTransformZ(); // Z corrdinates of transformed point
GetEntityYaw(char* entity);
GetEntityPitch(char* entity);
Random(a,b); //returns random integer from a to b
AddExplosion(char* explosion, char* bone, float ox, float oy, float oz, (char* ename));
SetPosition(x,y,z); //Teleport to point (x,y,z)
SetAngles(roll,yaw,pitch);
ConvertDegrees(degrees);
Math(char* command, (arguments) ); - math command to do thinghs like square root, get mathmatical constants (e, pi), etc.
PlaySound(char* name);
ApplyForce(char* ename, float x, float y, float z); //Applys a force to an actor, usefull for pushing thinghs when hitting an actor
GetEntityX(char* ename)
GetEntityY(char* ename)
GetEntityZ(char* ename)
Animate(char* anim, bool Hold); //Usefull for animated projectiles
AnimateEntity(char* anim, char* ename, bool Hold=false);
StringCopy(char* string);
DamageEntity(float amount, char* attribute, char* ename); //for compatibility reasons (compatibility to normal scripts, is used when for example a function from another script is called, like my Dioran.DamageTarget(...) function that does all the damage in TowersOfTrembolon)
ModifyAttribute(char* attribute, float amount, (char* ename));
Writeable variables
self.think - write to specify next order
Readable variables
self.current_X
self.current_Y
self.current_Z
self.current_yaw
self.current_pitch
self.current_roll
self.direction_X
self.direction_Y
self.direction_Z
self.target_name -
self.EntityName - the EntityName of the scripted projectile. Will return "ScriptedProjXX" where XX is a number from 0 to 63
self.animate_at_end
self.time -time since the the creation of the scripted projectile, usefull for time-out or something like that
self.time_frame - time passed since last frame
Usage of GlobalValueArrays:
There are only 2 ScriptCommands:
SetGlobalArrayElement(name,index,value);
GetGlobalArrayElement(name,index);
where name is one of those:
ScriptedProjectileParamList
PawnExchange
SkydomeExchange
User0
User1
User2
User3
User4
User5
User6
User7
and index is 0-15 and specifies the index of the value in the array.
To understand the scripted projectiles, open the sample files and look, then try yourself. Ask if you're unsure.
Download Link:
http://www.mediafire.com/?uzux015ntpi
Good night.
EDIT: A patch is available, for more info look at this topic:
http://www.realityfactory.info/forum/vi ... 097#p27097
-Particle Wind (without Wind Generator, just enable/disable it)
-Physics
-Scripted Projectiles
-GlobalValueArrays for easy exchange of data between scripts
-speed optimization in the ActorManager: Searching for the same actor repeatedly is now faster
-Enhanced Weapon system as in the first community release.
-this release is backwards compatible to the first community release and to the physics release
I made a sample projectile script, sample projectile definition ini file and sample script which adds a scripted projectile. More documentation may come later, source code will come later too (It is late and i wanted to release it today, docs and source code may still take a few days, depending on how much time i have). I also did not have much time to test the release, so there may be bugs. Please post bugs regarding this release in this topi only to avoid confusion.
A short overview over the added features (a full, detailed list will come with the documentation)
ScriptedProjectile short reference:
Commands
Move(); Move(x,y,z,speed); //Move into current direction or to target with the current speed, or move manually into a direction specified, with a speed specified
CheckForCollision(); //Checks if collision occours. 0=Nothing, 1=Liquid, 2=Actor, 3=Model, 4=Level or StaticMesh
SetDirection(x,y,z); //Set direction manually
NormalizeDirection(); //Use to bring direction to a lenght of 1 (if it isn't 1 then Move() might move too slow or too fast)
SetSpeed(speed);
SetDestinationPoint(x,y,z); //Sets direction so that the projectile will fly towards the destination point
SetTarget(char* ename); //sets a target, use SetTarget(""); to un-set target
Remove(); //Delete it. The current order will still be executed to its end
GetHitName(); //Retrieves EntityName of hit entity, if possible. (Only possible for Liquid, Actor, and Model, if it's a model it will return the entityname of the DestroyableModel)
DamageActor(char* name, char* attribute, float amount); //Damages an actor
DamageModel(char* name, char* attribute, float amount); //Damages a model
GetAttribute(char* attrib, (char* entity));
SetAttribute(char* attrib, float amount, (char* entity));
FaceActor(char* name); //Rotate to face actor immeadiately
Transform(x,y,z,roll,yaw,pitch); //Used to transform a point (x,y,z) to a specific direction (roll, yaw, pitch), Example: Transform(0,0,1,self.current_roll, self.current_yaw, self.current_pitch); transforms the point 0,0,1 with the current roll,yaw and pitch, this returns the current direction
GetTransformX(); // Get X,
GetTransformY(); // Y,
GetTransformZ(); // Z corrdinates of transformed point
GetEntityYaw(char* entity);
GetEntityPitch(char* entity);
Random(a,b); //returns random integer from a to b
AddExplosion(char* explosion, char* bone, float ox, float oy, float oz, (char* ename));
SetPosition(x,y,z); //Teleport to point (x,y,z)
SetAngles(roll,yaw,pitch);
ConvertDegrees(degrees);
Math(char* command, (arguments) ); - math command to do thinghs like square root, get mathmatical constants (e, pi), etc.
PlaySound(char* name);
ApplyForce(char* ename, float x, float y, float z); //Applys a force to an actor, usefull for pushing thinghs when hitting an actor
GetEntityX(char* ename)
GetEntityY(char* ename)
GetEntityZ(char* ename)
Animate(char* anim, bool Hold); //Usefull for animated projectiles
AnimateEntity(char* anim, char* ename, bool Hold=false);
StringCopy(char* string);
DamageEntity(float amount, char* attribute, char* ename); //for compatibility reasons (compatibility to normal scripts, is used when for example a function from another script is called, like my Dioran.DamageTarget(...) function that does all the damage in TowersOfTrembolon)
ModifyAttribute(char* attribute, float amount, (char* ename));
Writeable variables
self.think - write to specify next order
Readable variables
self.current_X
self.current_Y
self.current_Z
self.current_yaw
self.current_pitch
self.current_roll
self.direction_X
self.direction_Y
self.direction_Z
self.target_name -
self.EntityName - the EntityName of the scripted projectile. Will return "ScriptedProjXX" where XX is a number from 0 to 63
self.animate_at_end
self.time -time since the the creation of the scripted projectile, usefull for time-out or something like that
self.time_frame - time passed since last frame
Usage of GlobalValueArrays:
There are only 2 ScriptCommands:
SetGlobalArrayElement(name,index,value);
GetGlobalArrayElement(name,index);
where name is one of those:
ScriptedProjectileParamList
PawnExchange
SkydomeExchange
User0
User1
User2
User3
User4
User5
User6
User7
and index is 0-15 and specifies the index of the value in the array.
To understand the scripted projectiles, open the sample files and look, then try yourself. Ask if you're unsure.
Download Link:
http://www.mediafire.com/?uzux015ntpi
Good night.
EDIT: A patch is available, for more info look at this topic:
http://www.realityfactory.info/forum/vi ... 097#p27097