kalitonchik Posted April 5, 2009 Share Posted April 5, 2009 I offer you develope pursue ped script. To my mind this is poppy-proof function. Can you imagine? -You are ped enemy and you need escape from infuriated pedestrians to survive. -Crazy chase. -Avoid from ped, and take fun. Just first step - creating vehicle and warp ped into it function setupForPed ( ) local APed = createPed ( 282, 2327, 1394.5, 43 ) local AVehicle = createVehicle ( 598, 2327.5, 1394.5, 43 ) warpPedIntoVehicle ( APed, AVehicle ) end addCommandHandler ( "getin", setupForPed ) i tryed use that event - but this don't work addEventHandler ( "onResourceStart", getRootElement(), setupForPed ) Whot functions need to make ped fallow the player? -setPedControlState? -some PedTarget function? That is real for embodiment? -I think this is exciting topic... Link to comment
Gamesnert Posted April 5, 2009 Share Posted April 5, 2009 You want a ped in a vehicle to chase you? You don't need a pedTarget function, you do need some freak ass calculations though. - You need to see where objects are, so you don't collide with em - You need to see where the player is, and at what angle the vehicle should drive - You need to see the rotation of the car, to make sure you're correcting him correctly and if he didn't already drive past you - You need some other stuff I can tell ya this will not be easy. Although there was a snippet for scripted ped driving on the scripting board somewhere... Try to find it, and see what you can use from it. Link to comment
kalitonchik Posted April 5, 2009 Author Share Posted April 5, 2009 okey but after all i need know how move pedestrian vehicle from poit A to point B some thing like that function setupForPed ( ) local APed = createPed ( 282, 2327, 1394.5, 43 ) local AVehicle = createVehicle ( 598, 2327.5, 1394.5, 43 ) warpPedIntoVehicle ( APed, AVehicle ) [color=#BF00FF]moveVehicle(AVehicle, 1000, 2327.5, 1513, 43 )[/color] end addCommandHandler ( "getin", setupForPed ) some thing licke that Link to comment
Ace_Gambit Posted April 5, 2009 Share Posted April 5, 2009 Have a look at this. https://forum.multitheftauto.com/viewtop ... 91&t=24188 It's a very basic example of moving a vehicle server-side (without any obstacle checking). Link to comment
kalitonchik Posted April 5, 2009 Author Share Posted April 5, 2009 ! searched youre resource but can't fint it! thanks... Link to comment
Ace_Gambit Posted April 5, 2009 Share Posted April 5, 2009 Just keep in mind that the math used in this example is really rough and dirty. I am sure most of it can be done in less lines of script. But it may help you anyway. Link to comment
kalitonchik Posted April 5, 2009 Author Share Posted April 5, 2009 Thanks i cheanged vehicle to ngr and tuped another posX and Y but ngr dont drive 100% straight ahead but it okey Link to comment
Ace_Gambit Posted April 6, 2009 Share Posted April 6, 2009 Thanks i cheanged vehicle to ngr and tuped another posX and Y but ngr dont drive 100% straight aheadbut it okey The reason it doesn't go in a straight line is because the update interval is not fast enough to correct the turn velocity. The vehicle is constantly "pushed" in the right direction but it "overshoots" the facing angle because it can't correct the heading fast enough. Ideally you would do this client-side every time a new frame is rendered. But because there is no such thing server-side it looks as if it's swinging from left to right. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now