ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Ltx Write

1 2 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  19:32:38  28 March 2012
profilee-mailreply Message URLTo the Top
olaf1
Senior Resident
 

 
On forum: 01/17/2012
Messages: 240
Ltx Write

I would like to know whether you can write a script with an ltx file and save it then if so how?

thank you before
  21:55:17  28 March 2012
profilee-mailreply Message URLTo the Top
punishersal
Lone Merc looking for a job.
(Resident)

 

 
On forum: 06/05/2009
Messages: 1800
Em, .ltx files can be opened with Notepad
  22:40:07  28 March 2012
profilee-mailreply Message URLTo the Top
olaf1
Senior Resident
 

 
On forum: 01/17/2012
Messages: 240
no i mean that i wil writ with a script in a ltx data and this save after the script
  19:10:26  29 March 2012
profilee-mailreply Message URLTo the Top
olaf1
Senior Resident
 

 
On forum: 01/17/2012
Messages: 240
i hope that anyone can help me away.

i have writ this


local ltx = ini_file("respawn\\respwaner.ltx")

function spwanen()
if db.actor:alive() == false then return end
	local level_name = level.name()
		if ltx then
			if ltx:section_exist("respawns") then
			local respwan_haupt = read_section(ltx, "respawns")
				for respwans,bool in pairs(respwan_haupt) do
					if bool == true then
						if ltx:section_exist(respwans) then
						local level = ltx:r_bool(respwans,"level")
							if level_name == level then 
							local sections = ltx:r_bool(respwans,"sections") 
							local position = ltx:r_bool(respwans,"position") 
							local pos = vector():set(position)
							local lvi = db.actor:level_vertex_id()
							local gvi = db.actor:game_vertex_id()
							local se_obj = alife():create(section, pos, lvi, gvi)
							datei = io.open("respawn\\respwaner.ltx", "w")


						end
					end
				end
			end
		end		
	end
end



and this is the ltx datei


[respawns]
mar_clear_sky_respawn_1 = true
mar_clear_sky_respawn_2 = true
mar_clear_sky_respawn_3 = true


[mar_clear_sky_respawn_1]
level = marsh
sections	= mar_clear_sky_respawn_1
position = -61.996055603027,0.92057931423187,293.67742919922



[mar_clear_sky_respawn_2]
level = marsh
sections	= mar_clear_sky_respawn_2
position = 61.996055603027,0.92057931423187,293.67742919922



[mar_clear_sky_respawn_3]
level = marsh
sections	= mar_clear_sky_respawn_3
position = -61.996055603027,0.92057931423187,293.67742919922



i will write in the "respawns" the bool of false.
how i can make this

than you

i know write i can with

write = datei:write()

but how i can writ in this ltx and in the correct section of this ltx?

thank you
  03:03:21  30 March 2012
profilee-mailreply Message URLTo the Top
Stalkerstein
Senior Resident
 

 
On forum: 04/24/2010
 

Message edited by:
Stalkerstein
03/30/2012 3:03:38
Messages: 1975
I highly recommend NotePad++. It's free too!

http://notepad-plus-plus.org/
  04:33:35  30 March 2012
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
Messages: 11699
As far as I know, it is impossible to create a file from a script.

Stalkerstein, don't post spam, please.
  06:19:06  30 March 2012
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6342
I be to differ - there is IO functionality and tools for manipulating files built into the engine. Some of the bigger SoC, CS and CoP mods save additional data or settings to a file, or read them in.
  07:26:10  30 March 2012
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
Messages: 11699
I guess, things have changed since my time. I recall the IO functions having been disabled.
  07:54:17  30 March 2012
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
 

Message edited by:
SetaKat
03/30/2012 10:49:49
Messages: 6342
They're enabled in CS and CoP, at any rate, and for some features of NS mod (I think) to work, they would need to be able to access them to dynamically read a file which is used in conjunction with a keylogger to simulate CoP's f1-f4 quick use key feature.
Not sure if ini_file(...) can dynamically read an ltx file without requiring a engine restart, but if it can, then it could work just as well as IO for reading files.
IO might be disabled in SoC, but it definately works in CS/CoP.

EDIT:
io isn't present in SoC at all. It was introduced in CS, and remained in CoP.
  08:47:34  30 March 2012
profilee-mailreply Message URLTo the Top
olaf1
Senior Resident
 

 
On forum: 01/17/2012
 

Message edited by:
olaf1
03/30/2012 8:52:03
Messages: 240
I can now write to file or not?
but how can i writ to the correct section of the ltx?

thank you

edit:
i have read in the amk ru forum that it not work and is deaktiviert but it get an other thing to do that but what they say not
 
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.: Shadow of Chernobyl Forum » Mod discussion
 

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


 

Copyright © 1995-2021 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.