side1 reinforcements script

Post Reply
ur1
Lance Corporal - SdKfz 222
Lance Corporal - SdKfz 222
Posts: 21
Joined: Fri Feb 10, 2017 7:28 pm

side1 reinforcements script

Post by ur1 »

I have created a BSF.file for a map.Reinforcements for sw arrive without problems. But when I export the file in the editor for side 1.The file "reinforcements.bsf" appears only the turn they should arrive. But no text between brackets.What should I write in that space?And what should I do to switch sides in a script?
Is the only thing I lack for my maps to work correctly to a level acceptable to me. 've made my first script and if that works I'm already satisfied for now :)

Sorry for my english. Thanks!!
Mophead
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 59
Joined: Sun Jan 29, 2017 7:23 pm

Re: side1 reinforcements script

Post by Mophead »

I made two reinforcement groups on a new map. I exported a Reinforcemnt.BSF for each group.

After exporting the files, I deleted the reinforcement units from the map, the script will place them, and saved the map.

In the SANCTUS folder I now have two Reinforcemnt.BSF files:
Reinforcement0.BSF
Reinforcement1.BSF

Code: Select all

// Reinforcement0.BSF 

include "Functions.BSF"
include "Helpers.BSF"

FUNCTION StartTurn(side)
{
int id

	// ...

	// Autogenerated script for reinforcement group 1 on side 0 - Paste this code into your StartTurn function:
	if (GetTurn() == 2)
	{
		PlaceUnit(17, 24, 2, 0, 0, "GREY_HUNTER_BOLTER1")
		AddVizFunctionCall("GetHeadImage", 0, "BP0Image:", 13)
		ShowUIScreenToSide("BattlePop0", "Anim1", "IDS_AUTO_REINF_0", GetWorkString(13), 0)
		PlaceUnit(18, 25, 2, 0, 0, "GREY_HUNTER_FLAMER3")
		PlaceUnit(17, 26, 2, 0, 0, "BLOOD_CLAWS")
		PlaceUnit(18, 23, 2, 0, 0, "BLOOD_CLAWS")
	}

	// ...

}

Code: Select all

//  Reinforcement1.BSF 
include "Functions.BSF"
include "Helpers.BSF"

FUNCTION StartTurn(side)
{
int id

	// ...

	// Autogenerated script for reinforcement group 2 on side 0 - Paste this code into your StartTurn function:
	if (GetTurn() == 4)
	{
		PlaceUnit(34, 33, 5, 0, 0, "LANDSPEEDER")
		AddVizFunctionCall("GetHeadImage", 0, "BP0Image:", 13)
		ShowUIScreenToSide("BattlePop0", "Anim1", "IDS_AUTO_REINF_1", GetWorkString(13), 0)
		PlaceUnit(33, 34, 5, 0, 0, "LANDSPEEDER")
		PlaceUnit(32, 32, 5, 0, 0, "LANDSPEEDER")
	}

	// ...

}
Assuming no other custom scripting at this point, these will become the Scenario.BSF file. in:
_\SANCTUS\CAMPAIGNS\CUSTOMCAMPAIGN\SCENARIOS

Code: Select all

//Scenario.BSF
include "Functions.BSF"
include "Helpers.BSF"

FUNCTION StartTurn(side)
{
int id

	if (GetTurn() == 2)
	{
		PlaceUnit(17, 24, 2, 0, 0, "GREY_HUNTER_BOLTER1")
		AddVizFunctionCall("GetHeadImage", 0, "BP0Image:", 13)
		ShowUIScreenToSide("BattlePop0", "Anim1", "IDS_AUTO_REINF_0", GetWorkString(13), 0)
		PlaceUnit(18, 25, 2, 0, 0, "GREY_HUNTER_FLAMER3")
		PlaceUnit(17, 26, 2, 0, 0, "BLOOD_CLAWS")
		PlaceUnit(18, 23, 2, 0, 0, "BLOOD_CLAWS")
	}
	if (GetTurn() == 4)
	{
		PlaceUnit(34, 33, 5, 0, 0, "LANDSPEEDER")
		AddVizFunctionCall("GetHeadImage", 0, "BP0Image:", 13)
		ShowUIScreenToSide("BattlePop0", "Anim1", "IDS_AUTO_REINF_1", GetWorkString(13), 0)
		PlaceUnit(33, 34, 5, 0, 0, "LANDSPEEDER")
		PlaceUnit(32, 32, 5, 0, 0, "LANDSPEEDER")
	}
}
Scenario.BSF and Scenario.BAM should have matching names.
ur1
Lance Corporal - SdKfz 222
Lance Corporal - SdKfz 222
Posts: 21
Joined: Fri Feb 10, 2017 7:28 pm

