First Pawn

Topics regarding Scripting with Reality Factory
User avatar
Sph!nx
Posts: 297
Joined: Thu Feb 22, 2007 7:26 pm

First Pawn

Post by Sph!nx »

Before can start building the game I have in mind I must first learn the 'ins and outs' of Reality Factory, so I've started to work on a learing/experimentation project.

I've mostly got everything covered but I do need a lot of help with scripting because this is totally new for me. I've read many tutorials, the docs and the e-book but still it seems really difficult for me so I've started this thread.

Right, here are my first problems. I've made a little box map, a character with a new skeleton and one very n00bish animation. The character is compiled and everything seems to work fine.

I've also got the model working in the editor and thus as a static mesh in the game. I've written my first script, well stolen from AndyCR's tutorial, and renamed the animation name. Now it should play the animation right? It does not ... It just stands there doing nothing! :cry:

Image

Here is the script and the entry in the pawn.ini. Can anyone help me?

Code: Select all

{
   Spawn[()
   {
      PlayAnimation("anim_idle", true, ""); // with the new animation name
      RestartOrder();
   }]
}
pawn.ini wrote: [dev_human]
actorname = dev_human.act
actorrotation = 0 180 0
actorscale = 1.4
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = idle
Also, I seem to have a problem with my bounding box. Look :

Image

Know how to fix this?

Thanks ahead!

Edit :

I've noticed some define their animation at the beginning at the script. I did it just like that, again no succes.

Code: Select all

{
	IDLE  [anim_idle]                 // Defined animation.
	
   Spawn[()
      {
      Console(true);
      PlayAnimation(IDLE, true, "");  // here also pointed to IDLE
      RestartOrder();
   }]
}
Could it be the model? I've compiled it succesfully and it plays its animation in the modelviewer.
Regards Sph!nx

Sven Co-op, DevEd: Development & Editing
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Re: First Pawn

Post by darksmaster923 »

you have the console on. what does the text in the left hand corner of the screen say?
Herp derp.
User avatar
Sph!nx
Posts: 297
Joined: Thu Feb 22, 2007 7:26 pm

Re: First Pawn

Post by Sph!nx »

Tried it again, the console shows nothing. I've tried the same thing with a model that was delivered with RF and it does seem to work with that one.

Is there something I've done wrong with compiling the model? I mean, are there certain animation names to be followed. I've exported everything correctly. Is there perhaps a big difference between looping and non looping animations?
Regards Sph!nx

Sven Co-op, DevEd: Development & Editing
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Re: First Pawn

Post by darksmaster923 »

Sph!nx wrote:Tried it again, the console shows nothing. I've tried the same thing with a model that was delivered with RF and it does seem to work with that one.

Is there something I've done wrong with compiling the model? I mean, are there certain animation names to be followed. I've exported everything correctly. Is there perhaps a big difference between looping and non looping animations?
if the console doesn't show, then the script isnt running. have you checked your log file or the file animation name is anim_idle?
Herp derp.
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: First Pawn

Post by bernie »

Have you got the pawn entity set up correctly?
ie
Angle: 0 0 0 This may have a bearing on the bounding box
ScriptName: yourscritname.s The dot s is important
SpawnOrder: Spawn
Have you got the animation name exactly as it apears in the drop down list in Actor Viewer ?
User avatar
Sph!nx
Posts: 297
Joined: Thu Feb 22, 2007 7:26 pm

Re: First Pawn

Post by Sph!nx »

Checked it again. Everything has been setup correctly.

When compiling models for Half-life, one must first create and edit a .qc file for it in order to compile. I have not noticed a .qc (or the likes) for RF. Again, could it have something to do with the animations?
Regards Sph!nx

Sven Co-op, DevEd: Development & Editing
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: First Pawn

Post by bernie »

Can I download our model and try for myself? It would make it easier to find the problem.
User avatar
Sph!nx
Posts: 297
Joined: Thu Feb 22, 2007 7:26 pm

Re: First Pawn

Post by Sph!nx »

