View Full Version : Sharing GlobalVariables (Ship/Crew/Dialog), possible ?
Athlonic
04-16-10, 07:05 AM
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.
TheDarkWraith
04-16-10, 10:24 AM
I haven't looked at the files that you're playing with but using the 'global' statement doesn't work?
Athlonic
04-17-10, 02:52 AM
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.
cothyso
04-17-10, 03:24 AM
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.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.