Re: side1 reinforcements script

Post by ur1 »

No problem with the Side "0" "space wolves". The problem happens when I create the reinforcements for side 1.
reinforcements.bsf:



include "Functions.BSF"
include "Helpers.BSF"

FUNCTION StartTurn(side)
{
int id

// ...

// Autogenerated script for reinforcement group 7 on side 1 - Paste this code into your StartTurn function:
if (GetTurn() == 25)
{
}

// ...

}
It's empty and I have doubts about filling it. And how to change sides in the same script
ur1
Lance Corporal - SdKfz 222
Lance Corporal - SdKfz 222
Posts: 21
Joined: Fri Feb 10, 2017 7:28 pm

Re: side1 reinforcements script

Post by ur1 »

The error was in not deleting the units in the editor. The reinforcements on th "0" side did not give me that problem by not deleting them from the map.From there my mistake.Now the information appears in reinforcements.BSF.
I can already enter the text in" My map.BSF".I do not know if I have to change sides or just put the information on their corresponding turn.
I am going to try


thanks for answering!
Mophead
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 59
Joined: Sun Jan 29, 2017 7:23 pm

Re: side1 reinforcements script

Post by Mophead »

Each group needs a reinforcement .bsf file exported from the editor.

Orks (Goffs) are Side 1 and the Space Wolves are side 0.

I am not sure if the reinforcement groups are unique or not; can Side 1 and Side 0 both have a Group 1?

I'd say have unique group numbering for Side 1 and Side 0: Only one Group 1 for either Side 1 or Side 0, only one Group 2 for either Side 1 or Side 0, only one Group 3 for either Side 1 or Side 0, and so on.

The StartTurn Function runs at the start of every turn.
http://archonwiki.slitherine.com/index. ... #StartTurn
-1 : This is a pre-turn called when a scenario is first begun
0 : First turn for side 0
1 : First turn for side 1
2 : Second turn for side 0
3 : Second turn for side 1
4 : etc
ur1
Lance Corporal - SdKfz 222
Lance Corporal - SdKfz 222
Posts: 21
Joined: Fri Feb 10, 2017 7:28 pm

Re: side1 reinforcements script

Post by ur1 »

I think 7 groups are allowed on each side.And can repeat numbering.
I entered the information on the correct turn in the " mymap.BSF" file.And the map works perfectly.
It is also important that the tile where the reinforcements arrive is empty on that turn.Or reinforcements will not appear.
Next stop.abilities
thanks for the help!
Mophead
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 59
Joined: Sun Jan 29, 2017 7:23 pm

Re: side1 reinforcements script

Post by Mophead »

Not sure about Orks.

Code: Select all

		for(i=0; i<GetUnitCount(1); i++)
		{
			id = GetUnitID(0, i) ;
			SetupStartAbilities(id, 0);
		}

Code: Select all

		id = PlaceUnit(25, 32, 2, 0, 0, "IMPERIAL_FIST_ASSAULT")
		SetupStartAbilities(id, 0)
		id = PlaceUnit(24, 33, 2, 0, 0, "RED_WOLVES_FLAMER")
		SetupStartAbilities(id, 0)
		id = PlaceUnit(24, 36, 2, 0, 0, "DARK_ANGEL_BOLTER")
		SetupStartAbilities(id, 0)
		id = PlaceUnit(25, 36, 2, 0, 0, "IMPERIAL_FIST_ASSAULT")
		SetupStartAbilities(id, 0)
The loop works at the start, I avoided SetupStartAbilities(id, 0) running on the same unit more than once.

Both snippets are in the StartTurn(side) function, in the turn conditional.

Sanctus_Wolves_Abilities.txt in your campaign folder (with Campaign.txt).

Copy:
_\Warhammer 40000 Sanctus Reach\Data\scripts\CombatTools.BSF
Paste & create path (folders) if needed:
_\SANCTUS\CAMPAIGNS\CUSTOMCAMPAIGN\DATA\SCRIPTS\CombatTools.BSF

Copy:
_\Warhammer 40000 Sanctus Reach\Data\Battle\Scripts\AbilityHelpers.BSF
Paste & create path (folders) if needed:
_\SANCTUS\CAMPAIGNS\THREEVISIONSv3\DATA\BATTLE\SCRIPTS\AbilityHelpers.BSF