Sure. Dont mind the crappy animation. its just a test. Cant figure out how to slow the animation down too.

Here it is!
http://www.goannasvencoop.com/sphinx/sp ... _human.rar
Regards Sph!nx

Sven Co-op, DevEd: Development & Editing
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: First Pawn

Post by bernie »

Your model and animation work fine for me.This is what I did.
I put the Actor in the actors folder.
I used your script and named it test.s
I placed the script file in the scripts folder.
I used your pawn.ini and saved it in the install folder.
I set up a pawn entity as follows:

Angle 0 0 0
HideFromRadar false
PawnType dev_human
ScriptName test.s
SpawnOrder Spawn

Everything else as default.

Just as an afterthought ... Make sure you have at least 2 linefeeds in your pawn.ini file after the end of your setup and 2 linefeeds after the closing bracket in your script file.

There is still a problem with the bounding box, probably introduced when you made the actor. What program did you use to make the actor?
User avatar
Sph!nx
Posts: 297
Joined: Thu Feb 22, 2007 7:26 pm

Re: First Pawn

Post by Sph!nx »

Thanks bernie! I will try it again with your directions. I have made the model in Milkshape.

Edit :
I tried it exactly the way you did. Even renamed it the way you have. Still it does not work for me ... :(
Regards Sph!nx

Sven Co-op, DevEd: Development & Editing
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: First Pawn

Post by bernie »

Add Console(true); to the begining of the script as below and run the level.

{
Spawn[()
{
Console(true);
PlayAnimation("anim_idle", true, ""); // with the new animation name
RestartOrder();
}]
}

You should get information on your screen when you run the level. If you do not, then the script isn't running for some reason. You are putting the test.s in the ScriptName and not ConvScriptName aren't you?
User avatar
Sph!nx
Posts: 297
Joined: Thu Feb 22, 2007 7:26 pm

Re: First Pawn

Post by Sph!nx »

Thanks for your help so far Bernie! Much appreciated.

I've been trying a lot of stuff and the whole thing has become one big mess. Trying it all again with a fresh new install. I will also make a new model to experiment with. Something simple, like a robot with simple animations.

When that's done I will try to script this again.

Not sure if you are using MSN but if you don't mind me asking a few questions once and a while you can add my to it if you want. sphinx019@hotmail.com
Regards Sph!nx

Sven Co-op, DevEd: Development & Editing
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: First Pawn

Post by bernie »

No I don't use MSN but you can always pm me.
The Model is fine. The bounding box is ok I checked it with lithunwrap. Actually the b/box is always square along the base in rf that's the way rf works, you can alter the height but if you alter the width it also changes the depth. Using pawns and scripting is difficult to start with, but it gets much easier as you go along. There are a lot of pitfalls but you learn to avoid them. Keep at it, you'll get there in the end.
User avatar
Sph!nx
Posts: 297
Joined: Thu Feb 22, 2007 7:26 pm

Re: First Pawn

Post by Sph!nx »

Thanks, m8! Gonna be busy with the new test model. Gonna make a new one for easier animations for later experimentation. I will PM you when I need your help! ;)
Regards Sph!nx

Sven Co-op, DevEd: Development & Editing
User avatar
Sph!nx
Posts: 297
Joined: Thu Feb 22, 2007 7:26 pm

Re: First Pawn

Post by Sph!nx »

It occurred to me that the bounding box for the human character was about the same size of the reference mesh (.bdy) in the actor file instead of the idle animation I asumed from the the entry in the .ini. It also is rotated 90 degrees. It should not do that.

Okay, here's the new model (in progress). Its a droid on wheels so I dont have to make a lot of complicated animations. This is just for the test remember.

Image

Is the bounding box generated from the reference (.bdy) or from an animation (.mot)? Should I modify the body stance in the reference.bdy?

Thanks

EDIT :
Could a moderator move this thread to 'Game Designs', please? I will then rename the thread to 'First Game' 'cause this thread seems to cover more than scripting alone.
Regards Sph!nx

Sven Co-op, DevEd: Development & Editing
Post Reply