[Mod Restart] All Space Marine and Chaos Marine Chapters

Post Reply
Aekar
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Thu Nov 27, 2014 10:29 am

[Mod Restart] All Space Marine and Chaos Marine Chapters

Post by Aekar » Fri Jun 29, 2018 3:50 pm

Today I restarted work on this mod.
I work on this mod for Armaggeddon, to deepen my knowledge of W40K units and codexes.
And on an unannounced total conversion of Sanctus Reach to practice Archon Engine.
Both should helpfully help me deliver.


While you have the objective of this mod in the title - to release all Space Marine and Chaos legions - the summary is:

a) to allow the player to choose to play any of the 10 loyal legions/chapters in a UI
b) to allow the player to pick a company to play from this chapter, and commit it to battle
c) then to just play this setup in carry-over campaigns, with a repeating semi-randomized scenario, or simple handcrafted scenarios.


Current status:
New UI with Chapter Selection - OK


Image

New Army Lists - In progress
Carryover campaign - In progress

I won't detail the objective any longer.
Instead I will focus during this thread on a step by step progress and your feedback.



Step One - Campaign and custom data


My first step was to get familiar again with campaign contents and variables.

Last year I worked with Squads.csv and had difficulties extending the number of squad units and attributes.
Now I want to "flank" these issues by using the persistent custom variables we have access to.

We have access to 64 campaign variables, but these can be arrays of length 8, so we have access to 512 persistent variables.
Today I'll try to:
- use these variables,
- customize them when launching the campaign,
- store there the profile of the selected new units and chapters.


Question #1 (to devs or people who can help):

on this page ( http://archonwiki.slitherine.com/index.php/Modding ) we see that a callback function is available (FUNCTION INIT_CAMPAIGN) when a new campaign is loaded or started.
However I would need a callback like that, which only works when a NEW campaign is launched, not when I reload it.
I can check that we are in the first mission but that would not be enough.

Are there other campaign callback functions available, and is there one for that?
Last edited by Aekar on Wed Jul 11, 2018 8:47 pm, edited 9 times in total.

pipfromslitherine
Site Admin
Site Admin
Posts: 9248
Joined: Wed Mar 23, 2005 10:35 pm

Re: [Mod Restart] All Space Marine and Chaos Marine Chapters

Post by pipfromslitherine » Fri Jun 29, 2018 4:35 pm

You should avoid using Campaign variables, globals are a far better choice for storing persistent data, and there is no real limit to the data you can store. All globals default to zero, so you can just check some 'have I initialised' value and set everything up based on that.

Cheers

Pip
follow me on Twitter here

Parallax
Twitch Fidelity Award 2017
Twitch Fidelity Award 2017
Posts: 167
Joined: Thu Jun 04, 2015 12:22 am

Re: [Mod Restart] All Space Marine and Chaos Marine Chapters

Post by Parallax » Fri Jun 29, 2018 6:08 pm

Good luck, Aekar :)

Aekar
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Thu Nov 27, 2014 10:29 am

Re: [Mod Restart] All Space Marine and Chaos Marine Chapters

Post by Aekar » Fri Jun 29, 2018 9:06 pm

Thanks Parallax!
I suppose that's what we say before heading into the Eye of Terror :D
But Pip is here to guide me through the Warp. :D

By the way thanks Pip, you redirected me the right way.
And just in time.


Step Two - Display new UI to pick our chapter


I must now display the ListBox to allow the player to pick a new chapter.

- I know I must create a text file in DATA/UI
- I can use example files from the original game
- I know I can use textures I see from DATA/UI/TEXTURES
- I know I can link a BSF (script) file to my TXT file describing the UI, as shown for instance in the BATTLECOMMON.TXT / BSF files.

The rest is a gray area to me.

Question #2:

How to trigger my UI from a given scenario or campaign?
I have a Campaign.BSF script, but only two callback functions.
I can also use a scenario script but the way to call my "WonderfulListBox" UI object from there escapes me.

Suppose I have a "WonderfulListBox.TXT" file and its BSF script in DATA/UI.

