Home   Help Search Login Register  

Author Topic: Silbersteins real rear damge script  (Read 1416 times)

0 Members and 1 Guest are viewing this topic.

chrishn2003

  • Guest
Silbersteins real rear damge script
« on: 08 Aug 2005, 00:12:23 »
Silberstein has made an excellent script making the tanks more vulnerable to the rear and sides as in real life. The scripts cover the basic AT weapons of OFP: LAW, Carl Gustav, AT4 and RPG. The following is the script for the AT4:

_tankname = _this select 0

#begin
#ciws

_tank = getpos _tankname
_Shell = NearestObject[ _tank, "AT4"]

_Pos = GetPos _Shell
? ((_Pos Select 0) != 0) and ((_Pos Select 1) != 0) and ((_Pos Select 2) != 0) and (_tankname Distance _Shell < 30): Goto "lock"

goto "ciws"

#lock

_ShellHead = GetDir _Shell
_TankHead = GetDir _tankname

_relHead = _TankHead - _ShellHead

?(_relHead < 90) and (_relHead > -90): _tankdamage = 1
~1.5
?(GetDammage _tankname > 0.1) and (_tankdamage == 1): _tankname SetDammage 1

?(Alive _tankname):goto "begin"
exit

I've downloaded the BAS Delta/Range add-on and would like to make a script making the tanks vulnerable to the JAM_AT4Launcher (the M136 in the add-on). How do I do that? Is it just a matter of changing some variables in the script above? And if so, which variables? Or do I need to do something completely different? To anyone who answers this, please explain everything in detail since I'm not an experienced scripter.
« Last Edit: 08 Aug 2005, 00:13:23 by chrishn2003 »

Dane

  • Guest
Re:Silbersteins real rear damge script
« Reply #1 on: 08 Aug 2005, 03:03:19 »
This line:
_Shell = NearestObject[ _tank, "AT4"]

Change AT4 to the class name of the weapon you want.

Edit. That would be:
Quote
JAM_AT4Rocket Standard 450 damage
JAM_AT4AARocket Can Target Air units 125 damage
JAM_AT4APRocket Can Target Soldiers 450 damage
JAM_AT4ALLRocket Can Target Air +Soldiers 450 damage
« Last Edit: 08 Aug 2005, 03:08:07 by DaneDK »

chrishn2003

  • Guest
Re:Silbersteins real rear damge script
« Reply #2 on: 08 Aug 2005, 07:38:55 »
Thanks, now the script works, but I still don't get the desired effect. It works fine when I use the Carlgustav. One shot in the rear kills the tank. However when I use the script along with the JAM_AT4Rocket, the script works (no error messages), but the damage from the weapon is not enough to destroy the tank with one rear-shot.

As far as I can figure it must be because the JAM_AT4Rocket isn't very powerful. Is there a way to increase its damage?

Dane

  • Guest
Re:Silbersteins real rear damge script
« Reply #3 on: 08 Aug 2005, 18:05:34 »
Ooh. Without editing the config then we need the advanced scripters around here, but i think something like ? NearestObject[ _tank] == "AT4": setDammage "higher" something like that??

Edit. Would one shot to the rear be enough to destroy a tank in real life?
« Last Edit: 08 Aug 2005, 18:25:55 by DaneDK »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Silbersteins real rear damge script
« Reply #4 on: 08 Aug 2005, 21:39:42 »
it would do considerable dammage, immoballizing or some very serious problem, and it may (tho i doubt it) completely destroy it, but i don't know for sure

your problem is probably that you used the wrong classname.
switch between the  4 of them and test each one til you know why one your using.

or to find out immediatly type this in your units init:

hint format ["unit has these magazines: %1",(magazines this)]  it will give a hint of an array with all the weapons he has

edit: oops just realized that its the mag you're looking for.
« Last Edit: 08 Aug 2005, 21:40:47 by Triggerhappy »

Dane

  • Guest
