Reality Factory Community Release April 2008
Reality Factory Community Release April 2008
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
Last edited by Jay on Mon May 26, 2008 10:56 pm, edited 1 time in total.
Everyone can see the difficult, but only the wise can see the simple.
-----
-----
Re: Reality Factory Community Release April 2008
Sweet! Jay, this is excellent! Perfect timing too. I have a 5 day holiday from the army so I have a lot of time to test these features. Awesome work man, simply awesome.
**EDIT**
I don't see anything about decals in the sample files. Can a scripted projectile make a decal in the wall just like a normal one?
**EDIT**
I don't see anything about decals in the sample files. Can a scripted projectile make a decal in the wall just like a normal one?
Last edited by Juutis on Fri Apr 25, 2008 4:40 pm, edited 1 time in total.
Pain is only psychological.
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Re: Reality Factory Community Release April 2008
Thanks Jay, can't wait to use the ScriptedProjectile
Re: Reality Factory Community Release April 2008
.....- .. -.....
.....O...O.....
.........>......
..________..
..\ |||||| /...
.. ------....
................
So excited.
.....O...O.....
.........>......
..________..
..\ |||||| /...
.. ------....
................
So excited.
Somewhere in Nevada...
- fps
- Posts: 504
- Joined: Mon Sep 26, 2005 9:54 pm
- Location: in a magical land devoid of hope, happiness, and sanity.
Re: Reality Factory Community Release April 2008
O GOD!
TESTING THIS AS SOON AS I GET OUT OF CLASS.
TESTING THIS AS SOON AS I GET OUT OF CLASS.
1 wrote:
for the internet is a cruel and dark place at times, and there's sex and blood everywhere.
2 wrote:
You say that like it's a bad thing.
1 wrote:
You are a bad thing.
for the internet is a cruel and dark place at times, and there's sex and blood everywhere.
2 wrote:
You say that like it's a bad thing.
1 wrote:
You are a bad thing.
Re: Reality Factory Community Release April 2008
Excellent!! Really superb features. Kudos to anyone who contributed!
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Re: Reality Factory Community Release April 2008
Okay, problem here. I copied the files from the download, and suddenly one of my scripts stopped working:
It worked fine yesterday, and I haven't done anything to it.
Code: Select all
{
Spawn[()
{
Console(true);
LowLevel("Init");
}]
Init[()
{
AttachCamera();
if(GetEventState("AIM") = false)
{
PositionToPawn("jugador",-65,-5,-145,true,true);
}
if(IsKeyDown(73))
{
PositionToPawn("jugador",-45,15,-55,true,true);
}
}]
}
Re: Reality Factory Community Release April 2008
Does the console say anything? The RealityFactory.ini (Reader script error)? Maybe you found a bug i didn't know of (All my scripts still work fine)
@Juutis: Thanks that you pointed that out (the decals). Currently they can't. I will certainly add this.
@Juutis: Thanks that you pointed that out (the decals). Currently they can't. I will certainly add this.
Everyone can see the difficult, but only the wise can see the simple.
-----
-----
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Re: Reality Factory Community Release April 2008
The console says "+ Low level script error for camara in Init Order"
Re: Reality Factory Community Release April 2008
Ok thanks. I will get to the bottom of this.
Everyone can see the difficult, but only the wise can see the simple.
-----
-----
Re: Reality Factory Community Release April 2008
Ummm... About the arrays. Did you know you could do the same basic thing by adding a global variable to the simkin interpreter, and setting its AddIfNotPresent state to true? You end up with the same basic thing, without limitations on array names or lengths.
Example:
Then, in a script:
I don't remember right off-hand whether the addIfNotPresent behavior extends to the nodes children...
Example:
Code: Select all
skTreeNodeObject* data = new skTreeNodeObject();
data->setAddIfNotPresent(true);
interpreter.addGlobalVariable("GlobalData", skRValue(data, true)); // true flag here let's the interpreter handle deletion.
Code: Select all
{
FOO ["BAR"]
FOOBAR
{
BAR1 ["bar"]
BAR2 [3.14]
BAR3 ["pie"]
DoSomething[()
{
GlobalData.Foo = FOO;
GlobalData.Array = FOOBAR;
debug(GlobalData.FOO # GlobalData.Array.BAR1 # GlobalData.Array[3]);
}
}
I don't remember right off-hand whether the addIfNotPresent behavior extends to the nodes children...
"So, what's the life of a programmer like?" "...Huh? What life?!"
RF System X:
http://www.realityfactory.info/forum/vi ... f=9&t=3599
RF System X:
http://www.realityfactory.info/forum/vi ... f=9&t=3599
- metal_head
- Posts: 1244
- Joined: Sat Jan 05, 2008 8:31 pm
- Location: Bulgaria,Sofia
- Contact:
Re: Reality Factory Community Release April 2008
OK,I really want to try the newton engine,but I don't know how to make the thing work.For example I want a realistic falling barrel,so i put a static entity proxy on my level with the barrel,but there was no change.How can I assosiate the barrel with the engine so it acts realistic I realy need help about it,I have no expiriance working with engines too.Which enity shall I use,do I have to script something... please I need a step by step explanation.
Re: Reality Factory Community Release April 2008
Ask federico. I have no clue about the physics stuff.
Everyone can see the difficult, but only the wise can see the simple.
-----
-----
Re: Reality Factory Community Release April 2008
Ok you're going to have to experiment with this one - there's no manual of info.
Place a PhysicsSystem entity in your level and then put your barrel into the level using a PhysicsRigidBody entity and play about with the values. You should get it working. I did this with boxes and spheres but I haven't tried cylinders or capsules yet. Think of it as an exploration and enjoy the experience of braking new ground. Also play around with the PhysicsMaterial entity. It's great fun messing around with these things and who knows... you might become the expert.
Place a PhysicsSystem entity in your level and then put your barrel into the level using a PhysicsRigidBody entity and play about with the values. You should get it working. I did this with boxes and spheres but I haven't tried cylinders or capsules yet. Think of it as an exploration and enjoy the experience of braking new ground. Also play around with the PhysicsMaterial entity. It's great fun messing around with these things and who knows... you might become the expert.
Re: Reality Factory Community Release April 2008
A fast patch, for more info look at this topic:
http://www.realityfactory.info/forum/vi ... 097#p27097
Link to the patch:
http://www.mediafire.com/?tlnlx14bntm
http://www.realityfactory.info/forum/vi ... 097#p27097
Link to the patch:
http://www.mediafire.com/?tlnlx14bntm
Everyone can see the difficult, but only the wise can see the simple.
-----
-----