% % Shadow (former Hide Ship Names) % % NEW ABILITY: individual fakenames % % Set your own fake names for ships to get your enemy confused. % if the ShadowName is empty, the normal script of hidename will % take control shipnames, for the case you just forget one new build ship % to set in Shadowmode ;-)) % % This script will name ships using boring fake names. You can % use this in anonymous games to avoid that enemies recognize you % (as a person) by your ship naming style. % % Fake names will be made up of a prefix (`hn.Prefix') followed % by several random digits. Outside PCC, only these fake names % will be seen. % % To use this, simply load it from your gameinit/autoexec file. % The rest is automatic. Like all automatisms, this one's dangerous: % % WARNING: if you load your turn with scrambled names, and your invoke % PCC 1.0.14 or before without this script loaded, the original names % will be lost! For a safer, semi-automatic version, use % Manuel's `scr-s-o.q'. % % To stop this and restore the normal names, do the following: % + load your turn as usual % + from the console, execute the command `sn.Terminate' % + exit PCC % + remove the `Load' command from your gameinit/autoexec file, % else name scrambling will start again. % % History: % + 04/Aug/2001 first version % + 02/Oct/2001 updated for PCC 1.0.15 % + 11/Jan/2004 modified for individual fakenames (done by Tom Würzer) Print "[shadow.q 11/Jan/2004]" % Configuration variable. Set this to a different value if you wish % to use a different prefix. But then, you'll be recognizable again ;) Dim Shared hn.Prefix = "AT #" % Internal Dim Shared sn.Terminated CreateShipProperty sn.RealName, sn.ShadowName, hn.RealName, hn.FakeName % Swap in ship names. This will turn the "fake" names % into real names. Sub sn.SwapInShipNames ForEach Ship Do If Owner$=My.Race$ Then If sn.RealName Then SetName sn.RealName If hn.RealName Then If Left(Name, Len(hn.Prefix)) = hn.Prefix Then hn.FakeName := Name SetName hn.RealName EndIf EndIf Next EndSub % Swap out ship names. This will name all ships with "fake" % names. Sub sn.SwapOutShipNames If sn.Terminated Then Return ForEach Ship Do If Owner$=My.Race$ Then If IsEmpty (sn.ShadowName) OR (sn.ShadowName = "") Then hn.FakeName := hn.Prefix Do hn.FakeName := hn.FakeName & Random(0,10000) Loop While Len(hn.FakeName) < 16 hn.RealName := Name SetName hn.FakeName ELSE sn.RealName := Name SetName sn.ShadowName EndIf EndIf Next EndSub % Terminate name hiding. Sub sn.Terminate sn.Terminated := True % This is an explicit `For' loop to remove the properties of % non-existing (destroyed) ships, too. For i:=1 To 999 Do Ships(i).sn.RealName := Ships(i).sn.ShadowName := z(0) EndSub Sub sn.setting UI.Input "Enter new (fake)name:", "Setting ShadowName for #" & Id, 20, 320, sn.ShadowName If IsEmpty (UI.Result) Then sn.ShadowName := "" Else sn.ShadowName := UI.Result EndIf EndSub Bind ShipScreen 'alt-f' := 'sn.setting' On Load Do sn.SwapInShipNames On Exit Do sn.SwapOutShipNames