Page 1 of 2
Player pawn
Posted: Thu Jun 19, 2008 7:59 pm
by Sph!nx
Right, I need a little help with this. I've tried to search about putting in your own player character. I know, its hard for a total noob for me, but I really do want to start off with a player pawn.
I know it's a little more than adding a basic pawn, I know how to do that, although still learning to add its actions. All I need to know is how to add my own character, simple, without actions but just as a basic spawn so I can experiment with adding animations and actions.
Please, help! Perhaps someone has an example for me?
Thanks in advanced!
Re: Player pawn
Posted: Sun Jun 22, 2008 11:37 am
by Sph!nx
I don't need a full explanation, just a hint or a small example so I know the general direction of how to set this up.
I've build a small
test map and a character model:
I've made two animations. A simple Idle animation and my first walking animation! Pretty good for a first one I think!
(The glitch is not in my animation, but its the end of the animated .gif)
My plan is to make this dude into a player pawn with the most basic actions. Just idling and walking for now and then later add actions and fill the game world. I know, this might not be the easiest thing to start scripting, but I really want to build this up, starting with the player pawn.
I'd be very grateful If anyone can help me! Thanks!
Re: Player pawn
Posted: Mon Jun 23, 2008 10:31 pm
by Sph!nx
Not even a hint? I really need this continue!
I'm starting to feel a bit embarrased here.. I get the feeling I have overlooked something pretty obvious...
Re: Player pawn
Posted: Tue Jun 24, 2008 11:35 am
by Danimita92
I edited genericplayer.s and gave my scripted pawn to the spanish community:
http://rf-espanol.foroactivo.com/tutori ... o-t612.htm
Re: Player pawn
Posted: Sun Jun 29, 2008 5:09 pm
by Sph!nx
Thanks a lot! I can really use this for my own script! What I really needed to know is how I can set-it so, the game starts with my new player.
You prolly explained that in your thread, but I'm afraid I can't speak Spanish...
This is probably quite simple and I must have overlooked it in the documentation (several times) so if anyone can point me in the right direction, it would be much appreciated!
Re: Player pawn
Posted: Sun Jun 29, 2008 5:23 pm
by Danimita92
The script automatically takes the original player away and attachs the camera onto this player. The only thing you'd have to do is set it up onto your level with a Pawn entity and modify it like this:
PawnType = Go to Pawn.ini and add one.
for example, if you make one like this:
[Jugador]
actorname = Danimita.act
actorrotation = 0 180 0
actorscale = 0.5
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = Idle
shadowsize = 30
you'd have to put
PawnType = Jugador (Exactly the same as the one in Pawn.ini with the same capital letters and everything)
ScriptName = The name with which you saved the script. For example, ScriptedPlayer.s
(WARNING: The .s at the end is very important)
SpawnOrder = Spawn
BTW: At the beginning of the script there's all the animations the pawn needs, and near the end there's also animations like AirRun and AirRunLeft... you need to modify from there, not from the top.
Re: Player pawn
Posted: Sun Jun 29, 2008 5:42 pm
by Sph!nx
Thanks m8! You've been a real help! Still making some animations and then Im ready to implement it. Thanks again!
Re: Player pawn
Posted: Thu Jul 03, 2008 9:09 pm
by Sph!nx
Wow, I find this scripting very hard to understand. Well, I've got the character setup and idling in game. Now, I do know how to change the size in the .ini but I want to do it in the script. Here is the script I have :
Code: Select all
{
Spawn[()
{
Console(true);
Scale(1.4);
PlayAnimation("anim_idle", true, "");
RestartOrder();
}]
}
He plays his idle animation but the size is not correct. Do I have the command right?
As you can see in a previous post, I've made a walk animation. For this I need to add two more things and don't know where to start to implement it. I need to give it an option so that a key (w) is pressed, the character plays the animation and moves forward and I need to make the camera be connected to my new player pawn.
Any help with this? Thanks!
Re: Player pawn
Posted: Thu Jul 03, 2008 9:23 pm
by bernie
Try
SetScale(1.4);
Re: Player pawn
Posted: Sat Jul 05, 2008 1:21 pm
by Sph!nx
Thanks m8. I replaced "Scale(1.4);" with "SetScale(1.4);" but nothing has changed...
Code: Select all
{
Spawn[()
{
Console(true);
SetScale(1.4);
PlayAnimation("anim_idle", true, "");
RestartOrder();
}]
}
Re: Player pawn
Posted: Sat Jul 05, 2008 3:24 pm
by Sph!nx
I've tried doing it another way, looking at the perfect AI script :
Code: Select all
{
SCALE [1.4]
Spawn[()
{
Console(true);
Scale(SCALE);
PlayAnimation("anim_idle", true, "");
RestartOrder();
}]
}
Still no effect
Been trying different approaches to learn how to script for months now, but it still gives me a brain cramp ... Beginning to think this is not really my thing...

Re: Player pawn
Posted: Sat Jul 05, 2008 3:40 pm
by bernie
Well this is the way I did it to shrink the bat in Talisman
I set these variables:
SCALE [0.85]
SHRINKTIME [26]
I set the Scale in the spawn routine
Scale(0.85);
and called the Shrink routine at the appropriate time.
It worked for me.
Shrink[() // Scale down from mansize to batsize smoothly.
{
if(SHRINKTIME >0)
{
Delay("Idle",0.05,"");
SetScale(SCALE);
SCALE = SCALE -0.025;
SHRINKTIME = SHRINKTIME -1;
RestartOrder();
}
//BoxWidth (20);
BoxHeight(30);
AnimateStop("Idle-To_Takeoff",0,""); // Spread wings ready to fly.
AnimateStop("Takeoff-to-Fly",0,"");
AnimationSpeed(4);
PlayAnimation("Fly",true,"");
NewOrder("Patrol");
}]
Re: Player pawn
Posted: Sat Jul 05, 2008 4:01 pm
by Sph!nx
Lol, thanks, don't need to make it smaller but bigger by adding 0.4 (scale 1.4). Might simply do it in the .ini...
Scripting a player might be a bit hard to start of with I guess. I do want to learn this by scripting stuff from scratch for my own created content.
Any suggestions of simple scripts to start off with? (items, npc, game elements, etc.)
Re: Player pawn
Posted: Sun Jul 06, 2008 12:26 pm
by Sph!nx
Yes! I managed to attach the camera to the new player pawn. I still see and I am still able to control the original player, though.
I've tried several things and I've tried to find the scripting command for it but I could not find how to do it. Anyone? Thanks!
Re: Player pawn
Posted: Sun Jul 06, 2008 12:48 pm
by QuestOfDreams
PlayerRender(bool Flag); (low level)