Jump to content
Sign in to follow this  
ZNorQ

How to repair fuel leaks?

Recommended Posts

I'm creating a field mechanic function that repair anything above 40% damage, but below 85% (too much damage for mechanic to handle)..

The problem is that this concept absolutely refuses to repair fuel leaks in choppers (Don't know if there are fuel leaks in other types of vehicles, hence that haven't been tested).

I'm using setDamage function to first set it to zero, then back to the minimum repairable damage of 40%, but the fuel leak is still progressing.

Anyone got an idea of how I can fix this problem?

ZNorQ

Share this post


Link to post
Share on other sites

fuel leak is set either after getting some damage by whole heli or its "fuel" hitpoint. anyway it can only be fixed with setdammage down to 0. when you set it up again "fuel leak" apperas again. i gues it's vehicle simulation

Share this post


Link to post
Share on other sites
fuel leak is set either after getting some damage by whole heli or its "fuel" hitpoint. anyway it can only be fixed with setdammage down to 0. when you set it up again "fuel leak" apperas again. i gues it's vehicle simulation

So, in essence, you will always get a fuel leak (especially in choppers) when getting some damage?

ZNorQ

Share this post


Link to post
Share on other sites
Quote[/b] ]So, in essence, you will always get a fuel leak (especially in choppers) when getting some damage?

i guess so. Add a lot of armor to Hitfuel class to see if i'm right

Share this post


Link to post
Share on other sites
Add a lot of armor to Hitfuel class to see if i'm right

How do I do that?

ZNorQ

Share this post


Link to post
Share on other sites
You might be able to CreateVehicle a repair truck, below ground out of the way. Then use the Action command Repair:

From the wiki:

Vehiclename will receive weapons/fuel/repair from 'vehicle2' immediately and via teleportation.

Then once it reaches 0% damage, just delete the truck and assign your 40% damage.

Yeah, probably a good idea, just that I've had afew bad experiences with createVehicle in MP games.. (Well, back in the OFP days).. I'll give it a try anyway. Thanks.

Share this post


Link to post
Share on other sites

Sounds like deleting the damaged vehicle and creating a new one at the same position and with the same orientation could be the easiest solution.

Share this post


Link to post
Share on other sites
Quote[/b] ]Yeah, probably a good idea, just that I've had afew bad experiences with createVehicle in MP games

Well if it's for a one off mission then, just place one via the editor, some place out of the way. I was assuming you were writing a set of scripts to be used by anyone?

But the worst you should expect from CreateVehicle, is a slight delay if there are no other Repair Trucks in the mission. As long as you ensure the vehicle is created only on the server. Then it should be ok? Just wrap the code around an:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">If IsServer Then

       {

       .....

       };

If it's a problem with locality (the repair may have to be called localy if your using a User Action) then create the truck for each mechanic, at the begining of the mission. Apply the code I posted on the wiki, to ensure the newly created Truck is available to all clients. See Example 3 here:

http://community.bistudio.com/wiki/setVehicleVarName

Just give it a sensible, global variable name. There is no reason why you can't share the same repair truck with multiple players. But you could always create a truck for each player.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×