EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
UI modding - support thread
Post new topic Reply to topic Goto page Previous  1, 2, 3 ... 12, 13, 14, 15  Next
View previous topic :: View next topic
Author Message
jth



MEDALMEDAL

Joined: 04 Jan 2006
Posts: 295 on topic
Location: England
Thank you for registering your game
modified
PostPosted: Mon, 1. Feb 16, 17:44    Post subject: Reply with quote Print

Thanks for the documentation on scale1info

stefanEgo wrote:
@jth: The scrollbar will appear on the table, if the table grows too large. If you ensure that the slider is visible, it will never "go out of view".

That explains what is happening, thanks

How do I get around the problem ?

Is there a way to get the slider to sit at the end of the table and scroll down with it ?

jth

EDIT 03/02/2016

I have pretty much got a plan B production limiting configuration menu working that is based upon menu_encyclopediaproductionmethod with a slider tacked on the bottom and a lot of stuff borrowed from menu_production.

Its triggered from my modified menu_production menu

Its just difficult to keep it all on one screen with no scrolling Sad



Last edited by jth on Wed, 3. Feb 16, 14:58; edited 1 time in total
Back to top
View user's profile Send private message
jth



MEDALMEDAL

Joined: 04 Jan 2006
Posts: 295 on topic
Location: England
Thank you for registering your game
PostPosted: Tue, 2. Feb 16, 14:06    Post subject: Wiping a BlackBoard entry Reply with quote Print

I would like to completely delete a BlackBoard variable in lua as it causing me grief in md script plus its cluttering up the manager object un-necessarily

<do_if value="@$Manager.$TestVar"> remains true even if $TestVar is empty

but there is no RemoveNPCBlackboard or DeleteNPCBlackboard command

Code:
   local testtable = {}
   table.insert(testtable, "dummydata")
   SetNPCBlackboard(menu.manager, "$TestVar", testtable)
   
   local readbacktable = GetNPCBlackboard(menu.manager, "$TestVar")      
   DebugError("Read back " .. tostring(readbacktable[1]) .. " " .. #readbacktable)

   SetNPCBlackboard(menu.manager, "$TestVar", nil)

   readbacktable = GetNPCBlackboard(menu.manager, "$TestVar")      
   DebugError("Read back " .. tostring(readbacktable[1]) .. " " .. #readbacktable)


[General] ======================================
[=ERROR=] Read back dummydata 1
[General] ======================================
[General] ======================================
[=ERROR=] Read back dummydata 1
[General] ======================================

I then tried

SetNPCBlackboard(menu.manager, "$TestVar", "")

which gives

[General] ======================================
[=ERROR=] Read back dummydata 1
[General] ======================================
[General] ======================================
[=ERROR=] Read back nil 0
[General] ======================================

which means that it blanked it but it still exists and has zero entries

how do I do it ?

jth

EDIT
I have manged to recreate a work around in md script that detects missing or empty list

<do_if value="$Manager.$TestVar? and $Manager.$TestVar != '' ">

which keeps me going but my save games could do with an answer on completely deleting variables from the BlackBoard please

EDIT2
The lua code is having the same problem as the md code where its interpreting an empty table variable from the BlackBoard as an empty string so had to code round that too. Yuck Sad

Back to top
View user's profile Send private message
jth



MEDALMEDAL

Joined: 04 Jan 2006
Posts: 295 on topic
Location: England
Thank you for registering your game
PostPosted: Wed, 3. Feb 16, 14:33    Post subject: Reply with quote Print

stefanEgo wrote:
@jth: Regardling the scale1info/scale2info entries: By design a single slider can represent two distinct scales. So by moving the slider, you practically can change two different values. Documentation for the scale1info is as follows:
Code:

["left"]     = number|nil = nil,   -- value displayed on the left side (representing a slider position of 0 - nil => no display)
["right"]    = number|nil = nil,   -- value displayed on the right side (representing a slider position of 0 - nil => no display)
["center"]   = true|false = true,   -- indicates whether the current scale value is to be displayed on the center of the slider
["minLimit"] = number|nil = nil,   -- the minimal value the scale will display, even if the slider indicates a smaller value (nil => no limit)
["maxLimit"] = number|nil = nil,   -- the maximal value the scale will display, even if the slider indicates a larger value (nil => no limit)
["inverted"] = true|false = false,   -- indicates whether left/right behavior is inverted (i.e. if false, value changes will be subtracted on the left side and added to the right side)
["factor"]   = number     = 1,      -- factor which the slider value is multiplied with to set the values
["floored"]  = true|false = true,   -- indicates whether the displayed scale values are floored (true) or ceiled (false)
["suffix"]   = string     = ""      -- suffix which is being printed after the scale values

Code:
   local scale1info = {
      ["left"] = nil,
      ["right"] = nil,
      ["center"] = false,
      ["inverted"] = false,
      ["suffix"] = nil
   }
   local scale2info = {
      ["left"] = nil,
      ["right"] = nil,
      ["center"] = true,
      ["factor"] = (100 / menu.maxslider) or 100,
      ["inverted"] = false,
      ["suffix"] = "%"

Thanks for the documentation

Turns out that my code works but not how I thought it did Smile

The scale2info gets me a number to the immediate right of the slider that goes from 0 to 100% and displays the slider position nicely on the GUI as a percentage. I don't use the value2 that it produces.

I am actually using value1 which isn't scaled to feed into my code as that lets me control the rounding.

The following may be an enhancement request

The displayed scale2info value shows up as a single number with no decimal point. Is there any way to format its output ?

Being able to show two (or more) digits after a decimal point with no lagging zeros would be ideal for me.

Example
foodstuffs. smallest primary resource is meat and each batch uses 40. That means that I configure the slider to have 40 possible positions (you can't use part of a ware). I then scale that up by 2.5 to get 100% shown in the center by scaleinfo2. value1 goes from 0 to 40. If I move the slider up one so that value1 is 1 then the scale2info center says 3% when it should say 2.5%

EDIT 08/02/2016
The formatting that I would like is the equivalent of string.format("%g", string.format("%1.2f", scale2info_value))

Hope this makes sense

jth

Back to top
View user's profile Send private message
jth



MEDALMEDAL

Joined: 04 Jan 2006
Posts: 295 on topic
Location: England
Thank you for registering your game
PostPosted: Fri, 12. Feb 16, 15:42    Post subject: How do I grey out or disable an existing button on the fly ? Reply with quote Print

I have an OK button created with

Code:
Helper.createButton(Helper.createButtonText(ReadText(1001, 14), "center", Helper.standardFont, Helper.standardFontSize, 255, 255, 255, 100), nil, false, true)


I would like to enable and disable it depending on some other logic

I can't find a Helper.disableButton although there is a Helper.updateButtonText

Do I have to Helper.Remove it and then put it back in with

Code:
Helper.createButton(Helper.createButtonText(ReadText(1001, 14), "center", Helper.standardFont, Helper.standardFontSize, 255, 255, 255, 100), nil, false, false)

or is there a better way ?

Regards

jth

Back to top
View user's profile Send private message
jth



MEDALMEDAL

Joined: 04 Jan 2006
Posts: 295 on topic
Location: England
Thank you for registering your game
PostPosted: Tue, 23. Feb 16, 16:11    Post subject: RoundTotalTradePrice documentation Reply with quote Print

This call appears in a lot of 4.00 lua scripts

I also seem to have a lot of my scripts having numbers in them that are 100 times too large in 4.00

I have a feeling that it lines up with everything being priced in centicredits

RoundTotalTradePrice is not in the Lua function overview or the helper.lua files

I assume that it rounds down numbers to the nearest Credit

Whats the syntax ?

What build number/release did it first appear in ?

Regards

jth

Back to top
View user's profile Send private message
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)

MEDAL

Joined: 20 Nov 2005
Posts: 13649 on topic

Thank you for registering your game
PostPosted: Tue, 23. Feb 16, 16:25    Post subject: Re: RoundTotalTradePrice documentation Reply with quote Print

jth wrote:
I also seem to have a lot of my scripts having numbers in them that are 100 times too large in 4.00

I have a feeling that it lines up with everything being priced in centicredits
it is and afaik prices and money were always counted in cent - not really obvious in scripts since they are always suffixed with Cr which is automatically converted to ct by multiplying the value with 100


_________________
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter Wink

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help Wink
Back to top
View user's profile Send private message
jth



MEDALMEDAL

Joined: 04 Jan 2006
Posts: 295 on topic
Location: England
Thank you for registering your game
PostPosted: Tue, 23. Feb 16, 17:07    Post subject: Re: RoundTotalTradePrice documentation Reply with quote Print

UniTrader wrote:
jth wrote:
I also seem to have a lot of my scripts having numbers in them that are 100 times too large in 4.00

I have a feeling that it lines up with everything being priced in centicredits
it is and afaik prices and money were always counted in cent - not really obvious in scripts since they are always suffixed with Cr which is automatically converted to ct by multiplying the value with 100


Aaaah not enough brackets in one of my formulae had the side effect of multiplying by near enough 100 Sad

I still think that RoundTotalTradePrice needs adding to the Lua function overview

jth

Back to top
View user's profile Send private message
antoniut





Joined: 04 Oct 2014
Posts: 197 on topic

Thank you for registering your game
PostPosted: Wed, 2. Mar 16, 16:26    Post subject: Reply with quote Print

Hi I would like to change cursors size to 48 instead of 32 (edge enemy triangles
from 16 to 32 too) my eyes are not soo young than before Very Happy

I've changed the size to 48 in mousecursors file seems that game resizes to 32 again. I suspect that I have to modify something in Crosshair Handling.lua and targetsystem.lua.

I'm wrong? If not, how can I made a little lua mod to modify it?

Sorry to ask, but I think I could learn chinese before than lua code Very Happy

Thanks

Back to top
View user's profile Send private message
DarthNihilus





Joined: 07 Mar 2016



PostPosted: Tue, 8. Mar 16, 00:44    Post subject: Reply with quote Print

in the trade window the base price string is left justifyed. when it writes about illegal wares the price in the end is on the right side, so when i browse the sellable I just look up. but when it's not reminding about illegal wares, there's just the price, and my eyes bleed to constantly look to the side. Can this part of the trade window be justified to the right, so the base price is up above the sell list? Or you wanna put me 30 spaces to that string? :D

Back to top
View user's profile Send private message
FantasyWarrior





Joined: 24 Jul 2016



modified
PostPosted: Sun, 24. Jul 16, 23:46    Post subject: Reply with quote Print

Hi all

Iwould change something like targets icons, and player faction icon, i've tried this mod but not work :l

Code:

extensions/better_player_icon/
-assets
-libraries
-and content

-content: no comment.

-assets/fx/gui/textures/factions/faction_player.gz (with my tga texture)
 

-in the librairies folder : icons.xml

icons.xml:

Code:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE icons SYSTEM "icons.dtd" >

<diff>

     <replace sel="/icons/icon[@name='faction_player']/icon">
      <icon name="faction_player" texture="extensions\better_player_icon\assets\fx\gui\textures\factions\faction_player.tga" height="128" width="128"></icon>
     </replace>

</diff>

 


Please, what is wrong ? and how to make this ? by a mod/ patch, or can i rebuild the 01.cat with a new texture imported (tga in such case) ?

Thanks in advance Wink

And sorry for my english.

ps : i'm a GOG player, i don't have the official extract cat tools (only aviable on steam oO), but just the XRCat, and i can't rebuild a cat with this tool...

I have no idea if it's posible to rebuild a cat/dat with the official tools ??? in such case, anyone for build my new ui textues please ? i work for a realistic hud, i've already realised an HD textues pack, and a few of little mods for X:R, i'm an experienced modder for a lot of other games.

Thanks



Last edited by FantasyWarrior on Mon, 25. Jul 16, 00:23; edited 1 time in total
Back to top
View user's profile Send private message
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)

MEDAL

Joined: 20 Nov 2005
Posts: 13649 on topic

Thank you for registering your game
PostPosted: Mon, 25. Jul 16, 00:11    Post subject: Reply with quote Print

if you want to replace files in the cats/dats you have to pack them into a subst_01.cat/dat - no need to re-pack a core-cat/dat since higher-numbered ones (or mod subst-ones) ovverride earlier ones Wink
if its just a single file you can do the following manually:
=> rename your file to subst_01.dat
=> create a text file subst_01.cat
and write the following in there:
Code:
assets\fx\gui\textures\factions\faction_player.gz XXXX YYYY ZZZZZ

with XXXX being the file Size in Bytes, YYYY the File Timestamp in Unix Time (seconds since 1.1.1970) and ZZZZ is iirc an md5 hash, but not entirely sure
for more files just concentate them in the dat and write a new line for each file (same order as in dat)




V V V V V V V V V V V V V V V V V V
V V V Really relevant part here V V V
didnt want to delete the already typed start ^^

and just noticed: you can do this without cats/dats, but you did the XPath wrong, it should look like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<diff>
     <replace sel="/icons/icon[@name='faction_player']/@texture">extensions\better_player_icon\assets\fx\gui\textures\factions\faction_player.tga</replace>
</diff>


and this just reminds me i already did something like this in my Player Logo Mod Very Happy
https://github.com/UniTrader/UTPlayerLogos/blob/master/libraries/icons.xml
(and no, this mod is not just about changing the Icon in the UI Very Happy)


_________________
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter Wink

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help Wink
Back to top
View user's profile Send private message
FantasyWarrior





Joined: 24 Jul 2016



PostPosted: Mon, 25. Jul 16, 00:20    Post subject: Reply with quote Print

Wow ! thanks a lot, realy important for me Very Happy

I'm going to try...

Back to top
View user's profile Send private message
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)

MEDAL

Joined: 20 Nov 2005
Posts: 13649 on topic

Thank you for registering your game
PostPosted: Mon, 25. Jul 16, 00:56    Post subject: Reply with quote Print

since you do a UI Overhaul your new Icons probably look better than the one i put in there (mine was just to externalize the Player Faction Icon for easy replacement with an own one Wink ) i think you want to make sure your Mod loads after mine to override my change.. so just put this Line in your content.xml as first in the content node:
Code:
<dependency id="UTPlayerLogos" optional="true" />


usage example (because these usually describe best what is meant Wink ):
https://github.com/UniTrader/XFleetFest/blob/master/content.xml


_________________
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter Wink

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help Wink
Back to top
View user's profile Send private message
FantasyWarrior





Joined: 24 Jul 2016



modified
PostPosted: Mon, 25. Jul 16, 01:13    Post subject: Reply with quote Print

I've understand all parts, but not work after the first try Very Happy

I work on it...


-the "subst_01.dat" is just a simple folder named "subst_01.dat" right ? right clic/ new folder named "subst_01.dat"...

No problem for the cat, i've just past the code lines fom the original 01.cat Rolling Eyes with my new textures (tga/gz) in the correct folders...same order than the icons.xml (library)...

Code:

assets/fx/gui/textures/factions/faction_player.gz 11542 1338280629 8e3f0503f842343faf274ce42b21d8d1
assets/fx/gui/textures/target_elements/tsys_asteroid_act.gz 22109 1337933802 21e48c10622c1d1883f09ffaa37d621c
assets/fx/gui/textures/target_elements/tsys_asteroid_inact.gz 16210 1358172242 82b75cd24774359cc331fe97e32f5832

.<!--ect...-->




Last edited by FantasyWarrior on Mon, 25. Jul 16, 01:51; edited 1 time in total
Back to top
View user's profile Send private message
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)

MEDAL

Joined: 20 Nov 2005
Posts: 13649 on topic

Thank you for registering your game
PostPosted: Mon, 25. Jul 16, 01:29    Post subject: Reply with quote Print

only doing this should be enough, no need to juggle around with cats/dats
(putting your new texture file in the directory where you initially had it)
UniTrader wrote:
V V V V V V V V V V V V V V V V V V
V V V Really relevant part here V V V
didnt want to delete the already typed start ^^

and just noticed: you can do this without cats/dats, but you did the XPath wrong, it should look like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<diff>
     <replace sel="/icons/icon[@name='faction_player']/@texture">extensions\better_player_icon\assets\fx\gui\textures\factions\faction_player.tga</replace>
</diff>


and this just reminds me i already did something like this in my Player Logo Mod Very Happy
https://github.com/UniTrader/UTPlayerLogos/blob/master/libraries/icons.xml
(and no, this mod is not just about changing the Icon in the UI Very Happy)



_________________
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter Wink

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page Previous  1, 2, 3 ... 12, 13, 14, 15  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Control Panel
Login Data
The time now is Sun, 15. Jul 18, 21:20

All times are GMT + 2 Hours

[ Disclaimer / Impressum ] | [ Privacy Policy / Datenschutz ]

Board Security

Copyright © EGOSOFT 1989-2018
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.95407 seconds, sql queries = 29