Reality Factory Community Release 04/11/07

Programming Reality Factory and Genesis3D.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

how can u make dynamic entites a pawn?
Herp derp.
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

This is not possible.
Maybe dynamic entity was the wrong word. The scripting docs refer to 'entity' as an actor, so i decided to keep it this way.

It's simply a dynamically added actor with a specified name (not a SEP, not an AttributeEntity, not a StaticMesh, not a Pawn) You can alter it with the SetEntityProperties(...) commands.

Adding of true dynamic entities like a pawn or a flipbook or something is really complex because it involves changes at the Genesis source code (i believe) and whoever ever changed the genesis source code knows what i mean, i suppose... (code layout is very different from RF's, which is easy to understand once you get the system; Genesis is written in pure C while RF is C++, Genesis does not use classes and so on and so on)

When i understand enough of it, i may add that in the future.
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
Spyrewolf
Posts: 450
Joined: Tue Jul 05, 2005 4:53 am
Location: Wellington::New Zealand

Post by Spyrewolf »

(not a SEP, not an AttributeEntity, not a StaticMesh, not a Pawn)
:shock: ......erm which type of actor is it then?
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

Well it's simply an actor added to the game world.
It has no healthattribute and no 'enchanched' entries like default action, dying, so it is no SEP.
You will not pick it up when walking over it, so it's not an attribute.
It has no script, so it is no pawn.
It is definetely no StaticMesh, because StaticMeshes are treated completely different. For example collision detection is done very different. This is why you cannot select StaticMeshes with the MouseSelect(...) command.
It is also not a weapon actor, because it has its own animation and is not attached to an entity.
Well also no projectile, because it is not destroyed and does damage when it hits other actors.

You could put it on line with the SEPs, only that it has not all these 'enchanched features' like dying, for example...

You can still select it via mouse with the MouseSelect(...) command and get its entity name this way.
You can also do all these thinghs like AnimateEntity(...) or SetEntityProperties(...) with it.
Also add Attributes, set them, get them, and do damage to them.
And remove it when needed.


So basically, it's a new type of actor, if you want it this way... a dynamic actor...
Last edited by Jay on Mon Apr 16, 2007 5:54 pm, edited 1 time in total.
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

so you can use it to throw game objects?
Herp derp.
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

if you want, yes. You got to script its movement though.
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
Spyrewolf
Posts: 450
Joined: Tue Jul 05, 2005 4:53 am
Location: Wellington::New Zealand

Post by Spyrewolf »

Jay wrote:if you want, yes. You got to script its movement though.
sweet, that's all i needed to know if it could be handled via script,s so i could theoritcally attach it to an actor right? thats the biggie i needed to customise players. i could do it previously but i needed to load every attachable piece of customisation to every level i built. in case the player selected a certain piece.

what i'm try to acheive is a character creator system similar to the ones found in some games that allow you to place unlockable items such as goggles, hat, belt ect. to the player.
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

this could be done much more easily by attaching pawn weapons to the player pawn. (using a scripted player) Remember, it is now possible to add up to 16 weapon actors to one single pawn. This should give you enough freedom for your system.

So let's say your glasses are in slot 1, the belt is in slot 2, the shirt is in slot 3 the trousers in slot 4 and the hat in slot 5 so on and so on. (and don't forget to add something in slot 0 that is there ALL the time, if you don't know what just make an empty actor with jst one poly maybe)

The scripted inventory in my current project uses this system.

The pawn weapon system could also be used to make custom characters - like you select a head, and a body, and a shirt and a trousers and then so on and so on. However the maximum amount of parts is 16. If you need more, you've got to add a new pawn and attach it to the main pawn - then you've got 16+16 weapon slots, meaning you can have up to 32 parts (just in case anyone needs it)
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

About the 16 weapons' system:

Shouldn't you have changed some other commands than SetWeapon() and RemoveWeapon, too?
The manual:
FireProjectile(char *Projectile, char *FireBone, float OffsetX, float OffsetY, float OffsetZ, char *Attribute );

Shoot a projectile at the target point, as defined by UpdateTarget(). The projectile used is named Projectile and the launch location is the Pawn actor's bone called FireBone. The launch point will be moved in the (left, up, in) directions by the amount specified by (OffsetX, OffsetY, OffsetZ). The projectile will do damage to the Attribute of anything it hits. If the pawn has a weapon actor attached the launch location is taken from the weapon actor's bone called FireBone.
and
SetWeaponMatFromFlip(char *FlipBookName, int ActorMatIndex, int FlipBookImageIndex, float R, float G, float B );

Replace the weapon’s material with index ActorMatIndex by the texture with index FlipBookImageIndex of the specified FlipBook entity.
The first one seems to work fine but I haven't tested it with multiple weapons attached. I came across this problem when experimenting with the second command. When I use it with the community release, RF just crashes without leaving any info in the log file. With an official release the command works fine.
Pain is only psychological.
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

The first one actually takes the bone from the first weapon. This is why you have to make sure that slot 0 is always filled when you are using weapons. By the way, almost all commands that use bones take the bone from the first weapon.

I will have to change the second one.

EDIT: If there is a problem then that's really strange because SetWeaponMat works on the Player weapon and not on the pawn weapon if i remember correctly... Remember there has to be a player weapon to work... changed it so that it will not crash if there is no player weapon... but it won't do anything...

EDIT2 : Added scriptCommand SetPawnWeaponMatFromFlip() that does it for pawn weapons.
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

If there is a problem then that's really strange because SetWeaponMat works on the Player weapon and not on the pawn weapon if i remember correctly... Remember there has to be a player weapon to work... changed it so that it will not crash if there is no player weapon... but it won't do anything...
Oh, the manual explanation really gives an impression that it would affect the pawn's weapon. :?
Anyway, I do have a weapon defined in the weapon.ini. I tested the command with exactly same things. First I had your version, it crashed no matter what I tried to do with the command. Then I replaced RF.exe with the official one and changed my scripts and stuff so it would run, it didn't crash. Shouldn't it have crashed with the official version too?

O' well, thanks anyway for adding that command! :D
The time scale thingy sounds wicked too. :twisted:
Pain is only psychological.
User avatar
vagoneta
Posts: 25
Joined: Fri Jan 04, 2008 8:32 pm

Re: Reality Factory Community Release 04/11/07

Post by vagoneta »

Sorry but, what exacly is this? :roll: :oops:
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Re: Reality Factory Community Release 04/11/07

Post by darksmaster923 »

vagoneta wrote:Sorry but, what exacly is this? :roll: :oops:
well jay made a rf release that has new features
Herp derp.
User avatar
vagoneta
Posts: 25
Joined: Fri Jan 04, 2008 8:32 pm

Re: Reality Factory Community Release 04/11/07

Post by vagoneta »

Oh, Thnk. :D
Post Reply