Page 2 of 2
Re: First Pawn
Posted: Mon Mar 17, 2008 12:36 am
by darksmaster923
Sph!nx wrote: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!
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 :
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.
i just noticed.....
you have in the pawn.ini you has boundingboxanimation as idle but the playanimation is anim_idle
Re: First Pawn
Posted: Mon Mar 17, 2008 1:43 am
by bernie
That is correct DM boundingboxanimation = idle is what it should be.
Re: First Pawn
Posted: Wed Mar 19, 2008 4:27 pm
by Sph!nx
Well, I've reached the same point as before but with a clean install and a new model. I've used the same code in the previous scripts. Tried it with the new model and with a model delivered with the installation of RF.
The model that came with RF works perfectly but my own model does not. This leads me to conclude that the problem is not a scripting error but something I did wrong when building/compiling the model.
Right, here is, in short, how I build my models :
1) I make the mesh in MS.
2) Do UV maps in LithUnwrap
3) combine both the skins and mesh in MS
3) make the skeleton and attach the vertexes in MS.
4) make the animations in MS.
5) I save the reference model as .bdy and animations as .mot
6) I copy actorstudio to the folder where the .bdy, mot, and bmps are.
7) I run act studio and and fill in whats needed and press run.
That's how its been done right?
In the actorviewer is works perfectly but when I try to use it in game it does not. I also haven't figured out where to alter the animation speeds and such. Can anyone please help me? Bernie?
Thanks ahead
Re: First Pawn
Posted: Wed Mar 19, 2008 5:33 pm
by bernie
Well It's definately NOT your model or your script they both work for me. The model was put together correctly. Also if your model was at fault it would not play in actor viewer. There is nothing in the script that would cause a problem and in any case it worked for me. So that leaves the setup. The pawn.ini file is set up correctly as I copy and pasted it into my ini file and it worked. That leaves the entity setup.
Did you include the command
Console(true);
in the script as below?
{
Spawn[()
{
Console(true);
PlayAnimation("anim_idle", true, ""); // with the new animation name
RestartOrder();
}]
}
If you did did you get the information top left of your level screen ?
Re: First Pawn
Posted: Wed Mar 19, 2008 5:50 pm
by Sph!nx
Again, like before, no errors at all. It only shows the player position and stuff at the bottom.

really demotivating when being stuck like this ...
Could it have something to do with the rotation in the pawn.ini?
Re: First Pawn
Posted: Wed Mar 19, 2008 6:20 pm
by bernie
Well that show the script is running. Which version of RF are you using? I am using the Official v0.76c
Re: First Pawn
Posted: Wed Mar 19, 2008 6:38 pm
by Sph!nx
I've used the 0.75A and then updated it with the 0.75C update. Nothing else added.
Here is the package I am using now. Scripts, models, test map, everything. Perhaps you see something I don't. I still think it has something to do with model compilation ...
Download Package
Edit : Perhaps you would like a look at the source material used to build the model? (Milkshape files, .bdy and .mot files)
Edit 2 : Here's the
droids models source.
Re: First Pawn
Posted: Wed Mar 19, 2008 7:16 pm
by bernie
As darkmaster pointed out earlier boundingboxanimation was incorrect an I miss replied sorry about that. I got confused with the replies.
Change it as below and it will work.
[droid]
actorname = droid.act
actorrotation = 0 180 0
actorscale = 1.4
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = anim_idle
I'm going out in a short while so I won't be on here until tommorrow.
Re: First Pawn
Posted: Wed Mar 19, 2008 7:47 pm
by Sph!nx
Gonna try the animation name in the ini after diner. Thanks again!
Edit : It works. Wow, thanks Bernie and darksmaster923!! (I should have read your post more clearly ...)
Re: First Pawn
Posted: Thu Mar 20, 2008 3:22 pm
by bernie
You're very welcome sph!nx. I am really sorry about that slip it must have caused you a lot of agro.
Re: First Pawn
Posted: Thu Mar 20, 2008 4:53 pm
by Sph!nx
Hehehe, indeed but now, looking back, I have learned much more about the code this way. I think I have the basics of scripting down now. I now only need to practice so I guess I have accomplished what I wanted with this little project. onwards to a real game!
I have a nice concept, but the team is busy with our other project and the idea is a little too ambitous for to do alone. Now I'm trying to think up a small game to build.
Again, thanks for your help people. Need my help with anything? PM me!