xml-stuff

Germany At War: Operation Barbarossa 1941 is an elegant turn-based design, inspired by classics such as Panzer General, but with more of a historical focus. You command the German forces through a branching historical campaign covering the entire 1941 campaign as well as part of the 1942 campaign. Dozens of scenarios stretch from the Soviet border all the way to Archangel and towards Astrakhan, the original military goals of Operation Barbarossa. Step into a wargame where your performance will rewrite history, through an addictive combination of compelling gameplay, realistic events and challenging battles.

Moderator: Ronald Wendt

Post Reply
Erik2
Posts: 785
Joined: Thu Nov 02, 2000 10:00 am
Location: Oslo, Norway

xml-stuff

Post by Erik2 »

Ronald, thanks for the detailed reply in the Petsamo-thread.

A few xml-questions.

1) The scenario xml-file is a great place to rename units using search/replace. Any danger in adding long unit names that may exceed the unit name field?
What is the max number of character displayed?

2) You can also edit the unit strength, is it possible to override the maximum default for a particular unit? I have a couple of Engineer Brigades that are currently measly 5-strength units.

3) Can you add/change the transport for a unit (using the range and vehicle fields).

6) I assume the index no is the hex identification you see in the minimap in the editor?

7) Is a save-game roughly the same as a scenario-file, ie it contains all the scenario data?
User avatar
Ronald Wendt
Posts: 1880
Joined: Mon Jun 08, 2009 6:09 am
Contact:

RE: xml-stuff

Post by Ronald Wendt »

Hello Erik,
ORIGINAL: Erik Nygaard
Ronald, thanks for the detailed reply in the Petsamo-thread.

you are welcome. Any questions on the game will be answered - sometimes it takes a while, but we try our best to do it in a timely fashion.
ORIGINAL: Erik Nygaard
1) The scenario xml-file is a great place to rename units using search/replace. Any danger in adding long unit names that may exceed the unit name field?
What is the max number of character displayed?

There is a limited space and the game does not hinder you from creating longer names than it can display in certain areas. There is no exact lenght though as the lenght of names differs depending on the letters. You have to do a certain amount of trial and error here.
ORIGINAL: Erik Nygaard
2) You can also edit the unit strength, is it possible to override the maximum default for a particular unit? I have a couple of Engineer Brigades that are currently measly 5-strength units.

The game should level all values to the maximum possible. There ae four unit sizes in the game that can be set in xml regardless of the default.

If you want the engineers to be a brigade instead of a battalion you need to add formation="brigade" and you can set a strength up to 11

Same goes for the other formations: battalion (max.5), regiment(max.7) and division(max.15)
ORIGINAL: Erik Nygaard
3) Can you add/change the transport for a unit (using the range and vehicle fields).

You can change the vehicles (wagon,truck,tracked) in the XML, but you cannot change their basic values.

You can set a state at the beginning of a scenario e.g. you can say range="4" for a tank unit so it has only 4 movement points in turn 1.


ORIGINAL: Erik Nygaard
6) I assume the index no is the hex identification you see in the minimap in the editor?

Exactly.
ORIGINAL: Erik Nygaard
7) Is a save-game roughly the same as a scenario-file, ie it contains all the scenario data?

Yes, it contains the whole map + extra infos needed for statistics etc. The good thing is you can look through the scenarios and see which one has nice victory conditions. Then you copy & paste and adjust them to your map.

Regards,
Erik2
Posts: 785
Joined: Thu Nov 02, 2000 10:00 am
Location: Oslo, Norway

RE: xml-stuff

Post by Erik2 »

ORIGINAL: Ronald Wendt
.....
ORIGINAL: Erik Nygaard
2) You can also edit the unit strength, is it possible to override the maximum default for a particular unit? I have a couple of Engineer Brigades that are currently measly 5-strength units.

The game should level all values to the maximum possible. There ae four unit sizes in the game that can be set in xml regardless of the default.

