Announcement - Utility BuoyBlaster

Harpoon 3 Advanced Naval Warfare is the result of decades of development and fan support, resulting in the most comprehensive, realistic, and accurate simulation of modern combined air and naval operations available to the gaming public. New features include, multiplayer support, third party databases, scenario editors, and OVER 300 pre-built scenarios!

Moderator: Harpoon 3

Post Reply
MarkShot
Posts: 7478
Joined: Sat Mar 29, 2003 6:04 am

Announcement - Utility BuoyBlaster

Post by MarkShot »

Do you ever get tired of tapping to lay down a field of buoys? Well, I have implemented a hot key utility that drops a series of buoys. The initial starting rate can be set. Additionally, the rate can be increased or decreased while the utility is running. The H363/ANW version allows one or both type of buoys to be selected. The utility needs to be bound to a programmable function key, mouse button, or some other hot facility. I am using a programmable gaming keyboard.

I have implemented this in WinBatch which is a Window's scripting language. WinBatch is not freeware. However, this could easily be converted to Visual Basic which could then be freely distributed along with the Visual Basic runtime.

The code for the H363/ANW version follows below along with a sample screenshot.

WinTitle(WinName(), "BuoyBlaster")

; Mark Kratzer 12/20/07
;
; Utility to feed buoy drop characters into H363 at a steady
; rate. It will be activated via the G15 keyboard as G15 macro
; key.
;
; Usage is to plot a path for a helo and then start this macro.
;
; It will prompt for an initial frequency, but also use a default.
;
; It will prompt for buoy types.
;
; Hold SHIFT key down to increase delay. Hold CTRL key down to decrease delay.
;
; To terminate select an area the taskbar to cause H363 to lose focus.


; ----- Definitions ------

GameWindowName="harpoon3"
BuoyDefaultInterval=5
BuoyDefaultType=1
AckSound="AckSound.wav"

; ----- Initialize -----

; ----- Drop Buoys -----

WindowName=WinGetActive() ; get a custom frequency
BuoyInterval=AskLine("BuoyBlaster", "Enter seconds (wall clock) between buoys?", BuoyDefaultInterval)
PromptString=""
PromptString=StrCat(PromptString,"Select Buoy Types:",@CRLF)
PromptString=StrCat(PromptString,"1 - Passive",@CRLF)
PromptString=StrCat(PromptString,"2 - Active",@CRLF)
PromptString=StrCat(PromptString,"3 - Both")
BuoyType=AskLine("BuoyBlaster", PromptString, BuoyDefaultType)
If BuoyType<>1 && BuoyType<>2 && BuoyType<>3 Then Exit ; invalid type
Delay(1)
WinActivate(WindowName) ; return focus to H363

While @True

Delay(BuoyInterval) ; wait for next buoy drop

If IsKeyDown(@SHIFT) Then
BuoyInterval=BuoyInterval+2 ; increase by two seconds
Beep() ; two beeps for longer delay
Delay(1)
Beep()
End If

If IsKeyDown(@CTRL) Then
BuoyInterval=BuoyInterval-2 ; decrease by two seconds
If BuoyInterval<1 Then BuoyInterval=1 ; cannot go negative
Beep() ; one beep for shorter delay
End If

If WinGetActive()==GameWindowName Then ; Does H363 have focus?
Switch BuoyType
Case 1
SendKey("[") ; emit passive buoy
break
Case 2
SendKey("]") ; emit active buoy
break
Case 3
SendKey("[") ; emit passive buoy
delay(1)
SendKey("]") ; emit active buoy
break
EndSwitch
PlayWaveForm(AckSound, 0) ; play sound for buoy drop
Else
Exit ; if lose focus, then terminate
End If

End While

Image
Attachments
BBS3.jpg
BBS3.jpg (19.8 KiB) Viewed 172 times
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
User avatar
Bucks
Posts: 679
Joined: Wed Jul 26, 2006 10:07 pm
Location: Melbourne, Australia
Contact:

RE: Announcement - Utility BuoyBlaster

Post by Bucks »

Mark,

