Jump to content

Recommended Posts

  • Developer

Just wanted to give you an update.  Problem has been found and we'll push a fix in the next few days.

This thread isn't listed in the Getting Started thread.

Because it doesn't really help you get started :).

Because it doesn't really help you get started :-).

My point was that it was lost in the consolidation shuffle. All (or most of) the threads that were unpinned got consolidated to the Getting Started thread, but this was just unpinned and not replaced by anything that links to it. I think it deserves to be pinned. Edited by squeek
  • Developer

My point was that it was lost in the consolidation shuffle. All (or most of) the threads that were unpinned got consolidated to the Getting Started thread, but this was just unpinned and not replaced by anything that links to it. I think it deserves to be pinned.

Done :).

  • Like 1

Okay. Another thing: Where can I edit the speed multiplier for spider creep? All I figured out is it's an entity, and what kind of sounds it makes when you walk on it...Does the WALK_SPEED_MULT value apply to the player when walking on web?

Hi, I need to add a few icons in font (belisaplumilla50.zip, UIFONT). So I've managed to add the icons in font.tex and edit the font.fnt file. Now the icons are in the text:

7ECHKYI.png

Can I replace the font or add my icons into the font from my mod without changing the game client? Or can I create the new font from my mod and use it for the text?

Hey Cheerio, a few requests:

1) In class.lua, mt.__call calls the _ctor parameter directly, which means that if you change a class's _ctor function after it is first defined, the new _ctor will never be called. This makes it impossible to overwrite or extend a class's constructor after it is defined. The fix is incredible simple: inside mt.__call, nil check and call c._ctor instead of just _ctor.

2) The TextWidget userdata (used in widgets/text.lua) has its ShowEditCursor function exposed, but no functions related to changing the position of the edit cursor. Simply exposing the C++ functions that handle changing the position of the edit cursor to Lua would open up huge possibilities for mods to add to the functionality of the TextEdit widget (text selection, multi-line editing, moving the cursor using mouse clicks, etc).

Edited by squeek
  • Like 1

1) In class.lua, mt.__call calls the _ctor parameter directly, which means that if you change a class's _ctor function after it is first defined, the new _ctor will never be called. This makes it impossible to overwrite or extend a class after it is defined. The fix is incredible simple: move the line "c._ctor = _ctor" above the mt.__call function definition, and then inside mt.__call, call c._ctor instead of just _ctor.

I faced this issue a few times. Usually (though not always) it can be solved by inheriting from the class, possibly replacing the class with the new subclass. I always thought it'd be too bold to suggest a change in the class implementation, but I do agree.

I faced this issue a few times. Usually (though not always) it can be solved by inheriting from the class, possibly replacing the class with the new subclass. I always thought it'd be too bold to suggest a change in the class implementation, but I do agree.

I edited my post because I was mistaken; the fix is even easier than I thought. It just needs to call c._ctor instead of _ctor and that's all. Although it's such a core file, hopefully the fix is so non-controversial that it can get addressed. Edited by squeek

I edited my post because I was mistaken; the fix is even easier than I thought. It just needs to call c._ctor instead of _ctor and that's all. Although it's such a core file, hopefully the fix is so non-controversial that it can get addressed.

mt.__call could also simply use class_tbl instead of being a closure around c. This would also open a few doors for some "well-behaved hacking".

 

2) The TextWidget userdata (used in widgets/text.lua) has its ShowEditCursor function exposed, but no functions related to changing the position of the edit cursor. Simply exposing the C++ functions that handle changing the position of the edit cursor to Lua would open up huge possibilities for mods to add to the functionality of the TextEdit widget (text selection, multi-line editing, moving the cursor using mouse clicks, etc).

Even though I don't see it happening, I'd love for the entire TextWIdget to be exposed, since it's completely broken under Linux (under Windows, I know by experience that it works fine) and I can't do anything about it. Try using the arrow keys to edit the middle of a line to see what I mean. The text just get garbled, because the internal cursor is not updated properly (i.e., the character truly being edited is not the one shown to be). But I digress. I just hate having to backspace half a function definition just because I forgot a comma somewhere.

Edited by simplex

Even though I don't see it happening, I'd love for the entire TextWIdget to be exposed, since it's completely broken under Linux (and it really pains me that I can't fix it). Try using the arrow keys to edit the middle of a line to see what I mean. The text just get garbled, because the internal cursor is not updated properly (i.e., the character truly being edited is not the one shown to be). But I digress. I just hate having to backspace half a function definition just because I forgot a comma somewhere.

That's not Linux specific. It happens whenever the string length exceeds the width of the TextEdit widget. It is indeed super frustrating. I'll try making a bug report for that. EDIT: posted and ready to be ignored :-) Edited by squeek

That's not Linux specific. It happens whenever the string length exceeds the width of the TextEdit widget. It is indeed super frustrating. I'll try making a bug report for that.

Well, in Linux it happens even for very short strings (say, less than 16 characters). Under these same scenarios, I've never had it happen under Windows. But then again, the times I "played" DS under Windows were very rare and short, just for minor testing, so I may have missed something. But I always assumed they were using some library (possibly a system one) to handle the line text editor under Windows.

Edited by simplex

Hi, Cheerio.

Can you help me with it?

 

Hi, I need to add a few icons in font (belisaplumilla50.zip, UIFONT). So I've managed to add the icons in font.tex and edit the font.fnt file. Now the icons are in the text:

7ECHKYI.png

Can I replace the font or add my icons into the font from my mod without changing the game client? Or can I create the new font from my mod and use it for the text?

 

If you put the font inside your mod in  a subfolder called 'fonts', it should overwrite the font with the same name.  Let me know if that works for you.

 

Thanks for the answer, but it does not seem to work.

When I replace the font in game folder (dont_starve\data\fonts) all is fine, the new icons is visible, but when I create the 'font' folder in my mod with modified font the game crashes at start.

Here is the log:

Starting up

Don't Starve: 86935 WIN32_STEAM
Build Date: 2013-10-05_15-58-06
THREAD - started 'GAClient' (5448)
HttpClient::ClientThread::Main()
cGame::InitializeOnMainThread
WindowManager::Initialize
RestoreWindowPosition
   Saved Client Pos (18 x 455)
   Adjusted Window Pos (10 x 425)
EnsureWindowOnScreen
   All good.
GLInfo
~~~~~~
GL_VENDOR: Google Inc.
GL_RENDERER: ANGLE (RDPDD Chained DD)
GL_VERSION: OpenGL ES 2.0 (ANGLE 1.0.0.2249)
GL_SHADING_LANGUAGE_VERSION: OpenGL ES GLSL ES 1.00 (ANGLE 1.0.0.2249)
THREAD - started 'WindowsInputManager' (14548)
OpenGL extensions (19, 19):
GL_ANGLE_depth_texture
GL_ANGLE_framebuffer_blit
GL_ANGLE_framebuffer_multisample
GL_ANGLE_instanced_arrays
GL_ANGLE_pack_reverse_row_order
GL_ANGLE_texture_compression_dxt3
GL_ANGLE_texture_compression_dxt5
GL_ANGLE_texture_usage
GL_ANGLE_translated_shader_source
GL_EXT_read_format_bgra
GL_EXT_robustness
GL_EXT_texture_compression_dxt1
GL_EXT_texture_format_BGRA8888
GL_EXT_texture_storage
GL_OES_get_program_binary
GL_OES_packed_depth_stencil
GL_OES_rgb8_rgba8
GL_OES_standard_derivatives
GL_OES_texture_npot
GL_MAX_TEXTURE_SIZE = 8192
GL_MAX_TEXTURE_IMAGE_UNITS = 16
GL_MAX_RENDERBUFFER_SIZE = 8192
GL_MAX_VIEWPORT_DIMS = 8192, 8192
GL_MAX_VARYING_VECTORS = 10
GL_MAX_VERTEX_ATTRIBS = 16
GL_MAX_VERTEX_UNIFORM_VECTORS = 254
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 4
GL_MAX_FRAGMENT_UNIFORM_VECTORS = 221
4 compressed texture formats
texture format 0x83f0
texture format 0x83f1
texture format 0x83f2
texture format 0x83f3
cDontStarveGame::DoGameSpecificInitialize()
cGame::StartPlaying
LOADING LUA
DoLuaFile scripts/main.lua
DoLuaFile loading buffer scripts/main.lua
scripts/main.lua(144,1) running main.lua
 
scripts/modindex.lua(274,1) loaded modindex
scripts/modindex.lua(57,1) ModIndex: Beginning normal load sequence.
 
scripts/mods.lua(141,1) Loading mod: DisplayFoodValues2 (DisplayFoodValues22)
scripts/mods.lua(165,1) Mod: DisplayFoodValues2 (DisplayFoodValues22) Loading modworldgenmain.lua
scripts/mods.lua(173,1) Mod: DisplayFoodValues2 (DisplayFoodValues22)  Mod had no modworldgenmain.lua. Skipping.
scripts/mods.lua(165,1) Mod: DisplayFoodValues2 (DisplayFoodValues22) Loading modmain.lua
scripts/mods.lua(255,1) Mod: DisplayFoodValues2 (DisplayFoodValues22) Registering prefabs
scripts/mods.lua(278,1) Mod: DisplayFoodValues2 (DisplayFoodValues22)  Registering default mod prefab
LOADING LUA SUCCESS
scripts/playerdeaths.lua(79,1) PlayerDeaths loaded morgue 112
scripts/playerprofile.lua(268,1) loaded profile
scripts/playerprofile.lua(313,1) bloom_enabled false
scripts/saveindex.lua(75,1) loaded saveindex
scripts/gamelogic.lua(1046,1) OnFilesLoaded()
scripts/gamelogic.lua(1035,1) OnUpdatePurchaseStateComplete
scripts/gamelogic.lua(81,1) Unload BE
scripts/gamelogic.lua(84,1) Unload BE done
scripts/gamelogic.lua(86,1) Load FE
scripts/gamelogic.lua(88,1) Load FE: done
Assert failure 'mRenderParams.m_font != INVALID_RESOURCE_HANDLE' at ..\source\game\render\textnode.cpp(323): Trace follows...
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...