Re:Silbersteins real rear damge script
« Reply #5 on: 09 Aug 2005, 18:42:42 »
Try changing this line:
Quote
?(GetDammage _tankname > 0.1) and (_tankdamage == 1): _tankname SetDammage 1

to this line and see what happens :P
Quote
?(GetDammage _tankname > 0) and (_tankdamage == 1): _tankname SetDammage 1

chrishn2003

  • Guest
Re:Silbersteins real rear damge script
« Reply #6 on: 10 Aug 2005, 08:40:04 »
Nope. It doesn't do the trick. I still need to shoot the tank three times in the rear before it goes down, and that isn't realistic, even when it's a T80.

Thanks for trying to help  :)

Offline 456820

  • Contributing Member
  • **
Re:Silbersteins real rear damge script
« Reply #7 on: 10 Aug 2005, 13:19:20 »
post what you have put with the edited version aslong as its the same with the right name of the rocket it should wotk ive spotted nothing wrong with the example on the first post but im not a great scripter

Code: [Select]
_tankname = _this select 0

#begin
#ciws

_tank = getpos _tankname
_Shell = NearestObject[ _tank, "JAM_AT4Rocket"]

_Pos = GetPos _Shell
? ((_Pos Select 0) != 0) and ((_Pos Select 1) != 0) and ((_Pos Select 2) != 0) and (_tankname Distance _Shell < 30): Goto "lock"

goto "ciws"

#lock

_ShellHead = GetDir _Shell
_TankHead = GetDir _tankname

_relHead = _TankHead - _ShellHead

?(_relHead < 90) and (_relHead > -90): _tankdamage = 1
~1.5
?(GetDammage _tankname > 0.1) and (_tankdamage == 1): _tankname SetDammage 1

?(Alive _tankname):goto "begin"
exit

thats the same script but with the class of the rocket in also the name of the rocket i put in may be wrong so make sure thats right
i cant see why its not working this is weird how about getting in touchwith teh author or have you tried ?

or maybe even try with the law version instead of the At4 ?

chrishn2003

  • Guest
Re:Silbersteins real rear damge script
« Reply #8 on: 10 Aug 2005, 15:32:12 »
I've tried contacting Silberstein, but his username doesn't exist any longer.

Nothing works :(. I think I've tried all combinations of weapon names and magazine names. The weird thing is, that if you look in the original AT4 script - written by Silberstein and working properly - the weapon is called "AT4". However, in OFP the AT4 isn't named AT4, it's called "AT4Launcher" (both the ammo and weapon). So where does the AT4 come from?

The same can be seen with the CarlGustav, LAW and RPG. In the script Silberstein calls them: "CarlGustav", "LAW" and "RPG", but these weapon-names don't exist, since in OFP they are called "CarlGustavLauncher", "LAWLauncher" and "RPGLauncher". I don't get it. Do the weapon-names refer to the content of some *.pbo file maybee?

Dane

  • Guest
Re:Silbersteins real rear damge script
« Reply #9 on: 10 Aug 2005, 17:33:50 »
Ofcourse, now i think i know what the problem is, we're using the script with the ammo name instead of the munition name (i think  ::)), that is we're using magazine names, that's the problem!

Try this instead:
Code: [Select]
_Shell = NearestObject[ _tank, "JAM_AT4ammo"]
Edit. Class names of munitions or whatever?
Code: [Select]
JAM_AT4Rocket == "JAM_AT4ammo"
JAM_AT4AARocket == "JAM_AT4AAammo"
JAM_AT4APRocket == "JAM_AT4APammo"
JAM_AT4ALLRocket == "JAM_AT4ALLammo"


Class names for eastern counter part RPG7 is JAM_rpg7ammo etc. Just in case you want to use the script on some Abram's

Edit2. Tested this myself and it works, 1 JAM_AT4ammo to the rear == 1 dead T80
« Last Edit: 10 Aug 2005, 18:26:33 by DaneDK »

chrishn2003

  • Guest
Re:Silbersteins real rear damge script
« Reply #10 on: 10 Aug 2005, 21:44:05 »
YES!!! It works. Now I can finally blow some tanks up. Thank you very much.