GTA: Modification Area
Would you like to react to this message? Create an account in a few clicks or log in to continue.
GTA: Modification Area

A website for the GTA modding scene

Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Big-game starts raising Schneider's profile
Read/Write Text Files EmptySun Mar 04, 2012 2:28 am by lavivi

» [Help] cleo created lighting
Read/Write Text Files EmptyThu Oct 14, 2010 1:03 am by findmy012

» Mission Question
Read/Write Text Files EmptyThu Oct 14, 2010 1:02 am by findmy012

» [IV] Spoiler Script
Read/Write Text Files EmptyThu Oct 14, 2010 1:02 am by findmy012

» Mission mod [help]
Read/Write Text Files EmptySat Sep 18, 2010 5:50 pm by jayd00

» Bc7 Mod Help
Read/Write Text Files EmptyFri Aug 20, 2010 11:19 am by pengpeng

» Found a bug
Read/Write Text Files EmptyFri Dec 18, 2009 4:22 am by _CJ360_

» [IV] Novitec Rosso 599 GTB
Read/Write Text Files EmptyTue Nov 17, 2009 4:22 pm by Kotton

» Hello/Guidance Request
Read/Write Text Files EmptyMon Oct 12, 2009 6:45 am by Adler

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Affiliates
image

Image

Image

Image

Image

Image

Image

Image

Image

Image

image

Image

steve-m.com

Image


----- Русский -----

Если ваш сайт содержит большую коллекцию SCM/CLEO-скриптов (больше 16), напишите на мой e-mail, и я добавлю его в список. Приветствуются скрипты, которые не встречаются на других сайтах ... Спасибо. ))))


----- English -----

If your website has a big enough collection of SCM/CLEO scripts (more than 16) notify me by e-mail
, and I will add it to the list. The unique scripts are preferable ... Thank you. ))))
Log in

I forgot my password



April 2024
MonTueWedThuFriSatSun
1234567
891011121314
15161718192021
22232425262728
2930     

Calendar Calendar


You are not connected. Please login or register

Read/Write Text Files

2 posters

Go down  Message [Page 1 of 1]

1Read/Write Text Files Empty Read/Write Text Files Mon Sep 07, 2009 8:10 am

Deji



I was wondering if there was any way to read or write to a TEXT file... Although Sanny says that the opcode for read/writing can write to a text file, it writes to the file in binary format (for some reason).

Yet somehow a few clever people have managed to write plain text files (using hex, I think?)...

Basically I want to give the user to enter something into a file and the game to be able to read it.

Then I want to be able to make the game write something (say, coordinates) to a readable text file.



If that's not possible, I wanna be able to do it in a CLEO Script. Which would require starting the script, getting the pointer, reading the right part (right?)... But I'm not sure how to do it for a seperate script.


I'm working on a advanced debugging script (not one of those simple ones, either Very Happy)

http://gtag.gtagaming.com

2Read/Write Text Files Empty Re: Read/Write Text Files Thu Sep 17, 2009 9:46 am

gtasbigfoot

gtasbigfoot
Admin



I have been in Saint Petersburg, so sorry for the late reply. Yes, it's possible. And very easy, all is needed is to use the opcode to create this file, and the read the direct data from it. Would you explain what the actual problem is with creating it?

It's because when you tried, the text was in machine-language, and not readable by people?





Then I want to be able to make the game write something (say, coordinates) to a readable text file.



Easy. But while we are speaking of such thing in the SA Memory Topic, I posted a code, this code will work in main.scm (MPACK included), you can create a file named "playercoords.txt" in SA dir, put coords in it it does not matter if you use comma's (,) or dots (.) between the XYZ it will still work, press F5 in-game, and CJ will be teleported to this coords that you put in the file. I.e. a user can open this file and change the coords to what they want to.


Code:

:SetNewCoords
hex
 B8 B0 D7 5B 00 FF D0 C3 // C3 - ret
end


* Code sets the coords


Code:

:MovePlayer
0@ = -429863
1@ = 304497
while true
    wait 250
    &0(1@,1i) == 0xFF
    jf continue
    &0(0@,1i) = 0xA49960
    &0(0@,1i) += @_SetNewCoords
    0572: run_asm_inject true
end // while
:_SetNewCoords
hex
 B8 B0 D7 5B 00 FF D0 C3
end


For main.scm (uses ASM injector)


Code:

1@ = 304497


* Index of keys - http://sannybuilder.com/dev/keycodes.htm

P.S. In the Memory Topic, I posted a code which opens a custom IMG-files and reads the models inside of this file, maybe that will also help you.


Code:

const
 FILE = 1@
 FILE_PATH = "data/mytestfile.txt" 
end

....

if
    0A9A: FILE = openfile FILE_PATH mode 0x77  // "write text"
then
 // text file with the name "mytestfile.txt" will be created in the SA/data dir
    .....
    // write data to the TXT-file
end


File options


Code:

0x6272 – opens binary file for reading
0x72  – opens text file for reading
0x6277 – opens binary file for writing
0x77  – opens text file for writing






Last edited by gtasbigfoot on Sun Sep 20, 2009 8:44 am; edited 1 time in total

http://gtamodding.com

3Read/Write Text Files Empty Re: Read/Write Text Files Sat Sep 19, 2009 7:30 am

Deji



You're a genius...

I wish I could test it out... But I'm inable to use my videocard :/

Thanks, anyway.

http://gtag.gtagaming.com

4Read/Write Text Files Empty Re: Read/Write Text Files Thu Sep 24, 2009 9:21 am

gtasbigfoot

gtasbigfoot
Admin

Deji wrote:You're a genius...

I wish I could test it out... But I'm inable to use my videocard :/

Thanks, anyway.



Sorry to hear that. I hope you get it working soon, or buy a new one. F**king video cards always go when you need them, uhh?

http://gtamodding.com

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum