Graviteam
March 19, 2024, 08:39:48 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Mission Scripting discussion  (Read 27765 times)
0 Members and 1 Guest are viewing this topic.
lockie
Generalfeldmarschall
*****
Posts: 2348



« on: March 14, 2011, 02:52:40 PM »

Kyth, I found in er script the next lines:
   Wipeout01, 0x2000f, ger_inf_plat1:AA, 6.000;
   Wipeout02, 0x2000f, ger_inf_plat1:AB, 6.000;
   Wipeout03, 0x2000f, ger_inf_plat1:AC, 6.000;
   Wipeout04, 0x2000f, ger_inf_plat1:AD, 6.000;


What does parameter :AA do?
Logged

Provocative signature removed
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #1 on: March 14, 2011, 03:45:17 PM »

Kyth, I found in er script the next lines:
   Wipeout01, 0x2000f, ger_inf_plat1:AA, 6.000;
   Wipeout02, 0x2000f, ger_inf_plat1:AB, 6.000;
   Wipeout03, 0x2000f, ger_inf_plat1:AC, 6.000;
   Wipeout04, 0x2000f, ger_inf_plat1:AD, 6.000;


What does parameter :AA do?

They're supposed to define the vehicle in the platoon, with A, B, C and D being the 1st, 2nd, 3rd & 4th vehicles respectively.

By the way, there's a funny bug in the 'Efficiency of Division' trigger, when it's applied to Grenadier platoons. The game engine only tracks reduction in effectiveness of the 1st vehicle (the command unit).

So the 4 lines I used above, force the game to consider reduction in strength and effectiveness of the entire platoon, using the 'Efficiency of Object' trigger for the individual vehicles/squads in the platoon. 

It seems to work quite well now  Smiley
Logged

"What am I, chopped liver..?"

"Yes."
lockie
Generalfeldmarschall
*****
Posts: 2348



« Reply #2 on: March 14, 2011, 04:50:13 PM »

Thanks for the answer. It's very interesting! I'll  play vs it.
 How did u know about it?  Shocked

Another question, I'd be pleased at er attention.
I created some missions but still don't get how the game show the description of "Combat Plan" at the monitor.
i.e.
In er mission there's a line:
ext, add_misobj, order1, way1, 1, txt_mi_mymission_8_way1, txt_mi_mymission_8_way1_sh;
where:
ext, add_misobj - command line
order1 - order name
way1 - ?
1 - mission status
txt_mi_mymission_8_way1 - long mission description in MENU
txt_mi_mymission_8_way1_sh - short mission description in MENU

and it's quite enough to see the message at mission start: Move up and secure the lower river crossing.
In may case I had to add an additional line:
   ext, add_text, txt_attack, 0xffffffff, 20, 0;
   ext, add_misobj, order1, map_counter_01, 1, txt_siege_attack, txt_siege_attack_sh;

Don't understand why I need to do that, but if I don't - I won't see the message: Attack the enemy. (T-35 mission)
« Last Edit: March 15, 2011, 10:58:29 AM by lockie » Logged

Provocative signature removed
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #3 on: March 14, 2011, 07:33:54 PM »

Thanks for the answer. It's very interesting! I'll  play vs it.
 How did u know about it?  Shocked

The information was mentioned in one of the discussions at the Sukhoi.ru forum, and with a lot of trial and error in the Mission Editor.  Smiley

Quote
Another question, I'd be pleased at er attention.
I created some missions but still don't get how the game show the description of "Combat Plan" at the monitor.
i.e.
In er mission there's a line:
ext, add_misobj, order1, way1, 1, txt_mi_mymission_8_way1, txt_mi_mymission_8_way1_sh;
where:
ext, add_misobj - command line
order1 - order name
way1 - ?
1 - mission status
txt_mi_mymission_8_way1 - long mission description in MENU
txt_mi_mymission_8_way1_sh - short mission description in MENU

and it's quite enough to see the massage at mission start: Move up and secure the lower river crossing.
In may case I had to add an additional line:
   ext, add_text, txt_attack, 0xffffffff, 20, 0;
   ext, add_misobj, order1, map_counter_01, 1, txt_siege_attack, txt_siege_attack_sh;

Don't understand why I need to do that, but if I don't - I won't see the massage: Attack the enemy. (T-35 mission)

The name
way1
refers to the label given in the cs_map block:

ext, add_mo, way1, flag_tri0, 0xc0000080, 0x80202020, 2, txt_mi_mymission_8_way1_sh,0, flag1, -1, false, 0;

This links the mission objective (order1) in cs_main, with the actual item and its location on the map (flag1), which is defined in cs_map.  In the game itself, the location of the objective will be marked with a little square icon.

I think the on-screen message won't appear if there's no link between an objective and a map item. I usually put a flag where the objective is supposed to be.

I hope this helps!
 
« Last Edit: March 14, 2011, 07:37:14 PM by Kyth » Logged

"What am I, chopped liver..?"

"Yes."
lockie
Generalfeldmarschall
*****
Posts: 2348



« Reply #4 on: March 15, 2011, 10:51:12 AM »

The information was mentioned in one of the discussions at the Sukhoi.ru forum, and with a lot of trial and error in the Mission Editor.  Smiley
I missed so useful information, but thanks to u I got it!

Quote
The name
way1
refers to the label given in the cs_map block:

ext, add_mo, way1, flag_tri0, 0xc0000080, 0x80202020, 2, txt_mi_mymission_8_way1_sh,0, flag1, -1, false, 0;

This links the mission objective (order1) in cs_main, with the actual item and its location on the map (flag1), which is defined in cs_map.  In the game itself, the location of the objective will be marked with a little square icon.
OK, thanks. I got that icon.

Quote
I think the on-screen message won't appear if there's no link between an objective and a map item. I usually put a flag where the objective is supposed to be.
I hope this helps!
In spite of my link vs cs_map block there's still no on-screen message Sad
It's a mysticism, means I've to use an additional line.
Logged

Provocative signature removed
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #5 on: March 15, 2011, 12:34:53 PM »

Quote
In spite of my link vs cs_map block there's still no on-screen message
It's a mysticism, means I've to use an additional line.

Hi Lockie,

There's one final thing, which I forgot to add:

The text data for the on-screen message is in 2 parts:

txt_xxx_sh() { text1 (name to display with the little square icon);  text2 (message to appear in the message-box); }

Taking your mission's example,

txt_siege_attack_sh() {Attack the enemy.;}

there should be a 2nd part to it, as suggested here:

txt_siege_attack_sh() {Attack the enemy.; Enemy is counter-attacking! Smash them quick!;}

I hope this helps,
Logged

"What am I, chopped liver..?"

"Yes."
lockie
Generalfeldmarschall
*****
Posts: 2348



« Reply #6 on: March 15, 2011, 04:44:34 PM »

there should be a 2nd part to it, as suggested here:
txt_siege_attack_sh() {Attack the enemy.; Enemy is counter-attacking! Smash them quick!;}
Yep! Finally, It works. BIG THANKS!
The problem was in the second part of "sh" text. Now, I don't need to add an additional text line anymore Smiley
Logged

Provocative signature removed
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #7 on: March 16, 2011, 08:29:31 AM »

I think these last few posts are worthy of a separate thread.

And for everyone else reading this, I hope it doesn't sound like gibberish to you, these are the nuts and bolts of mission scripting. Smiley
Logged

"What am I, chopped liver..?"

"Yes."
lockie
Generalfeldmarschall
*****
Posts: 2348



« Reply #8 on: March 23, 2011, 06:21:28 PM »

They're supposed to define the vehicle in the platoon, with A, B, C and D being the 1st, 2nd, 3rd & 4th vehicles respectively.

By the way, there's a funny bug in the 'Efficiency of Division' trigger, when it's applied to Grenadier platoons. The game engine only tracks reduction in effectiveness of the 1st vehicle (the command unit).

So the 4 lines I used above, force the game to consider reduction in strength and effectiveness of the entire platoon, using the 'Efficiency of Object' trigger for the individual vehicles/squads in the platoon. 

