Page 1 of 1

everything concerning HAPX files

Posted: Mar 30 2018
by georgios
I don't find something in the forum and the wiki so I start this thread to become the place of discussion about HAPX files.

I set the first questions to trigger it:


2) what mean the names of HAPX files?
3) how can we create new HAPX files, what can they do and what they can't?

Re: everything concerning HAPX files

Posted: Mar 30 2018
by evildari
Best to start to write what .hapx files are: thats the layout of the User Interface (UI) of the game - starting with the very first main menu

answer to 2) most of the filenames seam to be an info about location or function. ie: TRE_S1 looks like the "main page" of the Finance Department which should show basic treasury data (but does not because of calculation errors |O ). Best way to identify the parts you like to mod: look for a tooltip, and search for it, if its not a part of some translation variable you may find it.

answer to 3) total new hapx files wont help you, if it is not called / used by either other UI elements or directly called by the game (hardcoded)
best way until (see my own point 4 later) is to copy and edit current .hapx and learn their effects

4) i guess thats a question to the devs: how can we run the hapx-builder (dont know your official name of it) that seems to be in the builder.hapx / builderx.hapx file
calling it through a modded mainmenu with obUdefxp didnt work - not even with a -haps shortcut (just a guess caused by the first 3 letters...)

Re: everything concerning HAPX files

Posted: Mar 30 2018
by Balthagor
The builder for hapx files is our own proprietary tool, it will not be released.

We don't mind users digging in the UI files, but this is an area we wont' be able to support. It's really easy to make the whole game crash when changing these.

Re: everything concerning HAPX files

Posted: Apr 04 2018
by Fistalis
Balthagor wrote:
Mar 30 2018
The builder for hapx files is our own proprietary tool, it will not be released.

We don't mind users digging in the UI files, but this is an area we wont' be able to support. It's really easy to make the whole game crash when changing these.
That being said.. it is entirely possible to create new ones and or edit old ones as some of my old mods demonstrate.

Always keep back ups and trial and error are your friend.

Re: everything concerning HAPX files

Posted: Oct 12 2018
by arakan94
Balthagor wrote:
Mar 30 2018
The builder for hapx files is our own proprietary tool, it will not be released.

We don't mind users digging in the UI files, but this is an area we wont' be able to support. It's really easy to make the whole game crash when changing these.
Could you release some documentation for hapx? I'd like to make the main left window with departments bigger, so it displays more units (the sizes seem to be set so it works on HD resolution - space is wasted on my resolution).. Digging through those files without having a clue which is which doesn't sound like something I want to do though.. :/

Re: everything concerning HAPX files

Posted: Oct 12 2018
by Balthagor
Sorry, like I said, we don't mind users digging in the UI files, but this is an area we won't be able to support.

Re: everything concerning HAPX files

Posted: Dec 21 2018
by evildari
Balthagor wrote:
Oct 12 2018
Sorry, like I said, we don't mind users digging in the UI files, but this is an area we won't be able to support.
maybe not an editor , but maybe a little documentation of the more obscure commands
like obUdefxc and obFlags

here my question - maybe it is very easy to answer for you (but iam at total loss)
i managed to get fixed data for resources working (see screenshot) with setting obUdefxc to 0,0,0,0 and using obUdef from 0 to 11 for the resources , i even managed to get the right icon and resource name with that, but unfortunately it does not work the same with the AI-minister-lock, only
here the code i used for the lock for the timber resource - but it only locks agriculture - is that maybe defined by the obAction&obData entries?

Code: Select all

&&HAPOB	6, 
obName	, 
obSysuse	83, 
obFlags	0x200001, 
obState	0x0, 
obStyle	0, 
obUdef	2, 
obUdefxc	0, 0, 0, 0, 
obAction	1749, 
obData	1749, 
obDatafmt	0, 
ToolTip	"Minister Allowed Product Controls", 
ToolTipSel	"Minister Locked from Product Controls", 
ToolTipGrid	, 
obRect	170, 0, 200, 30, 
obSyspar	81, 
hapname	"MOD_41RESDATA", 
obUdefxp	, 
bitmapstyles	26, 0, 
currframe	0,
Thank you very much for any hint!

Re: everything concerning HAPX files

Posted: Dec 21 2018
by Balthagor
If it's not working, it probably has something to do with what we call "source codes". That might be the obUdefxc variable, but I'm not sure. In our HAPX editor it has a label so I don't know it's actual variable name.

The source code system is quite complex and can easily crash the game if used improperly. I don't think we've published the details for what source code does what.

Re: everything concerning HAPX files

Posted: Jan 15 2019
by evildari
is it possible to add a LB type object (habob 19) into another LB ?
like displaying the unit order queue (status) in an army list ?
(everything i tried so far - resulted in a CTD - every other non-list stat worked)