Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Fuzzy Bandit

Creating a Permanent Dialogue

Recommended Posts

Hello!

I'm looking into creating a permanent Dialogue at the top centre of the screen that would update (preferably) every second with the values of new variables.

Seeing as it would stay there at all times, the player should be able to move and function without the dialogue effecting any game-play.

I've been reading through the wiki on Dialogues for ages, and can't seem to get any closer to what I need.

If someone could just gimme a shove in the right direction I'd be eternally grateful. I want to do it myself, just having difficulties knowing where to start! :D

Cheers!

Share this post


Link to post
Share on other sites

You need to create a display, not a dialog. Same/similar scripting commands and such but with some different properties. Dialogs don't allow movement, weapons aiming, etc. whereas displays too. Displays allow movement and weapons but you cannot interact with the dialog (with the mouse).

I would also note I am familiar with dialogs but not displays so what i have written may not be exact. Btw, you can also use cutrsc and titlersc to display info on screen.

Edited by Loyalguard

Share this post


Link to post
Share on other sites

I used fthud/sthud as a basis to make my own. But I couldn't find a way to make use of the setCtrlxxxxx commands (since it's now a resource instead of a dialog), so for me the attempt was unsuccessful. I have not seen a way to use openDialog in such a way that mouse input is not transferred to the dialog.

Share this post


Link to post
Share on other sites

Ok, bumping this because I still have absolutely no idea bout how to make this work! :D

I've had a look at the .pbo inside the STHud download, and I just have no idea what's going on with the damned thing! :D

Is there anybody that could post an example script that I could adapt and formulate into my final product? Even just a window that will appear permanently and allow the player to move free from constraint.

Tried using the Dialogue examples on the wiki and instead using:

_ok createDisplay "MyHelloWorldDialog";

...it didn't work... :D

Share this post


Link to post
Share on other sites

See if this makes any sense:

//class RscTitles //Uncomment when using Rsc approach
//{ //Uncomment when using Rsc approach
class Cursor_Dialog
{
	idd = 236100;
       movingEnable = 1;
       enableSimulation = 1;
       enableDisplay = 1;
       duration = 99999999999999999;
       fadein  = 0;
       fadeout = 0;
//		class controls //Uncomment when using Rsc approach
//		{ //Uncomment when using Rsc approach
	controls[] = { //Comment when using Rsc approach
		thelist,
		ofcontrols,
		youhave,
		inyour,
		dialog
	}; //Comment when using Rsc approach

		class thelist : Cursor_RscText
		{
			idc = 1;
			type = CT_STATIC;
			style = ST_LEFT;
			default = false;
			...
			...
			...whatever
		};
		class ofcontrols : Cursor_RscText
		{
			idc = 2;
			type = CT_STATIC;
			style = ST_LEFT;
			default = false;
			...
			...
			...whatever
		};
		...pluss the rest of the classes/controls that make up the dialog
};

If using resources, the syntax changes slightly. Firstly, the class has to be under RscTitles. Secondly, the controls are listed as:

class controls {control1, control2....};

instead of the usual

controls[] = {control1, control2....};

To open it, I then use:

_ok = createDialog "Cursor_Dialog"; //Comment when using Rsc approach

//cutRsc ["Cursor_Dialog", "plain"]; // Uncomment when using Rsc approach

Btw, I don't have much experience with dialogs and that part of scripting, this whole thing is quite cryptic to me, and messy messy messy. A nightmare with all those crashes - quite demoralizing getting somewhere :)

Oh, and remember to define Cursor_RscText.

Share this post


Link to post
Share on other sites

I believe with createDisplay, you have to declare the parent display first since a display can only be the child of another display/dialog (I know, the terminolgy is cumbersome). If no other displays or dialogs are open, I THINK you can use the "default" game display: 46. Example:

(findDisplay 46) createDisplay "MyHelloWorldDialog";

I have never done it so I cannot add more clarification.

Edit:

Regarding Carl's post above, that is good information...the only thing I have to add is that if you use cutRsc I don't believe you can update controls via scripted commands (like setCtrlText) (if that is something you want to do) and with cutTitles, you can do that, but I believe it affects every rscTitle in the mission so you may have to take care how/when you update the controls.

Edited by Loyalguard

Share this post


Link to post
Share on other sites
Sign in to follow this  

×