[Mission] Target practice missions with simple Lua framework (INLCUDED IN HEDGEWARS)
Hi! I have created a couple of target practice missions.
They are very similar to the original cluster bomb training: You have a weapon infinitely times and you have to destroy a fixed sequence of targets in a given time.
These missions also all feature a basic score system, giving you score based on accuracy, hit targets and remaining time. You will see the score in the stats screen. It is mostly the same as seen in this thread: http://www.hedgewars.org/node/5951
Currently, the following missions have been created:
- Cluster bomb on Trash map
- Bazooka on Lonely_Island (easy)
- Bazooka on SB_Grassy (hard)
- Homing bee on Hedgewars map
- Shotgun on SB_Haunty
- Grenade on SB_Crystals (easy)
- Grenade on SB_Crystals (hard)
Note that the bazooka and shotgun missions are different from those in official Hedgewars. The cluster bomb mission is just a reimplementation of the existing cluster bomb mission in official Hedgewars.
I hope I can create even more missions soon. I have also named them all “Target Practice” missions in order to seperate them from “Basic Training”. (I see “Basic Training” missions as tutorial, but target practice is technically not a tutorial anymore and therefore belongs into its own category.)
Here you can download the missions:
TargetPractice_v3.hwp
To use this, put this into your Hedgewars data directory.
I have created the missions with help of a framework I created for this, so target practise missions can be created very quickly. The main work of creating such a mission now just involves its specification (finding good target positions), balancing and playtesting, much less time in actual coding.
Info about the framework:
While I was creating more target practice missions, I quickly realized that they are extremely redundant.
The framework resulted from an update of the cluster bomb training, see here. A few missions posted here are made obsolete by my new missions.
The framework is an attempt to extremely simplify the creation of target practice missions. A target practice mission
To demonstrate how easy to use the framework is, I post here the full source code of my reimplementation of the cluster bomb training:
HedgewarsScriptLoad("/Scripts/TargetPractice.lua") local params = { ammoType = amClusterBomb, gearType = gtClusterBomb, missionTitle = "Cluster Bomb Training", solidLand = false, map = "Trash", theme = "Golf", hog_x = 756, hog_y = 370, hogName = loc("Private Nolak"), hogHat = "war_desertgrenadier1", teamName = loc("The Hogies"), targets = { { x = 628, y = 0 }, { x = 891, y = 0 }, { x = 1309, y = 0 }, { x = 1128, y = 0 }, { x = 410, y = 0 }, { x = 1564, y = 0 }, { x = 1248, y = 476 }, { x = 169, y = 0 }, { x = 1720, y = 0 }, { x = 1441, y = 0 }, { x = 599, y = 0 }, { x = 1638, y = 0 }, }, time = 180000, shootText = loc("You have thrown %d cluster bombs."), } TargetPracticeMission(params)
Yep, it’s just one script load and a single function call, the rest is just specification, and many fields are optional.
The framework is included in the HWP file above. To program using the framework, first extract the HWP file (it is a Zip file in reality). You will find the framework in Scripts/TargetPractice.lua. The comments in this file explain the parameters and you should quickly be able to create your own target practice missions (Lua skills required of course).
To find the coordinates, use an image editor like The GIMP. The coordinates used by Hedgewars are identical to the image coordinates.
EDIT: Oops, I accidentally added the sniper rifle mission to the HWP file. Please ignore it, it does not belong in here and does not use the framework.
EDIT 2: version 2 released.
Hi, I am a Hedgewars developer.
Hm, only a brief comment to say I tried to test them, but they seem to crash my Hedgewars. Didn't investigate too deeply, yet. Did you actually test these already?
mikade
Hedgewars Developer
Oops, I had two bugs, on of them sneaked in right before release. I have fixed both bugs and now the scripts should work both in 0.9.20 and in development version of Hedgewars.
Download version v2:
TargetPractice_v2.hwp
EDIT:
Here are the descriptions for the missions:
Sadly, I cannot package them because Hedgewars stores all mission descriptions in a single file. If you want description in-game, you have to add this text manually to Locale/missions_en.txt (but this is not required, the missions work anyways).
Hi, I am a Hedgewars developer.
Hi! I have added two grenade missions: easy and hard, both on SB_Crystal
(this map is just too perfect for grenades ).
Here you can grab the next version of the HWP file:
TargetPractice_v3.hwp
(Please make sure to delete older versions of TargetPractice HWPs.)
I have updated the description texts in the previous post.
Now I have created target practice missions for the most important weapons in the game. Let’s see if I create more missions for more exotic weapons.
Hi, I am a Hedgewars developer.
Alright, nice work. I added these and the updated trainings into repo with a small tweak that should allow some strings to actually be translated this version.
I think nemo has already mentioned this to you, but in future please version the individual files so that they don't conflict with older ones when people inevitably don't delete older versions of HWPs etc.
mikade
Hedgewars Developer