Camera Scripted Player
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Camera Scripted Player
Hi, I've decided to make a scripted player, and I want to know how to make a camera in a third person view. Also, I'd like to know how I could create a sort of "Shoulder View" making it so the player's actor is to the left of the screen, instead of in the middle.
Also, could I create a ViewSwitch to a First Person view if a key is pressed, using the scripted player's weapon?
Also, could I create a ViewSwitch to a First Person view if a key is pressed, using the scripted player's weapon?
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
Re: Camera Scripted Player
yep! first you need two/three pawns, a camera and player and/or a weapon pawn. the camera pawn is necessary for the flexibility of the camera. attach the camera to the camera pawn and set it near the player pawn with PositionToPawn command and adding in your offsets. and for the weapon, there are several ways to do that. you could set a trigger with GetEventState and then you could make the player pawn hide with PawnRender(false); and moving the weapon pawn near the camera. Or you could use the player pawn as the weapon pawn too, if you make the fps arms and weapons attached to the player and you just set the camera near the players head.
Herp derp.
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Re: Camera Scripted Player
Thanks, I just have one more question:
Could the weapon only be seen if you turn to the first person view? Like hide the weapon and when the trigger is activated, hide the player and show the weapon?
Could the weapon only be seen if you turn to the first person view? Like hide the weapon and when the trigger is activated, hide the player and show the weapon?
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Re: Camera Scripted Player
Okay I need help with this. I created another pawn which i intended to be the camera pawn, and wrote this:
But I'm not even getting a console. In the world editor i set (in the players Pawn entity) the szEntityName to jugador. What am I doing wrong?
Code: Select all
{
Spawn[()
{
Console(true);
PositionToPawn(jugador,15,0,-15);
AttachCamera();
}]
}
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
Re: Camera Scripted Player
has to have quotes. like so
PositionToPawn("jugador",15,0,-15);
PositionToPawn("jugador",15,0,-15);
Herp derp.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
Re: Camera Scripted Player
yeah, i thought i explain some designs on it in my first postDanimita92 wrote:Thanks, I just have one more question:
Could the weapon only be seen if you turn to the first person view? Like hide the weapon and when the trigger is activated, hide the player and show the weapon?
Herp derp.
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Re: Camera Scripted Player
Okay I'll figure out how to do it how I want, but first I need more help. I put the "" and now the script works (the console comes up) But... this is what it says:
scripts/camar.s:Spawn:1-Method PositionToPawn not found*
I remind you how the level is set up. The three famous entities, and two Pawns.
Pawn 1:
Pawn Type: jugador
ScriptName: jugador.s
SpawnOrder: Spawn
szEntityName: jugador
Pawn 2:
Pawn Type: camara
ScriptName: camara.s
SpawnOrder: Spawn
scripts/camar.s:Spawn:1-Method PositionToPawn not found*
I remind you how the level is set up. The three famous entities, and two Pawns.
Pawn 1:
Pawn Type: jugador
ScriptName: jugador.s
SpawnOrder: Spawn
szEntityName: jugador
Pawn 2:
Pawn Type: camara
ScriptName: camara.s
SpawnOrder: Spawn
Re: Camera Scripted Player
PositionToPawn(...) and AttachCamera() are LOW LEVEL COMMANDS.
You need to switch to Low Level.
{
Spawn[()
{
Console(true);
LowLevel("Init");
}]
Init[()
{
PositionToPawn("jugador",15,0,-15);
AttachCamera();
}]
}
You need to switch to Low Level.
{
Spawn[()
{
Console(true);
LowLevel("Init");
}]
Init[()
{
PositionToPawn("jugador",15,0,-15);
AttachCamera();
}]
}
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Re: Camera Scripted Player
Jesus I can't believe I made such a silly mistake. I didn't realize Console was High Level.
Thank you so much, darksmaster923 and bernie. Works fine.
Thank you so much, darksmaster923 and bernie. Works fine.
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: Camera Scripted Player
The start order of a script is always a high level order.