ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
Modified LuaJIT library

« Previous 10 events | 1 2 3 4 5 6 | All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  03:19:34  5 May 2014
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
 

Message edited by:
Alundaio
05/05/2014 3:21:00
Messages: 2230
He implemented a third party library (Marshal) into the dll that allows you to encode data in tables so that it can be easily written to file; persistent table storage. It's basically a C++ implementation of Xetrill's xs_save.script you can find on his pastebin.

I was using it as a replacement for xr_logic.pstor_* and a dynamic all.spawn system.
  03:53:01  26 May 2014
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
Messages: 2230
Xetrill, what is faster, db.storage[id].object or level.object_by_id(id)?
  22:17:54  26 May 2014
profilee-mailreply Message URLTo the Top
Xetrill
(Senior)
 
On forum: 07/08/2008
Messages: 129
No, idea which is faster. You should profile it.
You could use my function_profiler (link below) to set that up or of course use your own solution.

function_profiler: http://pastebin.com/WLba0H2Q (its in there)
It requires middleclass; my slightly modified version: http://pastebin.com/vAdbAtpK
original here: https://github.com/kikito/middleclass/blob/master/middleclass.lua
  02:18:17  2 August 2014
profilee-mailreply Message URLTo the Top
Decane
Senior Resident
 

 
On forum: 04/04/2007
 

Message edited by:
Decane
08/02/2014 12:44:16
Messages: 1690
How can I get the debug version working with CS? Each time I try to launch the game with the debug versions of the .dlls in my bin folder, the game invokes Bugtrap before even getting past the splash screen:

Loading DLL: xrRender_R1.dll
 
FATAL ERROR
 
[error]Expression    : assertion failed
[error]Function      : CEngineAPI::Initialize
[error]File          : E:\priquel\sources\engine\xrEngine\EngineAPI.cpp
[error]Line          : 90
[error]Description   : hRender
 

stack trace:


I've got a couple of corrupt saves I'm trying to debug and the release version isn't giving me much to go on:

FATAL ERROR
 
[error]Expression    : fatal error
[error]Function      : CScriptEngine::lua_error
[error]File          : E:\priquel\sources\engine\xrServerEntities\script_engine.cpp
[error]Line          : 180
[error]Description   : <no expression>
[error]Arguments     : LUA error: xr_logic.script:1124: xr_logic: pstor_load_all: not registered type N %d encountered
 
stack traceback:
	xr_logic.script:1124: in function 'pstor_load_all'
	xr_logic.script:1216: in function 'load_obj'
	xr_motivator.script:438: in function <xr_motivator.script:425>
 
lua stack:
  [ 2|-1] (no value):  
  [ 1|-2] (string):  `xr_logic: pstor_load_all: not registered type N %d encountered
 
stack traceback:
	xr_logic.script:1124: in function 'pstor_load_all'
	xr_logic.script:1216: in function 'load_obj'
	xr_motivator.script:438: in function <xr_motivator.script:425>'
 
stack trace:


Using this code for the abort function:

function abort(fmt, ...)
	local reason = string.format(fmt, ...)
	get_console():execute("quit")
	dbglog("ABORT() called: %s", reason)
end

function dbglog(fmt, ...)
	local msg = string.format(fmt, ...)
	local msg_no_ws = string.gsub(msg, "%s", " ")
	get_console():execute("dbg: "..msg_no_ws)
end


... I was able to get a huge error log with this:

! Unknown command:  dbg: ABORT() called: xr_logic: pstor_load_all: not registered type N 100 encountered
[ditto hundreds of times, except with different numbers in place of '100']
- Disconnect
! Unconventional M_SPAWN received : map_data[true] | bReady[false] | deny_m_spawn[false]
[ditto several times]
! GE_OWNERSHIP_REJECT: Object not found, id = 19712
- Destroying level


Any idea what "! GE_OWNERSHIP_REJECT: Object not found, id = 19712" means? Is the "id" an NPC id?


EDIT: If I use the debug shiny.dll with the lua.JIT.1.1.4.dll from the release folder and launch the game with:

@echo off
.\bin\xrEngine.exe > C:\Users\Public\Documents\STALKER-STCS\logs\xrEngine.log


... I get the following snippet in the resulting log:

=== atexit ===
  error_object: table
  from_error:   false
  from_pcall:   false
  tostring(error_object):  'table: 07630578'
=== /atexit ===

Is "error_object: table" reliable information? On page 3 it says that this part is relevant only if "from_error" is true, which it's not above.
  14:35:23  13 October 2014
profilee-mailreply Message URLTo the Top
Decane
Senior Resident
 

 
On forum: 04/04/2007
 

Message edited by:
Decane
10/13/2014 14:37:22
Messages: 1690
Xetrill, if you're still out there and following this thread, your LuaJIT library breaks the '%s' and '%d' operators in any function that invokes these as variable type indicators, such as the abort() function. You can see an example in my post above this one: instead of 'not registered type N 100 encountered', your DLLs yield 'not registered type N %d encountered'.
  02:12:35  18 December 2014
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
Messages: 2230
You really should come back and work with cop source code.



---QUOTATION---
Xetrill, if you're still out there and following this thread, your LuaJIT library breaks the '%s' and '%d' operators in any function that invokes these as variable type indicators, such as the abort() function. You can see an example in my post above this one: instead of 'not registered type N 100 encountered', your DLLs yield 'not registered type N %d encountered'.
---END QUOTATION---



I never noticed because I use my own print function, which does not use string.format.


function printf(msg,...)
	if not (msg) then return end
	local fmt = tostring(msg)

	if (select('#',...) >= 1) then
		local i = 0
		local p = {...}
		local function sr(a)
			i = i + 1
			if (type(p[i]) == 'userdata') then
				return 'userdata'
			end
			return tostring(p[i])
		end
		fmt = string.gsub(fmt,"%%s",sr)
	end
	get_console():execute("load ~#debug msg:"..fmt)
end



It's better because you can replaces %s with anything, even userdata safely.
  16:52:01  21 April 2015
profilee-mailreply Message URLTo the Top
Decane
Senior Resident
 

 
On forum: 04/04/2007
Messages: 1690
Is it necessary for correct functioning in CS to define these in _g.script:

string.gfind = string.gmatch
math.mod = math.fmod

Or was this only for CoP and/or for an earlier version of this library?
  12:14:13  29 April 2015
profilee-mailreply Message URLTo the Top
Xetrill
(Senior)
 
On forum: 07/08/2008
Messages: 129
Only the early versions had that.
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2019 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.