LuaGuide.wiki
changeset 681 ce0819a5ec57
parent 592 2a5ecd20bf16
child 895 9db173fcf26e
--- a/LuaGuide.wiki	Tue Nov 24 19:31:22 2015 +0000
+++ b/LuaGuide.wiki	Tue Nov 24 19:37:29 2015 +0000
@@ -12,13 +12,13 @@
 
 == The basic structure ==
 
-Dependent on what type of script you want to write the requirements are a bit different, but before we go into that we must first create the .lua file.
+Dependent on what type of script you want to write the requirements are a bit different, but before we go into that we must first create the `.lua` file.
 
-If you want to make a Mission for multi player you create a map and create a new file map.lua in the map's folder.
+If you want to make a Mission for multi player you create a map and create a new file `map.lua` in the map's folder.
 
-If you want to make a Training or Campaign (coming) then you create a new .lua file in the appropriate folder under Missions in the Data folder.
+If you want to make a training or campaign mission then you create a new `.lua` file in the appropriate folder under `Missions` in the `Data` folder.
 
-The .lua file should be structured like this:
+The `.lua` file should be structured like this:
 {{{
 function onGameInit()
 end
@@ -43,9 +43,9 @@
 
 == The initiation events ==
 
-The two most important event handlers are onGameInit and onAmmoStoreInit. They are used instead of loading a game scheme and weapon scheme and in Campaign or Missions onGameInit is also used to add teams and hogs.
+The two most important event handlers are `onGameInit` and `onAmmoStoreInit`. They are used instead of loading a game scheme and weapon scheme and in campaign missions or standalone missions `onGameInit` is also used to add teams and hogs.
 
-First we have onGameInit. On this event we should add all game modifiers and team setup. If you are making a Mission you only need to specify the things you want to change on this event, everything not changed will be set to default. The available game modifiers can be found here: [LuaAPI#onGameInit()]
+First we have `onGameInit`. On this event we should add all game modifiers and team setup. If you are making a mission you only need to specify the things you want to change on this event, everything not changed will be set to default. The available game modifiers can be found here: [LuaAPI#onGameInit()]
 
 An example of setting up barrel mayhem in a mission:
 {{{
@@ -59,17 +59,17 @@
 end
 }}}
 
-If you are doing a Training or Campaign you should also set Seed, Map and Theme. But you must also add teams and hogs on this event. This is done by using !AddTeam and !AddHog. An example of adding one team with one hog (these functions may only be used here):
+If you are doing a training or campaign mission you should also set `Seed`, `Map` and `Theme`. But you must also add teams and hogs on this event. This is done by using `AddTeam` and `AddHog`. An example of adding one team with one hog (these functions may only be used here):
 {{{
 AddTeam("Team", 14483456, "Simple", "Island", "Default")
 AddHog("Hedgehog", 0, 1, "NoHat")
 }}}
-To be able to play you must add another team and hog that should have another team color (this team has 14483456) or if you only want one team add the game flag gfOneClanMode. Look in the LuaAPI to see what the other parameters of !AddTeam and !AddHog is.
+To be able to play you must add another team and hog that should have another team color (this team has `14483456`) or if you only want one team add the game flag `gfOneClanMode`. Look in the LuaAPI to see what the other parameters of `AddTeam` and `AddHog` is.
 
-In onAmmoStoreInit you set what weapons is available in the game. For every weapon run [LuaAPI#SetAmmo_(ammoType,_count,_probability,_delay,_numberInCrate) SetAmmo].
+In `onAmmoStoreInit` you set what weapons is available in the game. For every weapon run [LuaAPI#SetAmmo_(ammoType,_count,_probability,_delay,_numberInCrate) SetAmmo].
 This is used to set both starting weapons and weapons found in crates.
 
-Here is an example of initiation of a Training map:
+Here is an example of initiation of a training mission:
 {{{
 function onGameInit()
     Seed = 0
@@ -93,8 +93,8 @@
 
 == Gears everywhere ==
 
-Mostly everything in Hedgewars are made op of gears: grenades, bazooka shells, and cake just to name a few. But these are just the visible gears, the whip's affect and wind change are also gears. But for now we will focus on the more concrete ones.
+Mostly everything in Hedgewars are made op of gears: grenades, bazooka shells, and cake just to name a few. But these are just the visible gears, the whip's effect and wind change are also gears. But for now we will focus on the more concrete ones.
 
-The hogs are gears too and when you shoot with bazooka the bazooka shell will be created and explode when it hits the ground. When the shell is created the onGearAdd event is called and the gear parameter will be the bazooka. And when it hits the ground, before the gear has been deleted onGearDelete is invoked with the shell as parameter, after that it is removed.
+The hogs are gears too and when you shoot with bazooka the bazooka shell will be created and explode when it hits the ground. When the shell is created the `onGearAdd` event is called and the `gear` parameter will be the bazooka. And when it hits the ground, before the gear has been deleted, `onGearDelete` is invoked with the shell as parameter, after that it is removed.
 
 The last event handler onGameTick is called every game tick, that is every millisecond which is a thousand times a second. These three event handlers are the core in the script and where most of the code goes.