Pawn as a Vehicle
- creekmonkey
- Posts: 116
- Joined: Tue Oct 23, 2007 2:55 pm
Pawn as a Vehicle
Is it possible to make a pawn a vehicle that you can actually ride on?
I have a pawn that moves from point to point. I attached a StaticMesh entity to it, but when the player collides with it the pawn stops moving. Is there a thread or tutorial that would point me in the right direction? I have searched the forum but cant seem to find anything that will help?
I have a pawn that moves from point to point. I attached a StaticMesh entity to it, but when the player collides with it the pawn stops moving. Is there a thread or tutorial that would point me in the right direction? I have searched the forum but cant seem to find anything that will help?
- metal_head
- Posts: 1244
- Joined: Sat Jan 05, 2008 8:31 pm
- Location: Bulgaria,Sofia
- Contact:
Re: Pawn as a Vehicle
there's the gen1car.s script,which can be used for a mountable vehicle
- vrageprogrammer
- Posts: 566
- Joined: Wed Oct 31, 2007 2:59 pm
- Location: On top of a tree
- Contact:
Re: Pawn as a Vehicle
Which doesn't work.
It was not Possible to determine the dimensions of the image....
- creekmonkey
- Posts: 116
- Joined: Tue Oct 23, 2007 2:55 pm
Re: Pawn as a Vehicle
I am able to get the generic car script to work. But its not exactly what I need. I need a vehicle similar to a train that moves along a defined path, with the player onboard always facing the front of the train.
Need
1 to mount the vehicle
2 vehicle move along defined path
3 Player and camera to rotate with vehicle
I have been able attach a camera to the vehicle and move it from script point to script point. But the camera does not rotate with pawn, any suggestions why?
Need
1 to mount the vehicle
2 vehicle move along defined path
3 Player and camera to rotate with vehicle
I have been able attach a camera to the vehicle and move it from script point to script point. But the camera does not rotate with pawn, any suggestions why?
Re: Pawn as a Vehicle
How are you attaching the camera?
"So, what's the life of a programmer like?" "...Huh? What life?!"
RF System X:
http://www.realityfactory.info/forum/vi ... f=9&t=3599
RF System X:
http://www.realityfactory.info/forum/vi ... f=9&t=3599
- creekmonkey
- Posts: 116
- Joined: Tue Oct 23, 2007 2:55 pm
Re: Pawn as a Vehicle
I have used
AttachCamera();
and
AttachCameraToBone();
both with the same result. Camera attaches but when pawn rotates the camera either keeps its original rotation and doesnt rotate at all, or sometimes it will rotate a little, maybe 45 degrees but in the wrong direction.
I have also tried adding
self.ideal_yaw=self.player_yaw;
ChangeYaw();
with no visible results.
AttachCamera();
and
AttachCameraToBone();
both with the same result. Camera attaches but when pawn rotates the camera either keeps its original rotation and doesnt rotate at all, or sometimes it will rotate a little, maybe 45 degrees but in the wrong direction.
I have also tried adding
self.ideal_yaw=self.player_yaw;
ChangeYaw();
with no visible results.
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Re: Pawn as a Vehicle
I think to do that last thing you've got to equalize the player's rotation to the pawn's rotation with
PlayerMatchAngles(char *szEntityName );
PlayerMatchAngles(char *szEntityName );
Re: Pawn as a Vehicle
Since you're attaching the camera, I'm assuming this is in third-person...
I don't have have my docs handy(I'm at the library at the moment.) so you'll have to look up the specific paramaters, but...
I'd approach that like this:
1. Create a dummy pawn, turn off it's collision and rendering, and attach a fixed camera to it.
2. Do an AddTriggerOrder to check a trigger for the player boarding the vehicle(This trigger could also switch the camera.).
3. When the trigger is tripped, have the pawn drop to low level, and use PositionToPlayer (I think that's the command, please don't hate me if I'm wrong...), and set the offsets and match angles flag for what you need.
But, that's just me... And 10-to-1, that's probably the hard way. I have a bad habit of finding those. I hope this helps.
I don't have have my docs handy(I'm at the library at the moment.) so you'll have to look up the specific paramaters, but...
I'd approach that like this:
1. Create a dummy pawn, turn off it's collision and rendering, and attach a fixed camera to it.
2. Do an AddTriggerOrder to check a trigger for the player boarding the vehicle(This trigger could also switch the camera.).
3. When the trigger is tripped, have the pawn drop to low level, and use PositionToPlayer (I think that's the command, please don't hate me if I'm wrong...), and set the offsets and match angles flag for what you need.
But, that's just me... And 10-to-1, that's probably the hard way. I have a bad habit of finding those. I hope this helps.
Last edited by Graywolf on Tue Apr 29, 2008 5:45 pm, edited 1 time in total.
"So, what's the life of a programmer like?" "...Huh? What life?!"
RF System X:
http://www.realityfactory.info/forum/vi ... f=9&t=3599
RF System X:
http://www.realityfactory.info/forum/vi ... f=9&t=3599
- creekmonkey
- Posts: 116
- Joined: Tue Oct 23, 2007 2:55 pm
Re: Pawn as a Vehicle
Well when i use the AttachCamera() command it appears as first person with the weapon showing. It seemed the actor i used for the pawn, created in milkshape was the problem. I made a new actor, a simple box for testing and the camera rotation worked.
Graywolf's approach sounds promising, and would probably give more control. Ill have to experiment and figure out the exact commands and see where it leads.
I also thought about a moving platform, but it seems the moving platform has limitations as to how far it would travel.
Graywolf's approach sounds promising, and would probably give more control. Ill have to experiment and figure out the exact commands and see where it leads.
I also thought about a moving platform, but it seems the moving platform has limitations as to how far it would travel.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
- blutwurstchen
- Posts: 57
- Joined: Wed Mar 19, 2008 8:51 pm
Re: Pawn as a Vehicle
I am trying to do something similar with an enclosed vehicle, that starts moving automatically along a fixed path once a player gets in.
The vehicle will be animated (its a horse-drawn carriage), so is it possible for this to be a pawn?
During the time it is moving, the character should be free to move around, but not get out. I would like the controls to be via conversation (with the driver). How should I start something like this?
The vehicle will be animated (its a horse-drawn carriage), so is it possible for this to be a pawn?
During the time it is moving, the character should be free to move around, but not get out. I would like the controls to be via conversation (with the driver). How should I start something like this?