Page 1 of 1

Tips for mocking up/tweaking/positioning UWindow dialogs?

Posted: Mon Jan 14, 2019 12:01 am
by Dizzy
I'm creating a few UWindow dialog boxes which will appear in-game.

As you may know, UWindows and their child controls are positioned via X/Y/width/height co-ordinates like (20, 150, 200, 50).

Is there any quick way to mock these up to position them without having to fiddle around with the units in the code and then re-compile the code every time a change needs to be made?

It's taken about five re-compiles just to get a simple message window looking right.

How did the UT devs do it? Slow trial and error like this?

Re: Tips for mocking up/tweaking/positioning UWindow dialogs

Posted: Mon Jan 14, 2019 1:16 am
by JackGriffin
Why do this the hard way? Just write to the players HUD. Spawn an inventory item on the player, have that write with PostRender, then destroy itself with a short lifespan. You can have the message feed from a server ini file that you can change at will.

Doing it your way makes your server have (in essence) pop-ups. *No one* likes those. People join to play, not to immediately need to click off some message window so they can get to what they came for. Think of how that makes you feel when you mobile into some website that does this.

Re: Tips for mocking up/tweaking/positioning UWindow dialogs

Posted: Mon Jan 14, 2019 1:56 am
by Dizzy
I know, but this would be useful info to know for any kind of UWindow - not just a message popup.

Re: Tips for mocking up/tweaking/positioning UWindow dialogs

Posted: Tue Jan 15, 2019 3:11 am
by Dizzy
User "slade" in the BunnyTrack.net Discord server suggested a good idea for this: using variables instead of hard-coded numbers and changing the variables in-game using "admin set" commands.

I guess it would go something like this:

Code: Select all

// Important to use "var()" and not just "var" apparently
var() int positionX;
var() int positionY;
var() int width;
var() int height;

// Create UWindow controls using the above variables 
// Example:
CloseButton = UWindowSmallButton(CreateControl(class'UWindowSmallButton', positionX, positionY, width, height));
And then in-game:

Code: Select all

admin set MyWindowClassName positionX 200

Re: Tips for mocking up/tweaking/positioning UWindow dialogs

Posted: Tue Jan 15, 2019 6:11 am
by sektor2111
Usually I'm not going for rewriting already done stuff. MapVote has a welcome window that can be linked in a Web URL with information or other links - even to a forum. Why do you need another Window ?

Also for that Nexgen thing, I believe you can use PM system for spawning a message to player right from server. Is not somehow the server sending message to target player ? Player 1 is writing message, I think it will reach to server and from server to Player 2.