LGN1
12-01-09, 03:08 PM
Hi,
here is an idea to implement malfunctions without touching too many critical files and avoiding hex offsets. It uses the commands_*.cfg file to disable the item. Since the number of a command is usually not changed by mods, the method is quite mod independent. In addition, it also allows to have some feedback or damage report about the broken item (in the version below this works by ordering Full stop).
Examples below are a broken bold decoy launcher, a broken attack periscope, a broken snorkel, and a failure to crash dive. If you order periscope depth/snorkel depth you get a warning if the periscope/snorkel is broken. Also, if you order 'All stop' you get a damage report telling you about a broken item (since only one item is listed, there is a small chance that not all damage is shown. The chances for this are quite small and if it happens your damage has not been detected before :) In general, the most severe item is always shown).
Best, LGN1
PS: I am working at the moment on a complete overhaul of the malfunctions and sabotage effects for SH3 Cmdr. By using the presented idea I hope it is much more compatible with other mods than the present version. Both, the camera.dat and the sensors.dat/sim file are not used.
;----------Bold decoy failure begin-----------------------------------
[0:data\Cfg\Commands_en.cfg]
;Bold decoy is not working
;Chance: 10%
ApplyToPeriod=19390101|19450508
ChooseFrom=10
RndMidPat=1
0_Cmd200|MnID= ; Empty MnID
0_Cmd200|Key0= ; Empty command
;No warning. You only know after trying.
[0:data\Cfg\Commands_de.cfg]
ApplyToPeriod=19390101|19450508
ChooseFrom=10
RndMidPat=1
0_Cmd200|MnID= ; Empty MnID
0_Cmd200|Key0= ; Empty command
;No warning. You only know after trying.
;----------Bold decoy failure end-------------------------------------
;
;
;----------Attack periscope failure begin-----------------------------
[1:data\Cfg\Commands_en.cfg]
;Lock the periscope, F3 key not working
;Chance: 7%
ApplyToPeriod=19390101|19450508
ChooseFrom=14
RndMidPat=1
0_Cmd16|Key0= ; Empty command
0_Cmd16|MnID= ; Empty MnID
0_Cmd120|Key0= ; Empty command
0_Cmd121|Key0= ; Empty command
;0_Cmd194|Str=1036
;0_Cmd171|Str=1020
;Un-comment the lines above and add the text
;1036=Periscope depth!|CAUTION: Attack scope out of order!
;1020=All stop!|Damage report: Attack scope out of order!
;to your data\Menu\en_menu.txt to be warned when ordering periscope depth
;or stopping the engines.
[1:data\Cfg\Commands_de.cfg]
ApplyToPeriod=19390101|19450508
ChooseFrom=14
RndMidPat=1
0_Cmd16|Key0= ; Empty command
0_Cmd16|MnID= ; Empty MnID
0_Cmd120|Key0= ; Empty command
0_Cmd121|Key0= ; Empty command
;0_Cmd194|Str=1036
;0_Cmd171|Str=1020
;Un-comment the lines above and add the text
;1036=Sehrohrtiefe!|Wahrschau: Angriffssehrohr defekt!
;1020=Alle Maschinen stopp!|Schadensreport: Angriffssehrohr defekt!
;to your data\Menu\de_menu.txt to be warned when ordering periscope depth
;or stopping the engines.
;----------Attack periscope failure end-------------------------------
;
;
;----------Snorkel failure feature begin------------------------------
[2:data\Cfg\Commands_en.cfg]
;Lock the snorkel.
;If it is raised one can lower it via the engineer, but not raise again.
;Chance: 8%
ApplyToPeriod=19390101|19450508
ChooseFrom=12
RndMidPat=1
0_Cmd156|MnID= ; Empty MnID
0_Cmd158|Key0= ; Empty command
;0_Cmd195|Str=1037
;0_Cmd171|Str=1021
;Un-comment the lines above and add the text
;1037=Snorkel depth!|CAUTION: Snorkel out of order!
;1021=All stop!|Damage report: Snorkel out of order!
;to your data\Menu\en_menu.txt to be warned when ordering snorkel depth
;or stopping the engines.
[2:data\Cfg\Commands_de.cfg]
ApplyToPeriod=19390101|19450508
ChooseFrom=12
RndMidPat=1
0_Cmd156|MnID= ; Empty MnID
0_Cmd158|Key0= ; Empty command
;0_Cmd195|Str=1037
;0_Cmd171|Str=1021
;Un-comment the lines above and add the text
;1037=Schnorcheltiefe!|Wahrschau: Schnorchel defekt!
;1021=Alle Maschinen stopp!|Schadensreport: Schnorchel defekt!
;to your data\Menu\de_menu.txt to be warned when ordering snorkel depth
;or stopping the engines.
;----------Snorkel failure feature end--------------------------------
;
;
;----------Crash dive failure feature begin---------------------------
[3:data\Cfg\Commands_en.cfg]
;Crash dive not possible.
;Chance: 7%
ApplyToPeriod=19390101|19450508
ChooseFrom=15
RndMidPat=1
0_Cmd201|MnID= ; Empty MnID
0_Cmd201|Key0= ; Empty command
;0_Cmd171|Str=1022
;Un-comment the lines above and add the text
;1022=All stop!|Damage report: No crash dive possible!
;to your data\Menu\en_menu.txt to be warned when stopping the engines.
[3:data\Cfg\Commands_de.cfg]
ApplyToPeriod=19390101|19450508
ChooseFrom=15
RndMidPat=1
0_Cmd201|MnID= ; Empty MnID
0_Cmd201|Key0= ; Empty command
;0_Cmd171|Str=1022
;Un-comment the lines above and add the text
;1022=Alle Maschinen stopp!|Schadensreport: Alarmtauchen nicht möglich!
;to your data\Menu\de_menu.txt to be warned when stopping the engines.
;----------Crash dive failure feature end-----------------------------
here is an idea to implement malfunctions without touching too many critical files and avoiding hex offsets. It uses the commands_*.cfg file to disable the item. Since the number of a command is usually not changed by mods, the method is quite mod independent. In addition, it also allows to have some feedback or damage report about the broken item (in the version below this works by ordering Full stop).
Examples below are a broken bold decoy launcher, a broken attack periscope, a broken snorkel, and a failure to crash dive. If you order periscope depth/snorkel depth you get a warning if the periscope/snorkel is broken. Also, if you order 'All stop' you get a damage report telling you about a broken item (since only one item is listed, there is a small chance that not all damage is shown. The chances for this are quite small and if it happens your damage has not been detected before :) In general, the most severe item is always shown).
Best, LGN1
PS: I am working at the moment on a complete overhaul of the malfunctions and sabotage effects for SH3 Cmdr. By using the presented idea I hope it is much more compatible with other mods than the present version. Both, the camera.dat and the sensors.dat/sim file are not used.
;----------Bold decoy failure begin-----------------------------------
[0:data\Cfg\Commands_en.cfg]
;Bold decoy is not working
;Chance: 10%
ApplyToPeriod=19390101|19450508
ChooseFrom=10
RndMidPat=1
0_Cmd200|MnID= ; Empty MnID
0_Cmd200|Key0= ; Empty command
;No warning. You only know after trying.
[0:data\Cfg\Commands_de.cfg]
ApplyToPeriod=19390101|19450508
ChooseFrom=10
RndMidPat=1
0_Cmd200|MnID= ; Empty MnID
0_Cmd200|Key0= ; Empty command
;No warning. You only know after trying.
;----------Bold decoy failure end-------------------------------------
;
;
;----------Attack periscope failure begin-----------------------------
[1:data\Cfg\Commands_en.cfg]
;Lock the periscope, F3 key not working
;Chance: 7%
ApplyToPeriod=19390101|19450508
ChooseFrom=14
RndMidPat=1
0_Cmd16|Key0= ; Empty command
0_Cmd16|MnID= ; Empty MnID
0_Cmd120|Key0= ; Empty command
0_Cmd121|Key0= ; Empty command
;0_Cmd194|Str=1036
;0_Cmd171|Str=1020
;Un-comment the lines above and add the text
;1036=Periscope depth!|CAUTION: Attack scope out of order!
;1020=All stop!|Damage report: Attack scope out of order!
;to your data\Menu\en_menu.txt to be warned when ordering periscope depth
;or stopping the engines.
[1:data\Cfg\Commands_de.cfg]
ApplyToPeriod=19390101|19450508
ChooseFrom=14
RndMidPat=1
0_Cmd16|Key0= ; Empty command
0_Cmd16|MnID= ; Empty MnID
0_Cmd120|Key0= ; Empty command
0_Cmd121|Key0= ; Empty command
;0_Cmd194|Str=1036
;0_Cmd171|Str=1020
;Un-comment the lines above and add the text
;1036=Sehrohrtiefe!|Wahrschau: Angriffssehrohr defekt!
;1020=Alle Maschinen stopp!|Schadensreport: Angriffssehrohr defekt!
;to your data\Menu\de_menu.txt to be warned when ordering periscope depth
;or stopping the engines.
;----------Attack periscope failure end-------------------------------
;
;
;----------Snorkel failure feature begin------------------------------
[2:data\Cfg\Commands_en.cfg]
;Lock the snorkel.
;If it is raised one can lower it via the engineer, but not raise again.
;Chance: 8%
ApplyToPeriod=19390101|19450508
ChooseFrom=12
RndMidPat=1
0_Cmd156|MnID= ; Empty MnID
0_Cmd158|Key0= ; Empty command
;0_Cmd195|Str=1037
;0_Cmd171|Str=1021
;Un-comment the lines above and add the text
;1037=Snorkel depth!|CAUTION: Snorkel out of order!
;1021=All stop!|Damage report: Snorkel out of order!
;to your data\Menu\en_menu.txt to be warned when ordering snorkel depth
;or stopping the engines.
[2:data\Cfg\Commands_de.cfg]
ApplyToPeriod=19390101|19450508
ChooseFrom=12
RndMidPat=1
0_Cmd156|MnID= ; Empty MnID
0_Cmd158|Key0= ; Empty command
;0_Cmd195|Str=1037
;0_Cmd171|Str=1021
;Un-comment the lines above and add the text
;1037=Schnorcheltiefe!|Wahrschau: Schnorchel defekt!
;1021=Alle Maschinen stopp!|Schadensreport: Schnorchel defekt!
;to your data\Menu\de_menu.txt to be warned when ordering snorkel depth
;or stopping the engines.
;----------Snorkel failure feature end--------------------------------
;
;
;----------Crash dive failure feature begin---------------------------
[3:data\Cfg\Commands_en.cfg]
;Crash dive not possible.
;Chance: 7%
ApplyToPeriod=19390101|19450508
ChooseFrom=15
RndMidPat=1
0_Cmd201|MnID= ; Empty MnID
0_Cmd201|Key0= ; Empty command
;0_Cmd171|Str=1022
;Un-comment the lines above and add the text
;1022=All stop!|Damage report: No crash dive possible!
;to your data\Menu\en_menu.txt to be warned when stopping the engines.
[3:data\Cfg\Commands_de.cfg]
ApplyToPeriod=19390101|19450508
ChooseFrom=15
RndMidPat=1
0_Cmd201|MnID= ; Empty MnID
0_Cmd201|Key0= ; Empty command
;0_Cmd171|Str=1022
;Un-comment the lines above and add the text
;1022=Alle Maschinen stopp!|Schadensreport: Alarmtauchen nicht möglich!
;to your data\Menu\de_menu.txt to be warned when stopping the engines.
;----------Crash dive failure feature end-----------------------------