Hi, Kyth.
I tried er definition of 'Efficiency of Object' vs new parameters and it doesn't work, at least for me.
I placed a division of four 38(t) and created the victory condition. If I shoot all of 'em then I'll win.
Code:
// trigger 'Efficiency of Object' vs params
tr_ger_01, 0x2000f, ger_tnk_01:AA, 2.000;
tr_ger_02, 0x2000f, ger_tnk_01:AB, 2.000;
tr_ger_03, 0x2000f, ger_tnk_01:AC, 2.000;
tr_ger_04, 0x2000f, ger_tnk_01:AD, 2.000;
//victory condition
sov_vic_01, 0x20012, tr_ger_01 & tr_ger_02 & tr_ger_03 & tr_ger_04;
In fact, there's only one trigger works tr_ger_01, which is commander tank(I checked it vs cs_radio text message). All other are useless.
What I did wrong?
Here it is my mission, polygon w07_fedorovka.
http://www.4shared.com/file/_fHbSVfZ/03_ozerki.html
Logged

Provocative signature removed
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #9 on: March 24, 2011, 01:54:08 AM »

That's quite interesting. I'll try it out and let you know,

Its possible that the 'Grenadier Platoon' is tracked in a different way than tank platoons, for losses to effectiveness,  Undecided

I have some ideas about this which I will be trying out. If you have the time, you may want to set the triggers this way:

Quote
// trigger 'Efficiency of Object' vs params
   tr_ger_01, 0x2000f, ger_tnk_01:AA, 2.000;
   tr_ger_02, 0x2000f, ger_tnk_01:BA, 2.000;
   tr_ger_03, 0x2000f, ger_tnk_01:CA, 2.000;
   tr_ger_04, 0x2000f, ger_tnk_01:DA, 2.000;
//victory condition
sov_vic_01, 0x20012, tr_ger_01 & tr_ger_02 & tr_ger_03 & tr_ger_04;


And see what happens?
« Last Edit: March 24, 2011, 02:45:49 AM by Kyth » Logged

"What am I, chopped liver..?"

"Yes."
frinik
Generalfeldmarschall
*****
Posts: 3145


« Reply #10 on: March 24, 2011, 03:51:03 AM »

Hi Kyth,


Any idea how do you tell a particulalr unit to stay in a particular spot and not to move forward no matter how close the enemey unit is?I have tried several tricks including using the "defense" and "Ambush" functions in the ME but they still move forward and in the case of the PanzerJaeger or Marder IIII get killed stupidly by exposing themselves or getting too clse to stronger armoured vehicles .


Thanks

Cheers
Logged
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #11 on: March 24, 2011, 04:42:44 AM »

Hi,

I'm glad you asked  Grin

I've found that it's good to set some 'defense' contours and group them together as a 'position'.
Furthermore, something I recently found out: to get better vehicle behaviour, those defense contours should be single-points, and number of places restricted to one vehicle each.

