IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 [SA] Listing in .ini-file

 How to..?
 
oksa8  
Posted: Saturday, Apr 14 2012, 19:24
Quote Post


Just call me Oksu
Group Icon
Group: Members
Joined: Sep 30, 2010

sf.gif

Member Award




I need, after a long time, some help with CLEO.

How could I make something like where I could add new ID's inside .ini-file, and then add parameter for each ID?

I mean something like these two:

CODE

[ID]
400
401

[400]
ASD1=***
ASD2=***
ASD3=***

[401]
ASD1=***
ASD2=***
ASD3=***


CODE

[ID]
452
602

[452]
ASD1=***
ASD2=***
ASD3=***

[602]
ASD1=***
ASD2=***
ASD3=***



And, what are default values for opcode 09EF?
Most of you are probably guessing where this is going...
Users WebsitePM
  Top
 

 
fastman92  
Posted: Saturday, Apr 14 2012, 19:37
Quote Post


фастман92 | ف
Group Icon
Group: Members
Joined: Jul 28, 2009

pl.gif

XXXXX



CODE
[ID]
400
401

You can't do it EASILY. I won't explain harder way, it's too complicated.

CLEO4 provides the easiest way to do what you're gonna do.
You need to create string with section name or key, but you have number (integer here).

Create in .ini for example:
CODE

[ID]
id_1 = 400
id_2 = 401


CODE
0AF0: 0@ = get_int_from_ini_file "cleo\config.ini" section "SectionName" key "intKey"

Read Integers in loop. From section "ID", from key from created string with incremented ID.
Read until it successes (returns true), break on failure.
In next step read if you have read ID: create formatted string of "%d" with ID as argument.
It will be section name.
Create key names with pattern "ASD%d" and incremented number from 1 as argument.
Break on failure.

To create string with number:
CODE
0AD3: 0@v = format "ASD%d" 4@

Where 0@v is outputted string and 4@ is number.

However it's harder stuff and it's likely that you will understand what's described in this post.
Users WebsitePMMSN
  Top
 

 
oksa8  
Posted: Saturday, Apr 14 2012, 21:00
Quote Post


Just call me Oksu
Group Icon
Group: Members
Joined: Sep 30, 2010

sf.gif

Member Award




Well, I've got it nearly to work through ~20 lines long code. No need to do stuff through so complex method if simple solutions work as wanted. smile.gif

But, I still got a little problem... What should I use for the [ID] part?
I get the model from current car to 1@, but how can I then use it so the script reads the part of current model?

This is one of the few I've tried, all unsuccesful so far:
CODE
0441: 1@ = car 0@ model
06D2: 5@v = '1@'
0AF2: 2@ = get_float_from_ini_file "cleo\***.ini" section 5@s key "***" //IF and SET
Users WebsitePM
  Top
 

 
Link2012  
Posted: Saturday, Apr 14 2012, 21:04
Quote Post


Wut?
Group Icon
Group: Members
Joined: Jan 30, 2011

ba.gif

XXXXX



CODE
0441: 1@ = car 0@ model
0AD3: 5@v = format "%d" 1@
0AF2: 2@ = get_float_from_ini_file "cleo\***.ini" section 5@s key "***" //IF and SET

PMMSN
  Top
 

 
oksa8  
Posted: Saturday, Apr 14 2012, 21:25
Quote Post


Just call me Oksu
Group Icon
Group: Members
Joined: Sep 30, 2010

sf.gif

Member Award




Thank you Link2012! It works, and all I now need to do is some small configuration before release. smile.gif
Users WebsitePM
  Top
 

 

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

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG