New HTroop News!.....Also, Can anyone tell me how to solve t

Ask questions, discuss ideas, get answers
professor_smith
Posts: 133
Joined: Thu Dec 13, 2012 7:45 am

Re: New HTroop News!.....Also, Can anyone tell me how to sol

Post by professor_smith »

So Apache, I shouldn't remove the v_arg1 and endIf from this?:


if v_arg1 == host

run ai
run SinglePlayer/ObjectSpawns
run SinglePlayer/ControlPoints

endIf
Lets make war games, not war.
professor_smith
Posts: 133
Joined: Thu Dec 13, 2012 7:45 am

Re: New HTroop News!.....Also, Can anyone tell me how to sol

Post by professor_smith »

And what about placing the v_arg1 after these?:

run SinglePlayer/ObjectSpawns v_arg1
run SinglePlayer/ControlPoints v_arg1
Lets make war games, not war.
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: New HTroop News!.....Also, Can anyone tell me how to sol

Post by Apache Thunder »

No, those should definitely keep them or you may get server/client when players attempt to connect to the server.

Some maps use the "run SinglePlayer/ObjectSpawns v_arg1" method in your example. But I tend to prefer the more often used method as it's more standard.
ImageImageImage
I have cameras in your head!
professor_smith
Posts: 133
Joined: Thu Dec 13, 2012 7:45 am

Re: New HTroop News!.....Also, Can anyone tell me how to sol

Post by professor_smith »