(I'll dig up an example from the script file later)

By the way, you might enjoy the next mission, soon to come  Wink

One more thing to add, if you already have the tank-destroyers pre-positioned and dug-in, you will want to activate the 'stay in trench' button in the Mission editor.
« Last Edit: March 24, 2011, 05:41:32 AM by Kyth » Logged

"What am I, chopped liver..?"

"Yes."
lockie
Generalfeldmarschall
*****
Posts: 2348



« Reply #12 on: March 24, 2011, 01:34:05 PM »


Code:
// trigger 'Efficiency of Object' vs params
tr_ger_01, 0x2000f, ger_tnk_01:AA, 2.000;
tr_ger_02, 0x2000f, ger_tnk_01:BA, 2.000;
tr_ger_03, 0x2000f, ger_tnk_01:CA, 2.000;
tr_ger_04, 0x2000f, ger_tnk_01:DA, 2.000;
//victory condition
sov_vic_01, 0x20012, tr_ger_01 & tr_ger_02 & tr_ger_03 & tr_ger_04;

And see what happens?

Hats off to Kyth! I’m really impressed, how did u know that?
It works! I’m sure, it’ll never occur to my mind.
Could u please, make an explanations, why scripts works in this way?
As I know symbol “AAA” is provided the unit control and have a place in file common_units.engcfg
i.e.
Code:
//commander  tank Pz.Bef 38(t)( battalion-regiment)
wer_platoon_ltann4,txt_med_platoon_ltann4_wer,%SIDE_GERMAN%,txt_med_gr_ltanks_wer,0,1,AAA,0x1f,tankl,tankl;

where:
first A – means the whole unit (four tanks)
second A – means the commander tank of unit
third A – means the commander virtual place of  commander tank of the whole unit

BA – means second tanks with commander?
« Last Edit: March 24, 2011, 01:43:34 PM by lockie » Logged

Provocative signature removed
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #13 on: March 24, 2011, 01:37:37 PM »

That's quite interesting. I'll try it out and let you know,

Its possible that the 'Grenadier Platoon' is tracked in a different way than tank platoons, for losses to effectiveness,  Undecided


Okay, I think I've cracked it!

Here's how I think it works:

A tank platoon, for example a Panzer III platoon, is defined this way in the 'common_units.engcfg' file:

wer_platoon_mtank1,0,1,wer_mtank,3,,,,,,,,;

This consists of 3 "wer_mtank" sub-groups, which are labelled A, B and C.
Each sub-group has one vehicle, the Panzer III, and they're labelled as AA, BA and CA respectively.

An infantry platoon (for example a platoon of grenadiers) is defined this way in the ''common_units.engcfg' file:

wer_platoon_gren1,0,1,wer_com_gren,1,wer_squad_gren1,3,,,,,,;

The entire platoon is a "subgroup" labelled A.
The vehicles / squads are labelled as AA, AB, AC and AD respectively.

A mixed platoon ( for example 3 Panzer III & Grenadier Platoon) is a combination of the above:

wer_platoon_mtank2,0,1,wer_mtank,3,wer_platoon_gren1,1,,,,,,;
There are 4 subgroups ( 3 'wer_mtank' and 1 'wer_platoon_gren1' ) which are designated as A, B, C and D.

The various vehicles are designated:

AA (1st Panzer III)
BA (2nd Panzer III)
CA (3rd Panzer III)
DA (Sk251/10 & Command squad)
DB (Sk251/1 & 1st Squad)
DC (Sk251/1 & 2nd Squad)
DD (Sk251/1 & 3rd Squad)

The sequence (ABCD) depends on how it's listed in the "common_units.engcfg" entry.

For instance, playing around with the Mixed Platoon example:

wer_platoon_mtank2,0,1,wer_mtank,1,wer_platoon_gren1,1,wer_mtank,2,,,;

The vehicles would be 'numbered' in this sequence:

AA (1st Panzer III)
BA (Sk251/10 & Command squad)
BB (Sk251/1 & 1st Squad)
BC (Sk251/1 & 2nd Squad)
BD (Sk251/1 & 3rd Squad)
CA (2nd Panzer III)
DA (3rd Panzer III)

 Shocked Very interesting...
Logged

"What am I, chopped liver..?"

"Yes."
lockie
Generalfeldmarschall
*****
Posts: 2348



« Reply #14 on: March 24, 2011, 01:50:22 PM »

It's the hell much more interesting!
Thanks for explanations, I'll try to get it over, If I can Cheesy
Logged

Provocative signature removed
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #15 on: March 24, 2011, 01:59:13 PM »

As I know symbol “AAA” is provided the unit control and have a place in file common_units.engcfg
i.e.
Code:
//commander  tank Pz.Bef 38(t)( battalion-regiment)
wer_platoon_ltann4,txt_med_platoon_ltann4_wer,%SIDE_GERMAN%,txt_med_gr_ltanks_wer,0,1,AAA,0x1f,tankl,tankl;

where:
first A – means the whole unit (four tanks)
second A – means the commander tank of unit
third A – means the commander virtual place of  commander tank of the whole unit

BA – means second tanks with commander?

Yes, I thought that way too; it didn't work so well in the Mission Editor.
I now think it's actually slightly different:

AAA

First A - is the first sub-group (which can have multiple vehicles, or just one)
Second A - is the first vehicle in that sub-group
Third A - is the first crew-member in that first vehicle (the commander)

BA for a group of vehicles signifies the 1st vehicle in the 2nd sub-group.
"BAA" would be the commander of the 1st vehicle in the 2nd sub-group.
Logged

"What am I, chopped liver..?"

"Yes."
frinik
Generalfeldmarschall
*****
Posts: 3145


« Reply #16 on: March 24, 2011, 02:41:11 PM »

  Lockie there´s something wrong with your new mission.You said in your post that it´s made with mqpw07 Fedorowska but when I downloaded it it says w03_Ozerki qnd it crashes with the blank 001 screen.Despite the fact that i have the map, the mission enabled in my JSGME , the line i9n the camp_user folder and the datapack file unpacked in my ME?

Please advise?Huh?? Huh?
Logged
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #17 on: March 24, 2011, 03:00:40 PM »

 Cheesy

Had the same problem here, some of those units in that mission (rkka_mspg5 and wer_htank_52) don't exist in the common_units file.

If you want, I can send you my own test mission, which is a rather lame one  Smiley
It's a 'counting sheep' mission, waiting for all your men to reach a certain field and watching the messages.

Edit:

I've taken the liberty of sending you the sheep mission anyway  Cheesy
« Last Edit: March 24, 2011, 03:15:45 PM by Kyth » Logged

"What am I, chopped liver..?"

"Yes."
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #18 on: March 24, 2011, 04:17:04 PM »


Any idea how do you tell a particulalr unit to stay in a particular spot and not to move forward no matter how close the enemey unit is?I have tried several tricks including using the "defense" and "Ambush" functions in the ME but they still move forward and in the case of the PanzerJaeger or Marder IIII get killed stupidly by exposing themselves or getting too clse to stronger armoured vehicles .


Quote
I've found that it's good to set some 'defense' contours and group them together as a 'position'.
Furthermore, something I recently found out: to get better vehicle behaviour, those defense contours should be single-points, and number of places restricted to one vehicle each.

(I'll dig up an example from the script file later)

One more thing to add, if you already have the tank-destroyers pre-positioned and dug-in, you will want to activate the 'stay in trench' button in the Mission editor.

As mentioned, about the earlier enquiry:

If your tanks aren't dug-in, and they're on the move, you'll want to prepare some 'defensive contours' for them, single-point ones, at their destination:


Those 3 contours are grouped into a position, simply called 'hill', in the mission editor.

Viewed in the script file, they're listed as:

cs_positions()
{

   ext, add_trench, 1, def1, -1, 1, hill;
   ext, add_trench, 1, def3, -1, 1, hill;
   ext, add_trench, 1, def2, -1, 1, hill;
}


(the format for each line is ext, add_trench, type ( 0 = infantry 1=vehicle ), contour name, number of positions (-1 = autocalculate), type (again!), defense position name)

To restrict each contour to one vehicle only, edit the block:

cs_positions()
{

   ext, add_trench, 1, def1, 1, 1, hill;
   ext, add_trench, 1, def3, 1, 1, hill;
   ext, add_trench, 1, def2, 1, 1, hill;
}


To use the defensive position, the script for the tank unit has to look like this:

   ext, ai_move, germove2_02b, false, -1, 15;
   ext, ai_defence, hill, 15, 150;


Good luck!
« Last Edit: March 24, 2011, 04:26:07 PM by Kyth » Logged

"What am I, chopped liver..?"

"Yes."
lockie
Generalfeldmarschall
*****
Posts: 2348



« Reply #19 on: March 24, 2011, 06:12:45 PM »

  Lockie there´s something wrong with your new mission.
Oh, well ...
Take the order by Kyth, I'm just a pupil, which want to get a skill Wink
Thanks to master Kyth. He really has a SKILL!
My hat is always - OFF!
***
Sorry for my not good mission, it was just a training to get a knowledge how the triggers did.
« Last Edit: March 24, 2011, 06:20:54 PM by lockie » Logged

Provocative signature removed
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!