Home   Help Search Login Register  

Author Topic: How do i repair vehicles from DEAD without them exploding?  (Read 1231 times)

0 Members and 1 Guest are viewing this topic.

firstflash

  • Guest
Im trying to create a functioning salvage chopper:

this part works:

when apc is destroyed a CH-47 moves to the apc's location, picks it up and drops it in a specified location.

this part does not work:
at the drop location, there is a trigger that runs a command:

apc setdammage 0

and when the APC repairs it explodes again,

Anyone know why?

I even tried:

apc setfuel 0
~10
apc setdammage 0

but no luck, STILL GOES BOOM

Kaliyuga

  • Guest
Re:How do i repair vehicles from DEAD without them exploding?
« Reply #1 on: 24 Oct 2002, 02:59:31 »
 I have one very crucial question for you ?   will the player have the opportunity to actually see the repair taking place? and if so , how often?  

 I'm afraid that if you've already tried taking away the fuel and ammo...  even if there isn't a weapon there's still ammo right? the kind you can take from the cargo... if you want no explosion to occur you need to remove all fuel and ammo as well.    

anyways... my point being.. if the player is not going to have a great probability of seeing the repair take place.. why not just use the deletevehicle and createvehicle commands?    you could even have the destroyed vehicle be taken to a hangar or somesuch thing so the change could take place undercover ;)


firstflash

  • Guest
Re:How do i repair vehicles from DEAD without them exploding?
« Reply #2 on: 24 Oct 2002, 16:13:07 »
i thought about using that method as well, delete/ create because like you said it doesnt need to look good, however it is a named unit and i dont know how to create a named unit.

I did remove weaps at one point and that simply rid me of the explosion, the dead unit still would not repair.

the player would not see the repair as it occurs like this:
player's group and APC are transported from base to LZ.
if apc is damaged (destroyed in this case) a CH-47 comes and picks it up and returns it to repair area at base, when repairs are complete, apc is redeployed to players location (via same ch-47) .

with the exception of the repair it all works as one step, although lol, i discovered a new glitch yesterday:

the routine goes:

CH-47 goto APC
CH-47 pickup APC
CH-47 goto Repair Area
CH-47 drop APC
wait 30-60 seconds
CH-47 pickup APC
CH-47 goto Player location
CH-47 drop APC

and it works great if it all occurs within 1000 meters, the problem i found yesterday is:

if the distance the CH-47 has to travel (with APC attached is greater than approx 1000 meters, it wont move at all)
$##$#_@#)@##@*$@$)%#)!!!!!!!

But, if u can you tell me how to delete / create with a named unit that would be a great help, ill post the distance problem seperately.

thanks








Demoniac

  • Guest
Re:How do i repair vehicles from DEAD without them exploding?
« Reply #3 on: 24 Oct 2002, 17:59:14 »
The problem is easy: when the vehicle is being repaired, the fuel explodes. So if you first set the fuel to 0 (_Vehicle SetFuel 0), then repair and then refill the fuel, it won't explode.

firstflash

  • Guest
Re:How do i repair vehicles from DEAD without them exploding?
« Reply #4 on: 24 Oct 2002, 18:08:10 »
read above, already tried it, doesnt work for me

Eagles Talon

  • Guest
Re:How do i repair vehicles from DEAD without them exploding?
« Reply #5 on: 24 Oct 2002, 19:55:13 »
ok here is how u name and unname a non-exhistant vehicle

to create the vehicle, u can modify the direction/dammage/whatever, if u would put say  this setdammage 1, just put apc setdammage 1 ect...
also base is an object where u put an object and u name it base, perferrably place it under ground, by putting this in the init: this setpos [(getpos this select 0),(getpos this select 1),-5]

apc = "m113" createVehicle [0,0,0]; apc setdir 90; apc setpos [(getpos base select 0),(getpos base select 1)];

now 2 delete it,

deleteVehicle apc; apc = nil

the apc = nil makes it so u can reuse the name apc (might b redundant, i don't know, but i havn't tested this)

hope this helps

Eagles_Talon

firstflash

  • Guest
Re:How do i repair vehicles from DEAD without them exploding?
« Reply #6 on: 24 Oct 2002, 20:02:46 »
thanks talon ill give that a go.

Hamdinger

  • Guest
Re:How do i repair vehicles from DEAD without them exploding?
« Reply #7 on: 25 Oct 2002, 05:01:00 »
If you look at some of the vehicle respawn scripts, you'll see that they have to slowly repair the vehicle to keep it from blowing up again.  For example, doolittle just posted a vehicle respawn script and in it you see these lines:

;We do this weird thing below so that the vehicle will not crumple again!
_obj setDammage 0.3
~0.5
_obj setDammage 0.1
~0.5
_obj setDammage 0

I don't know why it works, but it does.  Hope that helps.

firstflash

  • Guest
Re:How do i repair vehicles from DEAD without them exploding?
« Reply #8 on: 25 Oct 2002, 16:17:09 »
Awesome, that did the trick Ham, you rock.

Thanks.