Home   Help Search Login Register  

Author Topic: MBT-Status  (Read 1351 times)

0 Members and 1 Guest are viewing this topic.

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
MBT-Status
« on: 06 Aug 2004, 02:33:47 »
Havent seen Terox around for a while,so gonna ask this here...
I would like to implement a "MBT-Status " in a MP map.(ECL Template)The Officer can check anytime howmuch dammage his MBT (M1/T80) has.That way he can see when its respawned,and if it is repairable or not etc..

Officer init:
Code: [Select]
[this,"E1"] exec "misc\T80ex.sqs"

Code: [Select]
;;T80ex.sqs,by PPP ;;
;;Adds an action to officer;;

Player addaction ["MBT-Status","misc\T80.sqs"] ; exit

Code: [Select]
;;T80.sqs,by PPP ;;
;;Detects the dammage of your MBT;;


hint format ["T80 has %1 percent dammage!",(getdammage T80 * 100 )-((getdammage T80 * 100 )mod 1)]
~2
exit


Everything works well,untill the vehicle is totally destroyed and respawns.

Then the dammage is set to 0 and stays 0,whatever the real dammage is  :?

What should I do so this works with a respawned (new) vehicle? ???

Is Createvehicle the cause?Do I need publicvariables? :help:

http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

olseric

  • Guest
Re:MBT-Status
« Reply #1 on: 06 Aug 2004, 10:14:46 »
Thinking outside of the box here...

Since this is a script that can only be called if you're inside of the vehicle I presume, why not have it figure out what vehicle you are inside of and then calculate the damage from that?  That way you don't have to worry about specifying vehicles in the scripts (more dynamic that way).

PublicVariable shouldn't matter since the actual damage is stored sever-side and client reported automatically anyway.
« Last Edit: 06 Aug 2004, 10:17:14 by olseric »

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:MBT-Status
« Reply #2 on: 06 Aug 2004, 10:56:07 »
No U dont have to be in a vehicle...

I have a 40 minutes MP game,10 v 10,both sides have a MBT(M1/T80)
The MBT respawns,when destroyed,after 180 seconds.
This script should give the Officer of both sides (E1-W1) the option to check the status of his MBT anytime,either he/someone is in this/any vehicle or not.Practically it lets U know (well if all works fine)if your MBT is back for batlle,without having someone looking for it.

It works fine,it shows the xx percent of dammage your MBT has,untill he is totally destroyed.
The value reaches then 100%,constant for 180 seconds,and then goes back to 0%.(Means the vehicle is respawned by the vehiclerespawn script.)

From here the value allways stays 0 %,no matter what the real dammage of your MBT is.
The script runs on the officer,but I tried it also on the T80,no difference...

http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

olseric

  • Guest
Re:MBT-Status
« Reply #3 on: 06 Aug 2004, 12:55:27 »
Is the name of the vehicle staying the same?  I'd check that first as that could be the problem right there.  If not and it's the only vehicle of that type there, a simple nearestObject command with T80 as the type would select it nicely.

I once heard a rumor about MP damages being incorrectly reported, handled, etc, but never heard confirmation of that...