SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 04-16-10, 07:05 AM   #1
Athlonic
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.
Athlonic is offline   Reply With Quote
Old 04-16-10, 10:24 AM   #2
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

I haven't looked at the files that you're playing with but using the 'global' statement doesn't work?
TheDarkWraith is offline   Reply With Quote
Old 04-17-10, 02:52 AM   #3
Athlonic
Chief
 
Join Date: Apr 2005
Location: France
Posts: 311
Downloads: 51
Uploads: 2
Default

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.
Athlonic is offline   Reply With Quote
Old 04-17-10, 03:24 AM   #4
cothyso
Sailor man
 
Join Date: May 2005
Posts: 50
Downloads: 169
Uploads: 0
Default

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.
cothyso is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:42 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.