Open these new .BSF files and remove the "#" *all instances of "#", as:
this example:
FromFileOpen("#Sanctus_Wolves_Abilities")
would become:
FromFileOpen("Sanctus_Wolves_Abilities")

I think that works [is all that is needed].

You can make new units and set XP required to -1 so they auto-level. Campaign XP seems to be in one of the Campaign2.bsf files, see the given campaigns.

The Sanctus_Wolves_Abilities.txt file can also just be edited in your campaign folder and changed so

[UNIT]
LEVEL2 1 2 3 5 7 9 10 12 15 20 21 28 29 30 31 46
LEVEL3 1 2 3 5 6 7 8 9 10 11 12 13 15 16 18 19 20 21 22 28 29 30 31 46 47 48
LEVEL4 1 2 3 5 6 7 8 9 10 11 12 13 15 16 18 19 20 21 22 28 29 30 31 32 46 47 48

Gives random ability on level up
---

[UNIT]
LEVEL2 3
LEVEL3 12
LEVEL4 32

Gives fixed ability on level up
---

[UNIT]
START2 3
START3 5
START4 9
START5 10
START6 25
START7 32
Gives fixed abilities at start
---

see:
_\Warhammer 40000 Sanctus Reach\Data\Battle\Scripts\Abilities.BSF
For the ability numbering.

edit: I saw in the tooltip that it is eight reinforcement groups; 0-7
AI groups could be the same
SgtBootStrap
Lance Corporal - SdKfz 222
Lance Corporal - SdKfz 222
Posts: 23
Joined: Tue Dec 13, 2016 6:31 pm

Re: side1 reinforcements script

Post by SgtBootStrap »

ur1 wrote:I think 7 groups are allowed on each side.And can repeat numbering.
I entered the information on the correct turn in the " mymap.BSF" file.And the map works perfectly.
It is also important that the tile where the reinforcements arrive is empty on that turn.Or reinforcements will not appear.
Next stop.abilities
thanks for the help!
So did you get the Side 1 Reinforce Text to pop up in Mission using the mymap.bsf? I was using the Text9.txt file that is auto generated upon export from the Reinforce Tool but it seemed to stop adding entries at 3 lines but I think that is due to the fact that when it reads the first Side 1 line, it just stops.
If true(again guessing) and I will Test, I can just add 8 (0,7) reinforcement entries manually and have a quasi narration coming from Side0 as Side1 enters the Map. Side0 has some very good Scouting apparently. LOL! ;)

Anyways, I am pretty noob at all this, and totally going about it all wrong, in my rush for March1, but I figured(guessing) that the text9.txt file was just for the Side 0 (or perhaps just any 1 side with no mixing allowed) incoming Text, which is great,

but if the mymap.bsf allows Side 1 text to also appear that would be spectacular. I have not modded/created a Map since the original MechCommander. :)
Mophead
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 59
Joined: Sun Jan 29, 2017 7:23 pm

Re: side1 reinforcements script

Post by Mophead »

Anyone figure out how to set the Battle popup image? I put icons in the campaign folder as shown in the file-tree wiki example.

AddVizFunctionCall("GetHeadImage", 0, "BP0Image:", 13)
ShowUIScreenToSide("BattlePop0", "Anim1", "IDS_AUTO_REINF_0", GetWorkString(13), 0)

Does the BattlePop0 match IDS_AUTO_REINF_0_BP0TEXT without the reinforcement editor tool, or is there something in the .BAM setting this up within the game directory?
pipfromslitherine
Site Admin
Site Admin
Posts: 9702
Joined: Wed Mar 23, 2005 10:35 pm

Re: side1 reinforcements script

Post by pipfromslitherine »

You are putting a function call into the vizq and then trying to use the result immediately, when the function isn't going to be called until later (when it gets to the point in the queue). If you want to result immediately then just call the function, otherwise you need to put a vizq command into the queue to show the screen (or just a single AddVizFunctionCall to a function containing everything you want to do).

Cheers

Pip
follow me on Twitter here
Mophead
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 59
Joined: Sun Jan 29, 2017 7:23 pm

Re: side1 reinforcements script

Post by Mophead »

That is output from the Reinforcemnts0.BSF the Editor generates when you add text to a reinforcement group, and then export that with the Advanced option in the Reinforcement Tool Window.

