PDA

View Full Version : [FoxBot] Zone Tutorial v 1.0



RoboCop
7th May 2017, 05:17 PM
Zone Tutorial v 1.0 (Author unknown) I think Dr.Evil ??
foxbot.net


Intro
Zones were introduced in version 0.68 of foxbot. Now, in 0.69 the bots will finally utilize them for their intended purpose. First I will briefly describe what zones are and how they work. Zones (also called areas) are a separate file made in much of the same way waypoints are made. Basically waypoints are used to trace lines around all the different areas of a level to create 4 sided polygons inside the level. Each polygon or "area" is then given several names(up to 4). When a bot has the flag and is killed, a check is made to see what area he is in, and then he uses the name of the area to say to the team "Flag dropped in enemy flagroom" or whatever the name of the zone is. The reason there are up to 4 names is because TFC can support up to 4 teams, and realistically players from all 4 teams will not likely refer to a particular area with the same name as another team. Example, red respawn room would be zoned. Name1 would be "enemy respawn room" and name2 would be "our respawn room" Name1 is used by a blue team bot and Name2 is used by a red team bot. Now on to the How-to.




First create a file called area.cfg or zone.cfg and paste the following into it.


area on
waypoint off
pathwaypoint off
bind "INS" "area add"
bind "DEL" "area delete"
bind "END" "area save"
bind "i" "area info"


The first line turns area mode on.
The second line turns waypoint mode off if it was on. (if waypoint and area mode are both on the game could crash)
The 3rd line turns off another waypoint related feature.
The rest of the lines are binds for the area editing mode. Change whatís in RED to your key preferences.
Now, lets look at what the commands in these binds do.


-Commands-
"area add" - This begins creating an "area" by placing waypoints. When the 4th one is placed, you will notice the forming of a closed polygon.
"area delete" - Use this to delete the waypoints that make up an area. Remember to delete all 4.
"area save" - This will save all the areas to a file for the map you are in.
"area info" - This shows you information about the area.
"area namex" - (not shown in config) This is the command in the console that will be used to name the zone. Here is the syntax in an example of a zone placed in red teams flagroom.
area name1 "in the enemy flag room"
area name2 "in our flag room"
name1 will be used by team1 (blue). name2 will be used by team2 (red)
The bots will automatically place "Flag dropped" before the zone name in the sentence to form "Flag dropped in the enemy flag room" or whatever.


If the map only supports 2 teams you can leave "area name3" and "area name4" set to nothing. If there are more than 2 teams just give the zones names for the rest of the teams that the map supports.
name1 is for team1 (blue)
name2 is for team2 (red)
name3 is for team3 (yellow)
name4 is for team4 (green)


You may use the command:
area name "insert area here"
If you dont specify a number after area name it will make all 4 names whatever you specify.
So,
area name "big mommas house"
would set name1, name2, name3, name4 all to "big mommas house"
Use this when you want all of the zone names to be the same regardless of team. Saves typing.
Keep in mind all this will be done in the console. I prefer to name the zones as I create them so you donít miss any by trying to come back later and do it all at once. Also it is very important to remember to use " " around the names like below:


area name1 "big mommas house"


-How To Make an area-
Step 1 - Use the key bound to "area add" to add 4 waypoints in the area on the map you want to "zone"
Step 2 - After placing the 4 waypoints you will see the zone close up into a complete polygon, now you are ready to give it names.
Step 3 - While standing in the zone you wish to name, use the area namex as described above to apply names to the zone for each team available in the map.
Step 4 - Go on to next zone.




Things to remember
Zones light up when you are standing in them so you can better see what zone you are in. This also makes it easier to see just what area you are giving a name to.
Also when you step into a zone it will show you up top the currently assigned names for that zone.
The best way to figure out a name for a zone is to think about how you would refer to the area based on what team you are on, then assign the name based on that. If you were on blue team you might not use the term "blue respawn room" when telling your team where the flag is. You might prefer to say "our respawn room" Yet from red teams perspective, they would refer to it as "blue respawn room" or "enemy respawn room"


Tips:
Make sure you cover all the areas in a map where the flag could be dropped, especially on levels that have rooms on top of rooms or vertical levels.


For Instance, while zoning crossover2 I zoned the upper part of the map and noticed that when I went deeper down into the base in the flagroom, I noticed that it registered me as being in the upper respawn room. This is because there wasnt yet a zone down below so the calculations showed me as being in the upper respawn room area, even though I was quite a ways away height-wise. Hope that makes sense. The point is if I accidentally leave a spot down below in crossover2 where a zone doesnít cover, it might register a flag dropped there as being somewhere on the upper level since a zone up top might cover that blank spot. Try to think of zones as a top down grid around areas of the map. The Z axis (height) doesnít get taken into account as much as length and width. Hard to explain.


If you don't see console messages ingame (Upper Left).. Type in console developer 1
OR right click in Steam Games Menu "Team Fortress Classic / Properties / Set Launch Options.. And add -dev ...........
Then you should see messages in upper left being displayed.