If you want the engineers to be a brigade instead of a battalion you need to add formation="brigade" and you can set a strength up to 11

Same goes for the other formations: battalion (max.5), regiment(max.7) and division(max.15)
...

A really nice feature of forcing a different formation in the xml-file is that the NATO unit size symbols change accordingly.
Note the infantry battalion/regiment/brigade, artillery battalion, tank battalion/regiment, engineer brigade in the screenshot.
Excellent side-effect [:D]

Image
Attachments
unitsizes.jpg
unitsizes.jpg (324.82 KiB) Viewed 280 times
User avatar
Ronald Wendt
Posts: 1880
Joined: Mon Jun 08, 2009 6:09 am
Contact:

RE: xml-stuff

Post by Ronald Wendt »

Hello,

nice map [:)]

When do we get a chance to play it ?

Regards,
Erik2
Posts: 785
Joined: Thu Nov 02, 2000 10:00 am
Location: Oslo, Norway

RE: xml-stuff

Post by Erik2 »

ORIGINAL: Ronald Wendt

Hello,

nice map [:)]

When do we get a chance to play it ?

Regards,

Working as a programmer you know better than to ask for a specific launch date [;)].
Soon if I do not hit any more snags.
Erik2
Posts: 785
Joined: Thu Nov 02, 2000 10:00 am
Location: Oslo, Norway

Reinforcements

Post by Erik2 »

I am not able to get this working.
I copied the events from the Smolensk scenario.
The event id is puzzling, the Smolensk use something like AGCReinforcementJuly25 with different dates corresponding to the turn numbers.

Mine looks similar to this example.

<Event id="GermanReinforcementOctober8" marks="victory">
<Condition type="turns" compare="==" value="2"/>
<Action type="camera" player="0" duration="3" index="7936" distance="5"/>
<Action type="place-unit" player="0">
<Unit type-id="fi_Jager" name-en="I/Finnish Ski Bde" index="7936" map-direction="0.866025;0.5;0" strength="5" experience="80" core-unit="0"/>
<Unit type-id="fi_Jager" name-en="II/Finnish Ski Bde" index="7681" map-direction="0;1;0" strength="5" experience="80" core-unit="0"/>
<Unit type-id="fi_Jager" name-en="III/Finnish Ski Bde" index="7682" map-direction="0;1;0" strength="5" experience="80" core-unit="0"/>
</Action>
<Action type="text" player="0" sound="event-text-historical" text-en="[font=&apos;Courierbold-10&apos;]The Finns lend you the crack Finnish Ski Brigade to support your defense." title-en="[font=&apos;Courierbold-10&apos;]+++ Reinforcements have arrived! +++"/>
<Action type="camera" player="0" duration="3" index="3841" distance="3"/>
</Event>


Thanks
Erik
Erik2
Posts: 785
Joined: Thu Nov 02, 2000 10:00 am
Location: Oslo, Norway

Victory conditions

Post by Erik2 »

I get the Russian 'brilliant victory' to appear in the game, but the next victory level does not display in the briefing.

The events:

<Event id="AAAAA" winner="1" marks="victory" text-player-1-en="Occupy northern Finland and northern Norway.">
<Condition type="turns" text-player-1-en="You have {dest} days for your mission, there are {remaining} left." compare="<=" value="30"/>
<Condition type="occupy-objects" text-player-1-en="Capture {obj0},{obj1},{obj2},{obj3},{obj4},{obj5},{obj6} and {obj7} to occupy all important strategic positions." occupy-minimum="8" player="1" object-positions="3080,3343,3874,5152,6154,6429,6667,7936"/>
</Event>
<Event id="ABAAA" winner="1" marks="victory" text-player-1-en="Occupy northern Finland (6 objectives)">
<Condition type="event" event-id="FirstNormal"/>
<Condition type="turns" text-player-1-en="You have {dest} days for your mission, there are {remaining} left." compare="<=" value="34"/>
<Condition type="occupy-objects" text-player-1-en="Capture {obj0},{obj1},{obj2},{obj3},{obj4},{obj5},{obj6} and {obj7} to occupy all important strategic positions." occupy-minimum="6" player="1" object-positions="3080,3343,3874,5152,6154,6429,6667,7936"/>
</Event>

