Hi all ctp2 fans,
I havn´t had much ctp2 time for a couple of month.
But my holiday-time at the German coast (North Sea) was filled with very nasty weather.
So it was a good time to think about Slic.
I have read in the Slic-manual (by Ahenobarb) and I got some ideas about slic for the French Revolution scenario. I wrote down (without Laptop or personal computer) my ideas in the holiday-time and most of the slic-code was without great troubles (after computer transfer at home).
I will cut it short , because most stuff is available from my homepage (CityAlarm2).
The code doesn´t work perfect so far (but there is no computer -crash). Maybe someone has an idea of the mistakes in my slic-code.
Put the scenario: CityAlarm2 in your scenario folder and play for Scottland.
The aim: If there are some big foreign armies near to cities of one player, the player is alarmed by the function CityAlarm. This function gives the location of the main foreign army (the center of agression).
If the player is alarmed, a lot of big armies (the function BestPosition) will march to the best location of army formation. Another function looks if the armies are valid for formation (the army-size, the distance to the formation point, the kind of unittype are important for that function).
The next function (PositionArmies) will calculate seven places for seven armies, the formation depends on the position of the foreign agressor army.
Infantry armies (5) should be placed in a line towards the foreign army. Behind the line there are two artilliery armies. If the player has less than 7 big armies a smaller formation will be prepared.
If one army has reached the right position, the army should sleep. If all valid armies have reached the formation point, the formation stops and will move against the agressor army.
My problem: Not all armies like to sleep. Question: Is there someone who sees the mistakes in my code ?
The other parts of the code and the functions works without problems.
Another function (who looks for valid positions in the movepath e.g. no water is missing so far, this must be done later on). In my example scenario is no water.
One other useful Handler: ArmyClicked (for the same formation of Human player armies ) should do the same, maybe an Alertbox can be used to give the army-size and the distance to the formation point to computer calculation.
Maybe the CityAlarm function (if later on the code works as desired) is also useful for some other scenario writers (e.g. WW1).
Best wishes
FRITZ
I havn´t had much ctp2 time for a couple of month.
But my holiday-time at the German coast (North Sea) was filled with very nasty weather.
So it was a good time to think about Slic.
I have read in the Slic-manual (by Ahenobarb) and I got some ideas about slic for the French Revolution scenario. I wrote down (without Laptop or personal computer) my ideas in the holiday-time and most of the slic-code was without great troubles (after computer transfer at home).
I will cut it short , because most stuff is available from my homepage (CityAlarm2).
The code doesn´t work perfect so far (but there is no computer -crash). Maybe someone has an idea of the mistakes in my slic-code.
Put the scenario: CityAlarm2 in your scenario folder and play for Scottland.
The aim: If there are some big foreign armies near to cities of one player, the player is alarmed by the function CityAlarm. This function gives the location of the main foreign army (the center of agression).
If the player is alarmed, a lot of big armies (the function BestPosition) will march to the best location of army formation. Another function looks if the armies are valid for formation (the army-size, the distance to the formation point, the kind of unittype are important for that function).
The next function (PositionArmies) will calculate seven places for seven armies, the formation depends on the position of the foreign agressor army.
Infantry armies (5) should be placed in a line towards the foreign army. Behind the line there are two artilliery armies. If the player has less than 7 big armies a smaller formation will be prepared.
If one army has reached the right position, the army should sleep. If all valid armies have reached the formation point, the formation stops and will move against the agressor army.
My problem: Not all armies like to sleep. Question: Is there someone who sees the mistakes in my code ?
The other parts of the code and the functions works without problems.
Another function (who looks for valid positions in the movepath e.g. no water is missing so far, this must be done later on). In my example scenario is no water.
One other useful Handler: ArmyClicked (for the same formation of Human player armies ) should do the same, maybe an Alertbox can be used to give the army-size and the distance to the formation point to computer calculation.
Maybe the CityAlarm function (if later on the code works as desired) is also useful for some other scenario writers (e.g. WW1).
Best wishes
FRITZ