Briefing map mysteries

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
rf900
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 339
Joined: Fri May 04, 2012 6:59 am

Briefing map mysteries

Post by rf900 »

I am trying to customize some of these maps taken from the official scenarios, and getting strange behaviour.

I have the SPBMX_map.txt file and the SPBMX_briefing.dds for each of the six missions. Out of the 6 the briefing maps only 2 of them show up, and the code is the same except for the ID in each, is there any other file that has influence in this.

Also for the 2 briefing map that appear the text do not show, I have the reference to the text (SPBM2_text0_S) and then the string (IDS_SPBM2_INTRO_SPBM2_TEXT0) taken from sample scenarios. Is there something wrong in the naming, I tried a few alternatives.

And apart a script question, I want to know when the enemy has detected the player (for example if fire has started) I have taken the code from one of the official scenarios that looks good, but it is not working for me (the move action is correct as I am using it in another part of the code), any ideas as to why or alternatives.

Code: Select all

	for(i=0; i<GetUnitCount(1); i++)
	{
		id = GetUnitID(1, i) ;
		x = GetUnitX(id) ;
		y = GetUnitY(id) ;
		if( (GetUnitDead(id) == 0) && (GetTileLOS(x, y, 0) == 1) )
		{
			ShowUIScreenX("BattleHead0", "Anim1", "IDS_SPBM4_EV2", "BHead0Image:british_infantry_head") ;	
			AddVizCamCenter(18, 50);
			AddVizDelay(20);				
			MoveTeam(1, 0, 0, 16) ;
		}		
	}
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: Briefing map mysteries

Post by pipfromslitherine »

It's hard to tell what you mean regarding the briefings - there are a lot of moving parts to some of it, so it might be simpler if you could upload the campaign and I can take a look.

The scripting looks OK to me - are you sure it is triggering (try putting in a Log command to make sure it is getting through the conditions correctly).

Cheers

Pip
rf900
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 339
Joined: Fri May 04, 2012 6:59 am

Re: Briefing map mysteries

Post by rf900 »

Thanks Pip, discovered a few things after writing the post.

Was missing the ShowBriefing function in some missions. Still I cannot get the text to appear. About the code the log has helped thanks, it is a night mission and has reduced LOS so even after a firefight in the check during the turn the LOS check is 0. Is there any easy way to check there has been a firefight? If not I will do the check in the tick function but I don't want to overload it.

Also is there an easy way to set the number of a squad of men dynamically, lets say to 2 or 3. I am using the destroyunit function several times, but not sure how the mask thing works.

Here is the campaign, if you can help with the blank texts in briefing maps I would appreciate it.

http://personales.ya.com/anyone/Files/SAVPRIV_2.zip
Old_Warrior
Major - Jagdpanther
Major - Jagdpanther
Posts: 1022
Joined: Fri Apr 30, 2010 3:13 am

Re: Briefing map mysteries

Post by Old_Warrior »

This is one of those things where a listing of what is needed to get these maps and text to appear would be helpful. There must be a set of basic code that has to be in place for it to happen.
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: Briefing map mysteries

Post by pipfromslitherine »

OK, after taking a look I can see the issue. It's how you set up the UI files, the text, and the script call. It's a little involved, but I think some misunderstandings also creep in.

Basically there are two ways to do it. The simplest is to just add a line to each of the text objects in the _map.txt UI files with the name of the strings you want to use. E.g. you might want to add the following line to the [SPBM1_text0] object.

string IDS_CAMPAIGN_TEXTa

this is by far the simplest way to get text to show on unique UI items like briefings. In this case it doesn't really matter what you put in as the last item in the set briefing screen call, as this is only used by the text substitution code (explained below).

An alternate way is to the use the text replacement. This works by looking for strings which are named to match up with the UI object they want to be placed on. This is mainly used for reusable UI objects (like the popups used for in battle messages). It works by taking the string passed in by the ShowUIScreen or SetBriefing calls, and appending the names of any text objects in the UI screen to them, so in the case of passing in IDS_CAMPAIGN_TEXTa as happens in the script for the first mission, then the code would look for a string called IDS_CAMPAIGN_TEXTA_SPBM1_TEXT0 to place on the SPBM1_text0 text object.

As I say though, using a single directly named string is probably the best and simplest approach for this kind of one-use briefing.

Hope that helps!

Cheers

Pip
rf900
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 339
Joined: Fri May 04, 2012 6:59 am

Re: Briefing map mysteries

Post by rf900 »

Thanks for the explanation I think I got it.
Post Reply

Return to “Battle Academy : Modders Corner ”