Thanks
Erik

Image
Attachments
russianvictory.jpg
russianvictory.jpg (136.36 KiB) Viewed 280 times
User avatar
Ronald Wendt
Posts: 1880
Joined: Mon Jun 08, 2009 6:09 am
Contact:

RE: Reinforcements

Post by Ronald Wendt »

Hello Erik,

ORIGINAL: Erik Nygaard

<Event id="GermanReinforcementOctober8" marks="victory">

the id is just a designation. It only becomes relevant of you want to link an event to another one. Mine are usually kind of reminders what it does if something unusual was done but that not always the case.

The command "marks" is needs "none" as attribute and this means that a victory site is not marked on the map. This is nice for side quests or bonus events.

If you place new units or don't care about the markings you can leave this out.

ORIGINAL: Erik Nygaard
<Action type="place-unit" player="0">
<Unit type-id="fi_Jager" name-en="I/Finnish Ski Bde" index="7936" map-direction="0.866025;0.5;0" strength="5" experience="80" core-unit="0"/>
<Unit type-id="fi_Jager" name-en="II/Finnish Ski Bde" index="7681" map-direction="0;1;0" strength="5" experience="80" core-unit="0"/>
<Unit type-id="fi_Jager" name-en="III/Finnish Ski Bde" index="7682" map-direction="0;1;0" strength="5" experience="80" core-unit="0"/>
</Action>

The error is that you cannot place groups with <Action type="place-unit" player="0">, only single units (it should be there for every unit at Smolensk, too).

So every unit has to be embraced by <Action type="place-unit" player="0"> and </Action>.

Regrads,

User avatar
Ronald Wendt
Posts: 1880
Joined: Mon Jun 08, 2009 6:09 am
Contact:

RE: Victory conditions

Post by Ronald Wendt »

Hello Erik,
ORIGINAL: Erik Nygaard

I get the Russian 'brilliant victory' to appear in the game, but the next victory level does not display in the briefing.

First this can be left out:

<Condition type="event" event-id="FirstNormal"/>

if there is no such event.

Then your conditions lack an action that defines the value of the victory, too:

<Action type="end" winner="0" scenario-end="0" victory-type="brilliant" >

This means the conditions lead to the end of the scenario (type="end"), winner is the player number, so you designate the winner in the action.

scenario-end="X" can contain anything in a single map - it only matters in a campaign.

victory-type="brilliant,normal,tactical" -> chose one. With this you get different levels into the objectives. Just remember a loss will be created by a victory of the enemy.

And don't forget to end the action with </Action>.

You could also add some debriefing text:

<Action type="end" winner="0" scenario-end="0" victory-type="brilliant" >

<Player id="0" text-en="&#x0A;-- Brilliant victory --&#x0A;&#x0A;You wiped out the enemy completely ! This is a total defeat for the enemy." sound="event-end-brilliant"/>

</Action>

Regards,
Erik2
Posts: 785
Joined: Thu Nov 02, 2000 10:00 am
Location: Oslo, Norway

RE: Reinforcements

Post by Erik2 »

Got the reinforcements working.
Note to other designers; you need to subtract 1 for the turns.
This line will actually place the unit on turn-2 in the game:

<Condition type="turns" compare="==" value="1"/>

Erik
Erik2
Posts: 785
Joined: Thu Nov 02, 2000 10:00 am
Location: Oslo, Norway

RE: Victory conditions

Post by Erik2 »

Hi Ronald

Is there any way to test the victory conditions/debriefing without actually playing all 30+ turns...?
If you could play both sides in hot-seat it should be fairly easy to let one side win [:)]

