Graviteam
May 06, 2024, 12:27:40 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Mission Objectives, Maps and In-game Messages  (Read 7009 times)
0 Members and 1 Guest are viewing this topic.
Kyth
Generalfeldmarschall
*****
Posts: 2044


« on: August 05, 2013, 06:27:05 AM »


Hi,

Thought I might gather all my random thoughts in one place:

That's great news Kyth and thanks for the positive reviews so far!  Waiting for the tips on the scripting etc?  Smiley

Hi,
Some suggestions:

1. As mentioned by Lockie, it's better for all the in-mission message text to be written to the <mission name>_loc_data.text file.
The mission name, history and quotes (if any) are written to <New name>.text file, in the text folder.
'New name' means, anything other than the existing files such as mis_text.text, which are intended for the stock missions. 

2. Every text string has to be terminated with a semi-colon like this:
Quote
txt_mi_cc02_siege_attack() { Advance and provide fire support\n; }

The text for objectives' on-screen display is normally labelled with a '_sh'. This consists of a short text (for display with the objective icon) and a long text (for the message box):
Quote
txt_mi_cc02_siege_attack_sh() { Fire support; Advance and provide fire support\n; } 


3. Every 'add mission objective' line has the following format:
                    a        b       c                 d                         e
ext, add_misobj, order1, gertigplay, 1, txt_mi_cc02_siege_attack, txt_mi_cc02_siege_attack_sh;


a. Order name. The naming convention is 'order1' followed by 'order2', 'order 3' and so on.
b. Map object name. Something that has to be defined in the 'cs_map()' section.
c. The code number for the 'active' state.
d. Long String to display in the Briefing Screen.
e. Strings to display in the Game Screen. A short text for the icon, followed by a long text for the message box.



4. Every 'add map object' line has the following format:
               1       2           3            4       5             6            7       8       9   10   11
ext, add_mo, map0, attack_rub, 0xc0000080, 0x80202020, 4.0, txt_md_ger_startzone1, 0, startzone1, -1, true, 0;


1. Name of the object, or group of objects. Useful for changing colours, or removing later on.
2. Symbol or sprite name. Refer to table 9.2 for a listing.
3. Symbol colour (0x, alpha, red, green, blue)
4. Text colour (0x, alpha, red, green, blue), if any.
5. Size of the object. At any one size, some symbols are already larger than others, so play around to see what's suitable.
6. Text string for (4), if any.
7. Skew / tilt angle of the symbol in degrees. Ranges from -180 to 180. '0' = symbol follows the map contour heading.
8. Map contour for the placement of the symbol.
9. Contour point number. Default '-1' (not specific). Anyway, try to use one-point contours for placement of symbols.
10. Rotate along with the map, true / false. Flag symbols should always be upright, hence, 'false'. (Flag placement contours should point due north).
11. Offset value for text, left-right.  Default value '0' (centered).


5. To link the Mission orders with an actual map location, the following labels have to share the same name: Section b in the Objective entry, and Section 1 in the Map Object entry.   



The Life Cycle of a Mission Objective

This example is lifted off the 'cs_main()' block of the stock mission, 'ca01_taranovka':

Quote
   a)   ext, add_misobj, order1, taranovka, 1, txt_mi_ca01_siege_taranovka, txt_mi_ca01_siege_taranovka_sh;
   b)   ext, wait_tr, siege2;
   c)   ext, change_mo_cols, taranovka, 0xc0800000, 0xc0800000;
   d)   ext, change_misobj, order1, 3;

Notice the sequence of events:

a) Mission Objective, referred to as 'order1' is assigned. This is linked to the 'taranovka' map object (this appears as a blue flag and oval on the briefing map, and a light-blue square icon in the game screen). The objective is given the status of '1' or 'active'.

b) The game waits for a trigger to be activated. In this case, the trigger is 'siege2', which is a 'superiority of allies in a contour' trigger. 'Siege2' is set to activate when your friendlies achieve a force superiority of 2x in the area of Taranovka village.

c) The game then changes the colour of the 'taranovka' map object to red. This is purely optional, but it is useful if you want the change of control to be displayed on the briefing map.

d) The game also changes the state of 'order1' to '3', or 'completed'.

After this line, you may want to add on a 2nd objective, say 'order2'. To make sense from the player's POV, any subsequent Mission Objectives also need to flow the same way, a) to d).
Usually, the last Mission Objective will also be a Victory condition, i.e. to bring the Mission to a successful conclusion.



@Kyth, many thanks for all that very useful info you supplied, very clear and easy to follow.  One question though, at the very bottom of your post in number 5. you mention:

"5. To link the Mission orders with an actual map location, the following labels have to share the same name: Section b in the Objective entry, and Section 1 in the Map Object entry."

So, does this mean to link the in-mission orders to the map location objects the 2 lines would look like this:

ext, add_misobj, order1, gertigplay, 1, txt_mi_cc02_siege_attack, txt_mi_cc02_siege_attack_sh;

ext, add_mo, gertigplay, attack_rub, 0xc0000080, 0x80202020, 4.0, txt_md_ger_startzone1, 0, startzone1, -1, true, 0;


Huh?

Yes that would work, but it would be more logical to have 'gertigplay' located in one of the objective locations, instead of the starting position.

Hi,

As a general point on mission-making and cs_radio blocks, I use each one for a sequence of events,

ie. Trigger 1, followed by Message 1, then an interval or wait for another trigger, then Message 2, then another interval or trigger, then Message 3, and so on.

The problem with the above is that Message 2 must follow Message 1.  Message 3 must follow Messages 1 and 2, like a railroad.

If you have a lot of different messages to trigger off, this could be a problem since they don't always follow one after the other.
You can get around this restriction by using multiple blocks, and have several tracks running in parallel:

cs_radio1 : Trigger 1, followed by Message 1, then an interval or wait for another trigger, then Message 2, then another interval or trigger, then Message 3, and so on.
cs_radio2 : Trigger a, followed by Message a, then an interval or wait for another trigger, then Message b, then another interval or trigger, then Message c, and so on.
cs_radio3 : Trigger x, followed by Message x, then an interval or wait for another trigger, then Message y, then another interval or trigger, then Message z, and so on.

Try not to have too many unnecessary parallel tracks running at the same time, I suspect it may slow down the game,

ps. The same principle applies to 'cs_main' and 'cs_map'.

I am just trying to insert the squarish colored waypoint or position markers (your suggestion) and am having a problem getting them to show up. I've been trying to duplicate the map object from a simple single mission of YL's.

 What I have done is create a couple single contours in a test mission and named them: The_proposed_site and Village. I then copied into my loc_data.text

loc_rus()
{

txt_ldm_text1() { The proposed site; }
txt_ldm_text2() { Village; }

}

In my scripts file I copied what I think are the related lines:

cs_main()
{
              ext, sel_waypoint, The_proposed_site, 0xff00a040, txt_ldm_text1, 0;
              ext, sel_waypoint, Village, 0xff00a040,txt_ldm_text2, 0;
}
 
Kyth, can you please advise me what's missing here?

Thanks
H



Try renaming the contours and their references without caps: 'the_proposed_site' and 'village'.
They should show up in the game when you press the '+' key,

Kyth
 No joy! I changed the single contour to lower case, changed the file below to lower case and nothing happens. I should mention that I changed the contour in the Outlines>Maps section as I've seen others do. I can't see how this should make a difference.

cs_main()
{
              ext, sel_waypoint, the_proposed_site, 0xff00a040, txt_ldm_text1, 0;
              ext, sel_waypoint, village, 0xff00a040,txt_ldm_text2, 0;
}
 
I've gone over this backwards and forwards and can't figure it out, as before the answer is usually very simple.

Thanks
H

Hi,

I'd like to clarify that the waypoints aren't objects on the Briefing map, they're actually seen in the game itself.
They're visible as little square, green icons and you can use the '\' key to get them to show up, and '+' key to run through each one.


One more thing that comes to mind: Your other text entries in the loc_data text file are under 'loc_eng()'. So its best to group your waypoint texts under 'loc_eng()' as well.

Remember, its either 'loc_rus()' or 'loc_eng()', but not both.

One final thing (actually the main thing):

Make sure your waypoint entries appear after the briefing and 'nop;' lines.

For example:

Quote

cs_main()
{
              ext, add_misobj, brief, start, 4, txt_brief_shamonin, txt_mis_order;
              nop;
              ext, sel_waypoint, the_proposed_site, 0xff00a040, txt_ldm_text1, 0;
              ext, sel_waypoint, village, 0xff00a040,txt_ldm_text2, 0;
}
 

Logged

"What am I, chopped liver..?"

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



« Reply #1 on: August 05, 2013, 06:11:02 PM »

It's too complicate for me  Grin Cheesy Wink
Logged

Provocative signature removed
fabianfred
Oberstleutnant
*****
Posts: 124


« Reply #2 on: August 05, 2013, 09:43:59 PM »

It's too complicate for me  Grin Cheesy Wink

a bit hard for me to follow too.
The problem is that when we know how to do something...it is simple. To be able to put yourself in the mind of a beginner who doesn't know. and then try to explain simply, is the mark of a good teacher. This is why teaching is so difficult.
Logged
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #3 on: August 06, 2013, 01:28:10 AM »

I should mention, the posting above is for advanced users.
This assumes that you have gone through the Mission-making tutorial / videos, and have followed along with the 'ME Question' thread below. It's better to be familiar with the basics, first, before moving on.

By the way, one quick way of learning is to 'reverse engineer' the scripting of the stock missions. There's plenty of information to be gained that way,
Logged

"What am I, chopped liver..?"

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


« Reply #4 on: August 06, 2013, 04:23:28 AM »


Having said all that, perhaps I could address specific questions on the topic, point by point?
Logged

"What am I, chopped liver..?"

"Yes."
fabianfred
Oberstleutnant
*****
Posts: 124


« Reply #5 on: August 06, 2013, 05:18:00 AM »

OK ...tell me in simple terms how to put those big arrows upon the mission map...to tell people the direction to advance or attack.
Logged
Kyth
Generalfeldmarschall
*****
Posts: 2044


« Reply #6 on: August 06, 2013, 06:59:49 AM »

OK ...tell me in simple terms how to put those big arrows upon the mission map...to tell people the direction to advance or attack.

Sure thing.

1. Perusing the Editor Manual (Table 9.2), the arrow symbol is labelled 'attack_dir'. That's crucial,

2. You need to decide the size and colour of the arrow. For instance, a blue arrow, reasonably large as in one of the stock missions - i.e. a size of '4'.

3. In the Mission Editor, you'll have to place a contour on the map. Preferably a pinpoint location. You could name it, say, 'big_blue_arrow'. This will determine where the arrow appears on the briefing map.

4. You might want the arrow pointing, say, east by northeast. The heading in degrees could then be '67'.

5. You want to assign the arrow a recognizable name, for instance, 'first_one'.

Plug in all the needed information in the cs_map() block as an 'add map object' entry:

cs_map()
{

ext, add_mo, first_one, attack_dir, 0xc0000080, , 4.0, , 67, big_blue_arrow, -1, true, 0;

}
Logged

"What am I, chopped liver..?"

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



« Reply #7 on: August 06, 2013, 09:16:16 AM »

As for briefing, it's still a bit hard for me. That's why I'm using as more simple procedure as posibble.
i.e. from the mission `river of doom`
Quote
   ext, add_misobj, map_usr, fonar, 4, txt_ldm_brief_doom, txt_ntlx_order;
   nop;
I don't know what does map_usr, fonar it's just a fake. More important txt_ldm_brief_doom. It must be placed in the txt file on the way:
...\data\k42\loc_rus\levels\levels\SCRIPTS\cm_users\My_tank_mission_loc_data.text
and content of this file should look like this:
Quote
loc_rus()
{
//My mission "Big TANK forevar!" PZ VI H
txt_ldm_brief_doom()
{
Shoot every tank what you can shoot!;
}

}
And this phrase u'll see each time before mission starting Smiley
« Last Edit: August 06, 2013, 09:23:09 AM by lockie » Logged

Provocative signature removed
fabianfred
Oberstleutnant
*****
Posts: 124


« Reply #8 on: August 06, 2013, 09:41:20 AM »

hey...it works...thanks  Grin
Logged
lockie
Generalfeldmarschall
*****
Posts: 2348



« Reply #9 on: August 06, 2013, 11:53:04 AM »

Next step u should place a waypoint where user go to. It's a square icon(usually yellow color) for the orienter of the direction with short description. i.e. mission `river of doom`there is first icon(waypoint) is `Bridge`.
In our case
Quote
   ext, add_misobj, map_usr, fonar, 4, txt_ldm_brief_doom, txt_ntlx_order;
   nop;
   ext, sel_waypoint, map_bridge, 0xff8dc040, map_txt_bridge, 0;
map_bridge is important point. U've to place it on the map in the editor. Usually, it's a layer `Map` with yellow color. Place it and name somehow, let it be `map_tank_point`. Remember the name or have a look the name in the file
...\data\k42\loc_rus\levels\levels\SCRIPTS\cm_user\My_tank_mission_zones.engcfg
In your case it'll be:
Quote
ext, sel_waypoint, map_tank_point, 0xff8dc040, map_txt_bridge, 0;
Then, if u want u can add a short description to the waypoint, i.e. `A BIG TANK`.
Then here is a name, which u can use it map_txt_bridge or whatever (map_txt_mybigtank). Place it in the file
...\data\k42\loc_rus\levels\levels\SCRIPTS\cm_users\My_tank_mission_loc_data.text
Finally:
Quote
loc_rus()
{
//Briefing
//My mission "Big TANK forevar!" PZ VI H
txt_ldm_brief_doom()
{
Shoot every tank what you can shoot!;
}

//waypoints/map
   map_txt_mybigtank()    {A BIG TANK;}




}
« Last Edit: August 06, 2013, 04:07:34 PM by lockie » Logged

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


« Reply #10 on: August 06, 2013, 12:45:43 PM »

hey...it works...thanks  Grin

I'm glad to help. Having acquired new skills or abilities, it's a good thing to test them out in practice.

With that in mind, I recall a fun quiz I came up with in an earlier time:

http://graviteam.com/forum/index.php?topic=10478.msg24538#msg24538

The question should be a piece of cake, since I've already supplied part of the answer (yes, the colorful one).  Grin
Logged

"What am I, chopped liver..?"

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


« Reply #11 on: August 07, 2013, 04:05:16 AM »


Well this has all been very useful and worthwhile,

If we're done here, let's call it a day (I know I will).
Logged

"What am I, chopped liver..?"

"Yes."
Pages: [1]
  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!