![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
![]() |
#1 |
Chief
![]() Join Date: Apr 2005
Location: France
Posts: 311
Downloads: 51
Uploads: 2
|
Sharing GlobalVariables (Ship/Crew/Dialog), possible ?
Hi,
Have anyone been able to share a variable beetween an "AI Ship" script and an "AI crew" script ? What I am trying to do is, for example : - to use a variable when a DD drop his depth charges in order to make the soundman yelling like mad "Depth charges in water !". But it doesn't seems possible to set a variable with a 'Ship:' command and get it later with a 'Wp:' command, or am I missing something ? Thanks.
__________________
________________________ Gimme tons of patches ! Athlonic's MCCD "More Crew Commands by Dialog" MOD for Silent Hunter 5 Version 1.04 SH5 1.2.0 Ready Athlonic's TSAF Mod : Torpedo_Speed_Abilitie_Fix_for_TDC ![]() |
![]() |
![]() |
![]() |
#2 |
Black Magic
![]() |
![]()
I haven't looked at the files that you're playing with but using the 'global' statement doesn't work?
|
![]() |
![]() |
![]() |
#3 |
Chief
![]() Join Date: Apr 2005
Location: France
Posts: 311
Downloads: 51
Uploads: 2
|
![]()
Nop,
I tried with the "Wp:SetGlobalVariable( VAR_WASSERBOMB_STATE, 1 );" command after initialized this variable in the CREW\init.aix file. Triggering this in a crew script ( wp: ) works fine, my soundman report the depth charges. But I didn't manage to make a ship script changing this variable, putting a wp: command or "Ship:SetGlobalVariable( VAR_WASSERBOMB_STATE, 1 );" in a ship script will result in a CTD. And there is no way of detecting when depth charges are fired anywhere else than in the ship tactics scripts. Or there is a sort of wp:is_depth_charges_in_water() but I didn't find it. Would be nice to have a list of working commands for each AI scripts Crew/Ship/Dialog. Hopefully devs will give some more detailled .doc files for scripting help along with the 1.2 patch. Cheers.
__________________
________________________ Gimme tons of patches ! Athlonic's MCCD "More Crew Commands by Dialog" MOD for Silent Hunter 5 Version 1.04 SH5 1.2.0 Ready Athlonic's TSAF Mod : Torpedo_Speed_Abilitie_Fix_for_TDC ![]() |
![]() |
![]() |
![]() |
#4 |
Sailor man
![]() Join Date: May 2005
Posts: 50
Downloads: 169
Uploads: 0
|
![]()
Maybe it would work better to not try to modify that variable directly, but through a function exported from that script.
Also, there's another way to trigger that. I think they've used it in the old SH3 or SH4 versions. Try to look for the drop charges splashes (when they hit the water) ,and from there try to trigger the "depth charges in the water" sound warning. |
![]() |
![]() |
![]() |
|
|