Apache,
Though I greatly appreciate you answering my questions, I was wondering if you or anyone would be willing to give me a detailed example of each game type file (both the Map's Main folder and the Game Types folder, separately)? There are so many people's opinions out there about this topic, and I want to be sure I get it right. The playtesters are getting anxious (lol).

Thank You,

Professor Smith
Lets make war games, not war.
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: New HTroop News!.....Also, Can anyone tell me how to sol

Post by Apache Thunder »

The differences between the game mode files in the main level folder and the ones found in the GameTypes folder? Generally I always make them identical. I've never sorted out why they are separate or the result of having them be different. So general wisdom is that they always are the same. I make a change in the one in the root of the level folder first, then copy it to GameTypes folder to make sure they are both the same.

The only difference is that the SinglePlayerAllied.con and SinglePlayerAxis.con are only used for Instant Battle mode (the game calls it Skirmish internally). That is, singleplayer when started from the Instant Battle menu. NOT the one started from the Multiplayer menu. That's always coop game mode.

As for why there's one for each team. I think with that, the game loads the Allies one if you start instant battle on the allied team (team 2) and the axis one if you had chose to play on Axis team. I suppose if you wanted to, you can create unique game mode alterations depending on which team you select. This is mainly used for Campaign mode. Generally they have the same settings, but the little used Campaign mode may use these to set up different scenarios depending on the team you play as. Generally in my mods, I always make these files the same as the COOP con files.

I don't make much use of Campaign mode. In fact I completely disabled campaign mode in my BFH'42 mod mainly because my redesigned load screen isn't really compatible with the vanilla layout of the briefing load screen you get when you start a map in campaign mode. I decided to just remove it from the menu system in the mod instead of wasting my time updating the briefing screen to a BFH style layout and then set up some kind of campaign story/layout for the maps.

You still need to use add the SingleplayerAxis/SingleplayerAllied con files for when you add singleplayer to map otherwise you won't be able to select/load the map if you are using the Instant Battle feature. I noticed the con files have the v_arg1 stuff too, but technically it's not even needed since it's impossible to setup a server to use Skirmish mode. Skirmish is always pure singleplayer with no ability to switch teams and no one can "connect" to the game as it's not an active server session. (that I know of anyway) I suppose it was just a carry over the mod tools that add basic bot scripts to map for adding bot support. The vanilla files have them too. I don't think COOP mode (as started from the multiplayer) ever uses those two con files, so you can exclude all the v_arg1 stuff from them if you want. Just make sure you only do this to ONLY the SinglePlayerAllied.con and SinglePlayerAxis.con files. These two game mode files are the only ones that are not also present in the GameTypes folder. ;)

Though in BF2, they altered it so singleplayer is always started as a lan server.

As for when to use the v_arg1, generally the objectspawns.con and the controlpoints.con file is always setup to only be loaded by the server by use of the v_arg1 stuff. This includes all AI related stuff like AI templates and pathfinding stuff. Generally the best way to know if you're game mode con file is setup correctly is to simply look at one of the vanilla maps as comparison.

That's pretty much how I tought my self how to mod this game. I just compare my coding attempts to how existing content is structured and build and improve from there. My method of learning things is trial and error for the most part and might be regarded as primitive by some, but for me it's worked the best and it's why I have gotten to know this game so well. Tutorials can only show you so much. The best way to learn how to mod the game is to simply experiment with things. I started with trying to port a helicopter from Battlefield Vietnam into BF1942 and that was basically how I learned how to code vehicles. The rest is history. My DCU mod is pretty much my sandbox and I used that mod to experiment with and learn more about BF1942. Battlefield Heroes'42 was one of the more extensive and refined mods I've made after I have learned most of everything I know now. Mario Kart mod was a side project really and didn't really fit with the other two main projects. BF242 was a mod I improved with more BF2 content and the mod was the first mod I worked on extensively that wasn't a mod I created. Network related stuff like how to make maps work in multiplayer was one of the last things I learned how to do, so unlike some other modding veterans around here, I'm not quite as good at it yet. The v_arg1 stuff is also another thing I'm not as familier with. Dystopia City remains the only map I've made extensive use of that and that was a map I made just recently.

That's the simplest explanation I have on it. :P
ImageImageImage
I have cameras in your head!
professor_smith
Posts: 133
Joined: Thu Dec 13, 2012 7:45 am

Re: New HTroop News!.....Also, Can anyone tell me how to sol

Post by professor_smith »

So Apache,
Do you know anyone that would specifically know what the format should be to make multiplayer maps work over a network (preferably over an internet game)? Or what do your game type .con files look like for all your maps, and do all of them connect over a network game?

If your's are all the same, can you please copy and past the conquest.con, coop.con, ctf.con, and tdm.con scripting, onto a message or forum reply for me? I too have learned through trial and error, but now I just want to release it so that other's can try HTroop, and perhaps find a few people to help me fine tune it.

Thank You,

Professor Smith
Lets make war games, not war.
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: New HTroop News!.....Also, Can anyone tell me how to sol

Post by Apache Thunder »

The coop.con, tdm.con, and conquest.con are typically not specific to each map except for maybe the ticket count and bleed settings. CTF.con is the only one you'd really have to pay attention to when making a new map as special flag objects are defined in these files. (though technically they should have been defined in the ControlPoints.con file, but the ctf.con file is where Dice decided to drop them and everyone else just rolled with it. :P ).

For CTF mode, most mods have the special flag templates defined in the map's Init.con file. Another odd coding quirk. They should be in the controlpointtemplates con file, but as with the spawn positions for them, they put then in a non standard location. In my BF'42 mod however, I decided to put them in the ctf.con file instead.

I'll explain some of the commands in the conquest.con file. the tdm.con file and coop.con file are structured the same, so I won't re-explain those since they use similar commands. Just with different paths.

Code: Select all

Game.setNumberOfTickets 1 100
Game.setNumberOfTickets 2 100
Game.setTicketLostPerMin 1 5
Game.setTicketLostPerMin 2 5

run Conquest/SpawnpointManagerSettings
run Conquest/SoldierSpawnTemplates
run Conquest/ObjectSpawnTemplates
run Conquest/ControlPointTemplates
run Conquest/SoldierSpawns

if v_arg1 == host

run Conquest/ObjectSpawns
run Conquest/ControlPoints

else

endIf
Here's each command explained:

Game.setNumberOfTickets 1 100
Game.setNumberOfTickets 2 100

Starting Ticket count for each team at the start of the round. First command sets the team, and the second the ticket count. Team 2 is Allied side (blue) and Team 1 is Axis team. Basically the same as the team numbers used everywhere else in the game.


Game.setTicketLostPerMin 1 5
Game.setTicketLostPerMin 2 5

Sets the speed at which tickets bleed. However the time at which they will start bleeding depends on how the area value for each CP in the game mode in question is balanced. For example a ControlPoint with areaValue set to 50 will have greater importance then one set to 25. How this is setup up for all the control points determines when the team in question starts losing tickets.


run Conquest/SpawnpointManagerSettings
This loads all the game mode specific code from the Conquest folder. (path will be different depending on the game mode, use existing maps as examples)
SpawnPointManager settings is the con file that defines the spawn groups for soldier spawns. These group numbers are linked to the control points via a spawn group command so it's important that they are setup correctly. You don't want to fudge one up and end up with red team bots spawning on a control point controlled by the blue team or worse, the spawning doesn't work at all!


run Conquest/SoldierSpawnTemplates
Where the soldier templates will be loaded from.

run Conquest/ObjectSpawnTemplates
The OST file as it's known. This loads the con file that stores all the Object Spawners (Vehicles mainly) for the game mode in question.



run Conquest/ControlPointTemplates
This is where the control point templates are stored. The properties of each Control Point is stored here.


run Conquest/SoldierSpawns
This stores the soldier spawn positions. Unlike the ObjectSpawns con file, object.setTeam and Object.setOSid have no effect on these. That's defined by the spawn templates in the SoldierSpawnTemplates con file and is dependent on correct spawn groups. Refere to SpawnPointManagerSettings for what team each group is set to. Remember, team 0 is typically used on a control point that starts out neutral (uncapatured) at the start of the round. ;)


if v_arg1 == host
This defines the start of an If statement command. This particular instance of it is important for multiplayer as this defines con files and other commands that only the server is allowed to process. Take note on how it's used on existing maps. A lot of AI related coding on map makes use of this as well as AI Templates and code is also server side only. Typically only Object spawn positions and control point positions are in this section. AI related code like Ai.con is referenced in this part of the con file as well for the singleplayer game modes.


run Conquest/ObjectSpawns
This is where all the object spawns are stored (the vehicles basically). The ObjectSpawnTemplates defines the templates each object in this file references. Object.setTeam and/or Object.setOSid defines what teams each instance will spawn on. Object.setOSid is used to define what object spawn group the specific vehicle will use. (not the same as the spawn groups for soldiers, though most control points typically have them set to the same number) Each control point has a object spawn group setup in the ControlPointTemplates file. If you use a matching number from one, then that specific vehicle will spawn on that CP if the object spawn template for that vehicle has a matching team number that CP uses.

However the Object.setTeam command makes that vehicle always spawn on a specific team. Unlike soldiers however both commands only effect which vehicle spawns based on the OST file for each vehicle reference. Thus, this doesn't directly influence whether or not it will spawn or not like with the soldier spawns. The OST file defines what teams each vehicle reference in this file uses and if a team is set via a control point or via the setTeam command that isn't defined for the vehicle's spawner template, then nothing will spawn.

run Conquest/ControlPoints
This stores all the Control Ponts. Like the soldier spawns, Object.setTeam and setOSId have no use in this file since the properties of each Control Point is defined in the ControlPointTemplates file.


else
This ends the server only segment of the if statement. Anything past this but before the endIf statement would only run on clients/singleplayer. However most maps always leave this area blank. Only very speciallized map code would be used here. The vast majority of maps won't use this area.


endIf
This ends the If statement group. Anything past this like most normal code gets executed on both client and server machines.

The Objective Mode and CTF modes are a little different. I'll leave it up to some else to describe those. Objective Mode I know very little about and I don't have the time to fully explain CTF mode. Singleplayer is the same as conquest mode except for a few AI related commands. ;)
ImageImageImage
I have cameras in your head!
Post Reply