Could we have a little further information about implementation et al.?

Cheers

Darren

Thanks Mark you beat me to it [:)]
*******************************************
Editor HUD-II/HUD3 Harpoon Databases

http://www.taitennek.com/hud3-db/hud3-index.htm

Development Team H3ANW v3.8, v3.9, v3.10 & v3.10.1
*******************************************
MarkShot
Posts: 7478
Joined: Sat Mar 29, 2003 6:04 am

RE: Announcement - Utility BuoyBlaster

Post by MarkShot »

The code is right there.

Basically, the hot key launchs the program. It issues two dialogue prompts:

(1) What frequency? (wall clock seconds)

(2) What type of buoy? (for 363/ANW; not for HCCE)

Then it emits the buoy character to the Harpoon window as long as the window retains focus. Otherwise, it terminates.

Hold down the SHIFT key and the increment is increased two seconds each cycle.

Hold down the CTRL key and the increment is descreased two seconds until you reach a single second per cycle.
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
User avatar
Bucks
Posts: 679
Joined: Wed Jul 26, 2006 10:07 pm
Location: Melbourne, Australia
Contact:

RE: Announcement - Utility BuoyBlaster

Post by Bucks »

Thanks for the update Mark, this is a great contribution to the game and is a real gift to the development of Harpoon for the Festive season.

Cheers

Darren
*******************************************
Editor HUD-II/HUD3 Harpoon Databases

http://www.taitennek.com/hud3-db/hud3-index.htm

Development Team H3ANW v3.8, v3.9, v3.10 & v3.10.1
*******************************************
MarkShot
Posts: 7478
Joined: Sat Mar 29, 2003 6:04 am

RE: Announcement - Utility BuoyBlaster

Post by MarkShot »

Here is another one. It changes H363/ANW autosave into a checkpoint utility. I also have one similar for HCCE.

WinTitle(WinName(), "SavCkpt(Harp363)")

; ----- Definitions ------

Interval=1
SourceFile1="AUTO.SAV"
DestinationDir="Checkpoint\"

; ----- Initialize -----

If FileExist(SourceFile1) then ; no stale files wanted
FileDelete(SourceFile1)
End If

; ----- Monitor Save Game Status -----

While @true
If FileExist(SourceFile1) then ; wait for file to appear
GoSub CopySaveGame
End If
TimeDelay(Interval)
End While

; ----- Shut Down -----

Exit

Message("Debug", "Pause")

; ##### CopySaveGame #####

:CopySaveGame

; ----- Form file name -----

BaseName=FileTimeGetEx(SourceFile1, 2)
ReplaceName=StrClean(BaseName, ":", "", @False, 1)
ReplaceName=StrSub(ReplaceName, 1, 14)
ReplaceName1=StrCat(StrSub(ReplaceName, 1, 8), " ", StrSub(ReplaceName, 9, 6), ".SAV")
TargetName1=StrCat(DestinationDir, ReplaceName1)
FileRename(SourceFile1, TargetName1)

Return
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
Anonymous

[Deleted]

Post by Anonymous »

[Deleted by Admins]
MarkShot
Posts: 7478
Joined: Sat Mar 29, 2003 6:04 am

RE: Announcement - Utility BuoyBlaster

Post by MarkShot »

VCDH,

The problem with these are that they are simply coding guide lines, since without the WinBatch (www.winbatch.com) interpreter, they cannot be utilized. Winbatch is $99.95 USD.

However, they could easily be recoded in Visual Basic which unlike WinBatch can be redistributed as an EXE and run as long as you have the runtime DLL.

Now, there is a WinBatch compiler which would have allowed me to create an EXE and distribute it, but that costs $495.95 USD which I neither have an urgent need for or can afford to buy simply to share my scripts with my friends. I would happily post the EXEs if I had them.

http://commerce.winbatch.com/webcgi/web ... wwshop.web

So, I hope you understand that the HC and H3 scripts aren't really utilities (they cannot be run as they are), but examples of what could be done and how to do it.