There is this that I extracted from AUTODOCS among all the available things with "UI" in it:
ShowUIScreen(screenName, animName, textTag, [imageTags])
But I would not know if I should put my text file name as "screenName", etc.
It lacks examples I think. :p
Last edited by Aekar on Fri Jun 29, 2018 9:13 pm, edited 2 times in total.

Aekar
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Thu Nov 27, 2014 10:29 am

Re: [Mod Restart] All Space Marine and Chaos Marine Chapters

Post by Aekar » Fri Jun 29, 2018 9:11 pm

... I found a few occurrences using ShowUIScreen in the original game.
In Helpers.BSF for instance.
// show the info UI popup
ShowUIScreen("UnitInfoPopup", "anim", "dummy") ;
It would seem I have my answer there - I can use the TXT file name right away - but maybe you have the insight to tell me if I am making things the bad way.
Going on with that for now!

Aekar
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Thu Nov 27, 2014 10:29 am

Re: [Mod Restart] All Space Marine and Chaos Marine Chapters

Post by Aekar » Sun Jul 01, 2018 6:09 pm

I need some advice on textures.
LISTBOX documentation on the wiki( http://archonwiki.slitherine.com/index.php/UI ) says about the LISTBOX object:
CONTROLTEX <filename>
Required, contains all the various listbox controls. The texture is laid out as follows:
Up scroll arrow - top left
Down scroll arrow - top right
Scrollbar - bottom left (this is stretched to the height of the listbox)
Scroll nub - bottom right

FRAMETEX <filename> - used for the listbox frame
SELTEX <filename> - selection display, this is stretched across the width of the selection box
BUTTONTEX <filename> - applied to element in the listbox, texture layout is the same as a BUTTON type

TEXTLEFT <value>
TEXTTOP <value>
TEXTWIDTH <value>
TEXTHEIGHT <value>
Screen placement values for the actual text list, absolute if list is placed absolutely, relative to list if object is placed relatively

FONT <fontname> - the font of the listbox item text
COLOUR <colour> - the colour of the listbox item text.
BARSIZE <value> - Sets the size of the scrollbar. Default value is 32.
ITEMSPACING <value> - spacing between listbox items (vertical or horizontal depending on type of listbox), default value is 0
ITEMSIZE <value> - the size of the listbox items (vertical or horizontal depending on type of listbox), default is the height of one line of text for vertical listboxes and the max width to fit all items for horizontal listboxes
ITEMKEEPSQUARE - causes the scaling of ITEMSPACING and ITEMSIZE to maintain the item layout aspect ratio at non-4:3 resolutions
HORIZONTAL - causes the items to be displayed horizontally across the listbox, only the arrow elements of CONTROLTEX are used (and rotated) for left/right scrolling
MULTISELECT - allows multiselection in list with standard Ctrl and Shift click modifiers, use IsUIListboxItemSelected to test selections
AUTOSCROLL - scroll to the bottom of the list when new items are added
MAXSCROLL <value> - limit on the number of lines scrolled by the mouse wheel
TEXTMODE - mode for showing multiline text entries

MULTILINE <0/1> - allow wrapped, multiline text in listbox items, default 0 (note, this is different than a TEXTMODE listbox,
you will likely need to adjust ITEMSIZE to actually make room to display multiple lines in a single item)
CENTER <0/1> - horizontally center text on listbox items, default 0 unless a BUTTONTEX is also given
VCENTER <0/1> - vertically center text on listbox items, default 0 unless a BUTTONTEX is also given
AUTOTOOLTIP <0/1> - if an item is too wide to display in the listbox using standard drawing and no tooltip is given,
automatically show the item string as the tooltip
TABLE <headerID> - draw the listbox as a table with a header and aligned columns, items and the string referenced by headerID are
treated as tab (\t) delimited rows, behaviour may also be activated or updated using the SetUIListboxTable command
LISTALIGN <alignment> - when there are not enough items to fill the visible listbox, align the items to the "CENTER" or "BOTTOM" (or
"RIGHT") of the listbox
So:
a) What textures should be put there in CONTROLTEX, FRAMETEX etc? I tried to re-use textures "listcontrol", "listsel", "listbox" files (TGA or DDS) with no success.
b) How to use the TABLE element? To fill my items I tried to use AddUIListBoxItem() but so far no success, so the TABLE option could be more effective.
c) I created a script SCENUI_XXX.BSF (in DATA/UI) and put instructions in a function UI_OBJ_INIT(). I put my AddUIListBoxItem() there. I cannot confirm it is executed.



