Coding

 Reply to this postStart new topic

Reading from .dat files

DK22
post Jun 23 2011, 05:56 AM
Post #1


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



So I wanna make a mod, which reloads txds from models/txd folder. I wanna make a .dat file for it,:
CODE
name: rlogos
image1
image2
image3

name: target
image1
image2
image3
image4

...

So I need read firstly the "name"
And then read all words after it. But before the second "name".
Go to the top of the page
 
+Quote Post
DK22
post Jun 23 2011, 06:11 AM
Post #2


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



I decided to do it in other way. Is this right?
SANNY
for 31@ = 1 to 16
    0AD3: 14@v = format "TXD%d" 31@
    0AF4: 10@v = read_string_from_ini_file "CLEO\reload_textures.ini" section "Main" key 14@v
    if
        10@ <> 0
    then
        0390: load_txd_dictionary 10@s
    end
end
Go to the top of the page
 
+Quote Post
Deji
post Jun 23 2011, 07:13 AM
Post #3


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Uhh, well.. does it work? tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Jun 23 2011, 12:19 PM
Post #4


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



Yep. Working.
SANNY
{$CLEO .cs}
0A8C: write_memory 0x4841BB size 1 value 0xE9 virtual_protect true // jmp
0AC6: 0@ = label @label offset
dec(0@, 0x4841C0) // offset
0A8C: write_memory 0x4841BC size 4 value 0@ virtual_protect true // offset
0AC6: 0@ = label @label offset
0A9F: 1@ = current_thread_pointer
inc(1@, 0x3C)
inc(0@, 2)
0A8C: write_memory 0@ size 4 value 1@ virtual_protect false // offset
0@ = 0
while true
    if
        0@ == 1
    then
        for 31@ = 1 to 16
            0AD3: 14@v = format "TXD%d" 31@
            0AF4: 10@v = read_string_from_ini_file "CLEO\reload_textures.ini" section "TXD" key 14@v
            if
                10@ <> 0
            then
                0390: load_txd_dictionary 10@s
            end
            for 30@ = 0 to 7
                10@(30@,8i) = 0
            end
        end
        for 31@ = 1 to 128
            0AD3: 14@v = format "Img%d" 31@
            0AD3: 18@v = format "ID%d" 31@
            0AF4: 10@v = read_string_from_ini_file "CLEO\reload_textures.ini" section "Image" key 14@v
            0AF0: 9@ = get_int_from_ini_file "CLEO\reload_textures.ini" section "ID" key 18@v
            if and
                9@ <> 0
                10@ <> 0
            then
                038F: load_texture 10@v as 9@
            end
            for 30@ = 0 to 12
                9@(30@,8i) = 0
            end
        end
        0@ = 0
    end
    003D:
end

:label
hex
    C705 00000000 01000000 // mov dword ptr ds:[0@], 1
    B8 405A4600            // mov eax, 465A40h
    FFD0                   // call eax
    B8 C0414800            // mov eax, 4841C0h
    FFE0                   // jmp eax
end
Go to the top of the page
 
+Quote Post
Adler
post Jun 23 2011, 05:58 PM
Post #5


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



Woah that's awesome. For CLEO 4 only I assume? tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Jun 24 2011, 07:06 PM
Post #6


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



Do .cleo plugins workwith CLEO3? I think no.
Go to the top of the page
 
+Quote Post
Deji
post Jun 24 2011, 08:27 PM
Post #7


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Yeah, they do.


Edit: Mmm.. but not the CLEO 4 ones, I don't think tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: