Questions: CampaignVars, empty messages, WIN_SCENARIO_CALLBA

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

Questions: CampaignVars, empty messages, WIN_SCENARIO_CALLBA

Post by rf900 »

Hi

I am bit stuck with my current campaign, need some help with this:

I am trying to use campaign vars but cannot find any example, declared then in CAMPAIGN.TXT (VAR maxcarrymis1;) and then using them SetCampaignVar(maxcarrymis1,10); gives an error saying it does not exist or something similar.

Also I try to display messages ingame but they appear empty, ShowUIScreenY( "BattleHead0", "Anim1", "IDS_SPBM1_END"); Those are texts that are defined and even appear in the scenario selection screen.

And the last, calling MenLeftInUnit inside FUNCTION WIN_SCENARIO_CALLBACK(winner) throws an error, maybe at that point units are already unloaded from the map?

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

Re: Questions: CampaignVars, empty messages, WIN_SCENARIO_CA

Post by rf900 »

Forget the last one, wasn't including Tools.bsf in the scenario script. :roll:
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: Questions: CampaignVars, empty messages, WIN_SCENARIO_CA

Post by pipfromslitherine »

You need to make the SetCampaignVar("maxcarrymis1", 10) - it is a string argument.

The popup UI stuff is a little fiddly. Basically there is an object in the UI battlehead0.txt file called BHEAD0TEXT. To show a string on it, you need to name the string

IDS_SPBM1_END_BHEAD0TEXT, "this is the string text",

This is how the system knows where to put text (e.g. if you had a popup with multiple text boxes).

MenLeftInUnit is probably defined in tools.bsf - are you including the file? You can find it by using Find in Files for FUNCTION MenLeftInUnit

Cheers

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

Re: Questions: CampaignVars, empty messages, WIN_SCENARIO_CA

Post by rf900 »

Thanks a lot pip I was so stuck.
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: Questions: CampaignVars, empty messages, WIN_SCENARIO_CA

Post by pipfromslitherine »

np - there is such a lot of stuff you can do, it is pretty easy to find things I have failed to document...

I will try and add these things to the online docs if I can stay awake for long enough today :)

Cheers

Pip
Post Reply

Return to “Battle Academy : Modders Corner ”