Erik
User avatar
Ronald Wendt
Posts: 1880
Joined: Mon Jun 08, 2009 6:09 am
Contact:

RE: Victory conditions

Post by Ronald Wendt »

Hello Erik,
ORIGINAL: Erik Nygaard

Hi Ronald

Is there any way to test the victory conditions/debriefing without actually playing all 30+ turns...?
If you could play both sides in hot-seat it should be fairly easy to let one side win [:)]

Erik

if you only want to test the mere function of the conditions and not the balance of the map, you could simply make a copy of it and erase the army of the enemy to move into the victory locations without resistance.

For a good balance i fear you or a tester would have to play the map several times to adjust things.

Regards,
Erik2
Posts: 785
Joined: Thu Nov 02, 2000 10:00 am
Location: Oslo, Norway

RE: Reinforcements

Post by Erik2 »

It appears that several units may arrive using the same index (map loc), for instance the map edge .
When you move the unit currently occupying the hex, the next unit in line is displayed in the same hex.
Correct?

Thanks
Erik
Erik2
Posts: 785
Joined: Thu Nov 02, 2000 10:00 am
Location: Oslo, Norway

RE: Reinforcements

Post by Erik2 »

In my Petsamo scenario the Russian is the attacker.
Is there a way to force the Russians to start the scenario/turns?
The defending Germans AI have a habit of blooding the German units in rather futile attacks...

Thanks
Erik
User avatar
Ronald Wendt
Posts: 1880
Joined: Mon Jun 08, 2009 6:09 am
Contact:

RE: Reinforcements

Post by Ronald Wendt »

Hello,
ORIGINAL: Erik Nygaard

It appears that several units may arrive using the same index (map loc), for instance the map edge .
When you move the unit currently occupying the hex, the next unit in line is displayed in the same hex.
Correct?

Thanks
Erik

Yes, but only during very turn.
ORIGINAL: Erik Nygaard

In my Petsamo scenario the Russian is the attacker.
Is there a way to force the Russians to start the scenario/turns?
The defending Germans AI have a habit of blooding the German units in rather futile attacks...

Thanks
Erik

in the game Player 0 always starts and Player 1 has the second move.

So you have to make the Soviets Player 0.

Regards,
Erik2
Posts: 785
Joined: Thu Nov 02, 2000 10:00 am
Location: Oslo, Norway

RE: Reinforcements

Post by Erik2 »

ORIGINAL: Ronald Wendt
...
ORIGINAL: Erik Nygaard

In my Petsamo scenario the Russian is the attacker.
Is there a way to force the Russians to start the scenario/turns?
The defending Germans AI have a habit of blooding the German units in rather futile attacks...

Thanks
Erik

in the game Player 0 always starts and Player 1 has the second move.

So you have to make the Soviets Player 0.

Regards,

Guess this is where I do the change:
<Player id="0" nation="de" block="Axis"

And then all other German player fields with 0 will have to changed to 1 also. Hope I do not miss any...


User avatar
Ronald Wendt
Posts: 1880
Joined: Mon Jun 08, 2009 6:09 am
Contact:

RE: Reinforcements

Post by Ronald Wendt »

Hello,

indeed all objects have to change owner. I use find & replace functions for things like this with an additional Player 2 for swapping.

Regards,
Erik2
Posts: 785
Joined: Thu Nov 02, 2000 10:00 am
Location: Oslo, Norway

RE: Reinforcements

Post by Erik2 »

Me too [:D]
User avatar
Ronald Wendt
Posts: 1880
Joined: Mon Jun 08, 2009 6:09 am
Contact:

RE: Reinforcements

Post by Ronald Wendt »

Hello,

i guess its an obvious choice, i just thought it won't hurt to mention it. [;)]

Regards,
Post Reply

Return to “Germany at War: Barbarossa 1941”