Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 502 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Configuration Files dll #74620
05/18/06 13:57
05/18/06 13:57
Joined: Mar 2005
Posts: 309
Germany, Bavaria
Sinthoras Offline OP
Senior Member
Sinthoras  Offline OP
Senior Member

Joined: Mar 2005
Posts: 309
Germany, Bavaria
hiho
I wrote a small configfile dll:
It can read values and strings out of a userdefined file. Comments are possible (as shown in the example) with just writing ";" as the first line character.

There are three data levels:
first one: [head topic]
second: #specified topic
third: variable / string

a short example code:
Code:

//load the seconds
temp = DLL_cfgload("Settings.cfg", "GameSettings", "Game Time", "seconds");
//load the start string
DLL_cfgloadS("Settings.cfg", "GameSettings", "GameStarter", str_cpy(Start_str, "start"));



the string access is a bit tricky because the functions cannot have more than 4 parameters.. you have to take a string containing the cfg-value name for reading the user string. But that shouldnt be a problem..

a short example file:
Code:


;----------------------------------------------
[GameSettings]

;time for one run
#Game Time
hours = 0
minutes = 0
seconds = 5

#GameStarter
start = Welcome!
rebirth = We'll start another round..
timeout = Timeout..
end = No lifes left

;settings for the player
#Player
healthpoints = 3
speed = 25
jumpSpeed = 10




Is anyone interested in it?

Re: Configuration Files dll [Re: Sinthoras] #74621
05/18/06 19:34
05/18/06 19:34
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Well I'm not the plugin man, so abit confused here
I NEED MORE INFORMATION


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Configuration Files dll [Re: frazzle] #74622
05/18/06 20:14
05/18/06 20:14
Joined: Mar 2005
Posts: 309
Germany, Bavaria
Sinthoras Offline OP
Senior Member
Sinthoras  Offline OP
Senior Member

Joined: Mar 2005
Posts: 309
Germany, Bavaria
ah, thats the point ^^ just wondered why nobody ansered..

here you are:
with the two functions
var = dll_cfgload(*filename*, *head topic*, *specaliced topic*, *name*);
and
dll_cfgloadS(*filename*, *head topic*, *specaliced topic*, *name&returnstring*);

you can read values and strings out of a .cfg file. The advantage of that is that no wdl files have to be accessed (->it is working in the published version) and you can describe and STRUCTURE your settings/data/.. very well.

Re: Configuration Files dll [Re: Sinthoras] #74623
05/18/06 20:19
05/18/06 20:19
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
Why do you want to know if it is useful by comment FIRST, if you have ALREADY finished it? Why not just let the people try and THEN say if it is/was useful?


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Configuration Files dll [Re: Michael_Schwarz] #74624
05/18/06 20:24
05/18/06 20:24
Joined: Mar 2005
Posts: 309
Germany, Bavaria
Sinthoras Offline OP
Senior Member
Sinthoras  Offline OP
Senior Member

Joined: Mar 2005
Posts: 309
Germany, Bavaria
I have already finished it because I need it for my project, and now I just want to share it.
The question was not about the creation, because it is already done.
It was just about any interest in the community, if I should upload the dll etc.

Re: Configuration Files dll [Re: Sinthoras] #74625
05/18/06 20:26
05/18/06 20:26
Joined: May 2003
Posts: 609
Rattenfängerstadt
Rigoletto Offline
Developer
Rigoletto  Offline
Developer

Joined: May 2003
Posts: 609
Rattenfängerstadt
Quote:

the string access is a bit tricky because the functions cannot have more than 4 parameters..




You can use one string seprated by a delimiter for access keywords.

Re: Configuration Files dll [Re: Sinthoras] #74626
05/19/06 01:25
05/19/06 01:25
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
William Offline
Expert
William  Offline
Expert

Joined: Aug 2001
Posts: 2,320
Alberta, Canada
I'd be intrested in this, but where would you download it? Thanks.


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/
Re: Configuration Files dll [Re: William] #74627
05/19/06 07:09
05/19/06 07:09
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Thanks if you upload it. I think this is the same as Napo's INI DLL, but the more the merrier. I'll have to compare it with that one whenever I find the time.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Configuration Files dll [Re: Rigoletto] #74628
05/19/06 15:30
05/19/06 15:30
Joined: Mar 2005
Posts: 309
Germany, Bavaria
Sinthoras Offline OP
Senior Member
Sinthoras  Offline OP
Senior Member

Joined: Mar 2005
Posts: 309
Germany, Bavaria
Quote:

You can use one string seprated by a delimiter for access keywords.



An exellent idea, thanks for that! I'll implement it

[EDIT]

-> implemented

here you are
> Download link <

the dll functions are just those two:
Code:


//**********************
//KeyString:
//- head topic
//- group
//- sub group
//- variable/String
// Separator: comma
//returnString:
//string returned from the cfg. The function also returns a pointer to this string

dllfunction DLL_cfgload(KeyString);
dllfunction DLL_cfgloadS(KeyString, returnString);



Last edited by Sinthoras; 05/19/06 18:35.
Re: Configuration Files dll [Re: Sinthoras] #74629
05/20/06 13:08
05/20/06 13:08
Joined: Mar 2005
Posts: 309
Germany, Bavaria
Sinthoras Offline OP
Senior Member
Sinthoras  Offline OP
Senior Member

Joined: Mar 2005
Posts: 309
Germany, Bavaria
I forgot to add:

the path for the cfg files is

*workdir* \\data\\cfg\\ *filename*

Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1