Vehicle with infinite health + StartRecordingPlayerData
#1

When I make a recording using StartRecordingPlayerData on a player that is inside a vehicle with it's vehicle-health set to infinite (Float:0x7F800000), the following occurs during playback of the recording -
- the vehicle, if a road-vehicle, sets on fire and explodes approximately 10 seconds later
- the vehicle, if an aircraft, explodes immediately

I have tried healing the vehicle on playerback using RepairVehicle & SetVehicleHealth, to no avail. Debug messages show that these commands are being executed.

Does anybody have any experience with this?
Should I rethink the way I give vehicles infinite health? If so, how would you suggest I go about this?
Any suggestions as to how I should go about debugging this? I'm a wee bit stumped, and have been for a few days.

Thanks in advance for any feedback/information.
Reply
#2

Are you making (creating) the recording in a vehicle set to infinite (Float:0x7F800000) health? If so just make the recording in a normal vehicle ?

If the problem comes from the bots driving a vehicle set with infinite health (Float:0x7F800000), then simply put bots in normal health vehicles, vehicles with bots in them dont get damaged anyway.
Reply
#3

Thanks for the response hansen111.

Yes, I am making/creating the recording in a vehicle set to infinite (Float:0x7F800000) health. The vehicle must have infinite health as it is a stunting server.

I have just removed all SetVehicleHealth / RepairVehicle commands for bot-vehicles, along with debug messages for testing. Unfortunately it has made no difference (I did try creating a new recording to test this too).

I don't think the problem is a bot driving a vehicle with infinite health on playback, I think it is a problem with a recording being recorded on an infinite-health vehicle. This is something I can't change, due to the nature of the server. What I could change however is the way in which I achieve infinite-health on vehicles, which is what I may need advice on.
Reply
#4

Quote:
Originally Posted by Benjo
Посмотреть сообщение
Thanks for the response hansen111.
I don't think the problem is a bot driving a vehicle with infinite health on playback, I think it is a problem with a recording being recorded on an infinite-health vehicle. This is something I can't change, due to the nature of the server. What I could change however is the way in which I achieve infinite-health on vehicles, which is what I may need advice on.
You could make the recording on a test server without the health set but if your in a stunting server and you want the bots to drive te custom objects i see the problem. The only way to go then is to NOT set vehicle health on bot vehicles which should be some something you could change fairly simple by identifying the drver to be a bot by using IsPlayerNPC(playerid).

Vehicles with bots driving cant take damage so it makes no sence to set vehicle health on bot vehicles.
Reply
#5

hansen111,

Thanks again for your response. Unfortunately the recordings are created by players using /record in the server.

I'm thinking about doing SetVehicleHealth to say 1000 when /record is typed (and before the StartRecordingData line of course) and resetting it to infinite-health when recording is finished. This is a plausable workaround, but will mean that vehicles being recorded are no longer immune to explosions, which is a feature I really didn't want to lose (as certain stunts require placed explosions to launch the vehicle further/higher).

It's a make-do solution that I will implement, unless somebody has further information/advice for me.
Reply
#6

you also can disable the "infinite" health for all vehicles (when recording) to prevent cars exploding when played back: just dont set the health to those high amounts - 1000000 is enough to survive some explosions/collisions, also why not reset the health OnVehicleDamageStatusUpdate()? 40000 HP is more than enough, if re"healed" each second
Reply
#7

Ok i see your problem then, players making the recording on the fly changes things. I would advice you to test the vehicle health values on bot recordings then, setting the vehicles health to much bigger vaues cold be ok too, just not (Float:0x7F800000) as it would seem from what you said.
Reply
#8

As a quick test, I have simply set it up so that every player-used vehicle has health set to 100000. I am surprised to find that vehicles are surviving my explosions! I swear certain explosions caused instant-death to a vehicle, much like the knife assassination to a player, but I must have been dreaming!

Thanks hansen111 and Babul for your input, it appears that I did indeed overshoot the value required in SetVehicleHealth.
Reply
#9

wouldn't be better just repair the vehicle each time is damaged? do this, or make a simple settimer.

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    RepairVehicle(npcvehicle);
    return 1;
}
Reply
#10

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
wouldn't be better just repair the vehicle each time is damaged? do this, or make a simple settimer.

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    RepairVehicle(npcvehicle);
    return 1;
}
Thanks leonardo1434,

I do use RepairVehicle for the visual repair, but it sets the vehicle health to 1000, not enough to survive explosions. Hence my reason for using SetVehicleHealth straight afterwards.

I am actually repairing/setting health of vehicles using both the OnVehicleDamageStatusUpdate callback and a looping timer. The callback gives instant repair, but no protection when a car flips over and settles on its roof. The looping timer ensures flipped cars will not explode, giving players time to use any of the escape methods available on the server.

I must say that your feedback made me smile because I am usually a bit of a coding-loner, so knowing that I am doing it in a generally acceptable way is good to know!

Thanks again hansen111 for your advice and clarification on how explosions impact vehicles.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)