Thanks.
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
MarkShot
Posts: 7478
Joined: Sat Mar 29, 2003 6:04 am

RE: Announcement - Utility BuoyBlaster

Post by MarkShot »

Well, here is another example. It takes the checkpoint and displays a sorted list of them in reverse chronological order. It allows a single checkpoint to be restored, while reminding via the window title of which checkpoint to just tried.

Sample execution is shown below.

WinTitle(WinName(), "RestoreCkpt")

; ----- Definitions ------

DestinationFile="E:\Games\HARP363\RELOAD.SAV"
SourceTemplate="E:\Games\HARP363\Checkpoint\*.*"
SourceDir="E:\Games\HARP363\Checkpoint\"
Interval=60

; ----- Try Different Autosave Checkpoints -----

Title="Select"

While @true

AutosaveList=FileItemize(SourceTemplate) ; build list in reverse chrono order
AutosaveListCount=ItemCount(AutosaveList, @tab)
For I=1 to AutosaveListCount
ReplaceItem=ItemExtract(I, AutosaveList, @Tab)
Prefix=StrFixLeft(AutosaveListCount+1-I, "0", 4)
ReplaceItem=StrCat(Prefix, " ", ReplaceItem)
AutosaveList=ItemReplace(ReplaceItem, I, AutosaveList, @tab)
next

Autosave=AskItemList(Title, AutosaveList, @tab, @sorted, @single) ; pick an item and restore
Autosave=StrSub(Autosave, 10, -1)
If Autosave!="" Then
AutosaveFile=StrCat(SourceDir, Autosave)
FileCopy(AutosaveFile, DestinationFile, @False)
Beep
Title=StrCat('Select ( last = "', Autosave, '" )')
End If

End While

Image
Attachments
ck1.jpg
ck1.jpg (26.79 KiB) Viewed 172 times
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
MarkShot
Posts: 7478
Joined: Sat Mar 29, 2003 6:04 am

RE: Announcement - Utility BuoyBlaster

Post by MarkShot »

What's nice about the checkpoint/restore ... Did you ever want to go back 30 or 70 minutes in a game try something different? Well, with the checkpoint utility you can.

Did you ever experience a bug and get asked for a save game, but by then it was too late? Well, with the checkpoint utility you can find the particular example save for the bug report you need.

Did you ever want to write an AAR, but you don't have all the screenshots captured which you might need? Well, with the checkpoint you can just restore the appropriate saves and take whatever screenshots you need.
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
User avatar
Bucks
Posts: 679
Joined: Wed Jul 26, 2006 10:07 pm
Location: Melbourne, Australia
Contact:

RE: Announcement - Utility BuoyBlaster

Post by Bucks »

ORIGINAL: MarkShot

What's nice about the checkpoint/restore ... Did you ever want to go back 30 or 70 minutes in a game try something different? Well, with the checkpoint utility you can.

Did you ever experience a bug and get asked for a save game, but by then it was too late? Well, with the checkpoint utility you can find the particular example save for the bug report you need.

Did you ever want to write an AAR, but you don't have all the screenshots captured which you might need? Well, with the checkpoint you can just restore the appropriate saves and take whatever screenshots you need.

Mark,
Have you ever tried to "sell" this idea to makers of RTS games. From my experience of playing a few of the more military related titles over the past few years, it's something I have to continuously take care of manually. Making sure I have a save at a point where I might "lose my head" and get a little over ambitious can always be forgotten and that can have lasting effects on the outcome of the campaign.

Again nice work mate great to see a real contribution to the game we all love.

Cheers

Darren
*******************************************
Editor HUD-II/HUD3 Harpoon Databases

http://www.taitennek.com/hud3-db/hud3-index.htm

Development Team H3ANW v3.8, v3.9, v3.10 & v3.10.1
*******************************************
MarkShot
Posts: 7478
Joined: Sat Mar 29, 2003 6:04 am

RE: Announcement - Utility BuoyBlaster

Post by MarkShot »

Darren, let's meet IRC like last night - ok?
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
Post Reply

Return to “Harpoon 3 - Advanced Naval Warfare”