Difficulties and workarounds:
- ShowUIScreen never managed to work as I expected.
- The UI documentation in the wiki ( http://archonwiki.slitherine.com/index.php/UI ) does not mention such script functions; but I found them by delving through game files.
- To display the UI objects I declared, I settled with a solution I used last year: this is what I used to create working battle briefings.

I put UI objects in a script named SCENUI_XXX.TXT, where XXX is your scenario name.
That script is automatically checked and activated when a scenario XXX is launched.
Now my UI is accessed and played!

But:
- UI is displayed as a buggy-textured Listbox; please check question (a) above.
- I also need to fill the listbox with content; please check question (b) above. The UI wiki does not mention how we do this, so I am making trials and errors. Mostly errors, then :D


Thanks a ton!

Question #3:
I created a script SCENUI_XXX.BSF and put instructions in a function UI_OBJ_INIT().
I put my AddUIListBoxItem() there.
Looks like this:
FUNCTION UI_OBJ_INIT()
{
AddUIListboxItem("SCEN00_MyListBox", "FFFFFFFF", IDS_TOOLTIP_SELECTCHAPTER, 0, "My Chapter", 0);
}
IDS_TOOLTIP_SELECTCHAPTER is a referenced string.
0 is the user data (I saw game files using numerics here).
My Chapter" It is correct?

I use AddUIListboxItem(), and placed
It seems that the quest to have a funtioning UI tied to our game data will be long to complete!

pipfromslitherine
Site Admin
Site Admin
Posts: 9248
Joined: Wed Mar 23, 2005 10:35 pm

Re: [Mod Restart] All Space Marine and Chaos Marine Chapters

Post by pipfromslitherine » Mon Jul 02, 2018 8:37 am

Check the game UI files for existing listbox setups, the textures are user created, and so if you want to use the existing ones you will need to check working listboxes (e.g the loadsave list etc).

You can read documentation on all script commands in the autodocs (My Documents/My Games/SANCTUS/AUTODOCS/Battlescript.txt).

Cheers

Pip
follow me on Twitter here

Aekar
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Thu Nov 27, 2014 10:29 am

Re: [Mod Restart] All Space Marine and Chaos Marine Chapters

Post by Aekar » Wed Jul 04, 2018 5:53 pm

Thank you Pip.
I'll confess that was what I was doing already; I hoped to have something like "a psychic revelation" to save some trial and error :D

But in the end, thanks to this trial and error, I lost much time but gained some better understanding of how things work.
I eventually got hold of how the UI work in scrpting.

I reached the point where I can select my chapter and can generate more UIs on the fly.

Image


now that we can select a chapter and have some description, let's get to what follows:


Step Three - Customize Army List from Chapter

I hope to complete that part soon, however I am taking interest again on Warhammer Armageddon modding so I will spend some time there too!

PISTOLPETE2525
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 3
Joined: Sat Feb 11, 2017 10:40 am

Re: [Mod Restart] All Space Marine and Chaos Marine Chapters

Post by PISTOLPETE2525 » Tue Jan 22, 2019 8:40 pm

Hi, How are things coming along :D

trimtrab
Lance Corporal - Panzer IA
Lance Corporal - Panzer IA
Posts: 11
Joined: Tue Jan 24, 2012 1:44 am

Re: [Mod Restart] All Space Marine and Chaos Marine Chapters

Post by trimtrab » Tue Nov 05, 2019 11:24 pm

Any mods..at all?

Post Reply

Return to “Sanctus Reach Mods and Scenario Design”