In-game the pop-up has the "no image" default where it looks like it would take a unit icon from:
_\Warhammer 40000 Sanctus Reach\Data\UI\Textures\Icons

How to set that image? Did I miss something obvious in the editor?

Do I need to use:
//Set the current UI object which is being rendered to the texture and colour (colour is a hex string). Do not use the file extension.
SetUITexture(filename, colour)

http://archonwiki.slitherine.com/index. ... ur_Strings

And there is:
//add a display of text to the tile center, in the colour (colour is a string hex value). alwaysShow means show even if tile is not visible to viewing side
AddVizText(x, y, text, colour, [alwaysShow])

If you just wanted text popup on a given turn. I don't understand how to set all that up though.
pipfromslitherine
Site Admin
Site Admin
Posts: 9702
Joined: Wed Mar 23, 2005 10:35 pm

Re: side1 reinforcements script

Post by pipfromslitherine »

To change the icon you put an encoded string into the imageTags in a call to:

//show the UI object screen, setting up with text of the form textTag_objName for each object. Image tags are 1 or more obj:file pairs seperated by a $
ShowUIScreen(screenName, animName, textTag, [imageTags])

e.g. using "BP0Image:sideicon0" tries to set the texture on the UI object BP0Image to sideicon0.tga (or .dds).

Cheers

Pip
follow me on Twitter here
Mophead
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 59
Joined: Sun Jan 29, 2017 7:23 pm

Re: side1 reinforcements script

Post by Mophead »

pipfromslitherine wrote:To change the icon you put an encoded string into the imageTags in a call to:

//show the UI object screen, setting up with text of the form textTag_objName for each object. Image tags are 1 or more obj:file pairs seperated by a $
ShowUIScreen(screenName, animName, textTag, [imageTags])
That is what the first part does, I think:

Code: Select all

ShowUIScreenToSide("BattlePop0", "Anim1", "IDS_AUTO_REINF_0", GetWorkString(13), 0)
Your version would show both sides. Good for changing the banner icon. That's why I'm a little confused.

UnitIcon0.dds is the banner icons for the Space Wolves, UnitIcon1.dds for the Orks.

I'm trying to use the portrait .dds icons from:
_\Warhammer 40000 Sanctus Reach\Data\UI\Textures\Icons

I think:

Code: Select all

AddVizFunctionCall("GetHeadImage", 0, "BP0Image:UNITICON0", 13)
...sets up a workstring, or I need to setup the workstring, with the BP0Image substitution.

Am I to add, in Text9.txt:
IDS_AUTO_REINF_0_BP0IMAGE, "BP0Image",

"setting up with text of the form textTag_objName for each object"
?

I renamed the the .dds file and tried it in the campaign main and also CampaignMain\DATA\UI\TEXTURES\ICONS\droppod.dds

Basically variations on this:

Code: Select all

		AddVizAnim(id, "LAND", 255)
		AddVizFunctionCall("GetHeadImage", 0, "BP0Image:UNITICON0", 13)
		ShowUIScreenToSide("BattlePop0", "Anim1", "IDS_AUTO_REINF_0", GetWorkString(13), 0)
		// ShowUIScreen("BattlePop0", "Anim1", "IDS_AUTO_REINF_0", "GetHeadImage")
The last line, swapped active, for the second-to-last line gives the Orks a Turn or makes "Enemy Turn" active while the popup is shown.
Mophead
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 59
Joined: Sun Jan 29, 2017 7:23 pm

Re: side1 reinforcements script

Post by Mophead »

It seems to have something to do with DATA\UI\BattlePop0.txt though I haven't gotten any image to load. The Tutorial campaign had this.

EDIT:
I added the image I wanted to:
MYCAMPAIGN\DATA\UI\TEXTURES

and renamed it:
British_tanker_head.TGA

It works!

I'm doing something wrong trying to swap it in the BP0Image:NewImage line or it doesn't work.

Anyone got it to work?
pipfromslitherine
Site Admin
Site Admin
Posts: 9702
Joined: Wed Mar 23, 2005 10:35 pm

Re: side1 reinforcements script

Post by pipfromslitherine »

The texture does indeed need to be in UI/TEXTURES (either the campaign or main install folder). The string BP0Image:UNITICON0 for example tries to apply UNITICON0.DDS (or .TGA) to the BP0Image UI control.

Cheers

Pip
follow me on Twitter here
Post Reply

Return to “Sanctus Reach Mods and Scenario Design”