Raised This Month: $32 Target: $400
 8% 

[183] GameConfigs parser


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 01-08-2016 , 06:45   [183] GameConfigs parser
Reply With Quote #1

Hai.

I have noticed new Game Config Parser in lasts amxx dev release.

Can someone show me an example how to use it? For example how can i get m_LastHitGroup offset in counter-strike class CBaseMonster?

I tried:
Code:
new GameCofig:t = LoadGameConfigFile("azazaa") m_LastHitGroup = GameConfGetClassOffset(t,"CBaseMonster","m_LastHitGroup")

But its always returns -1.

I also noticed that LoadGameConfigFile returns handle even if there is no gamedata folder in amxmodx/data.
__________________
The functional way is the right way
GordonFreeman (RU) is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-08-2016 , 09:11   Re: [183] GameConfigs parser
Reply With Quote #2

There are already gamedata for all entities offsets of the following games: CS, DoD, TFC, OP4 and HLDM.
As you spotted, all datas have been put in gamedata files. If you're using dev build, make sure you copy the whole data/gamedata dir to your server.

To use them, you can use directly: get/set_ent* natives. Check fakemeta.inc.
For gamerules, see get/set_gamerules* natives.

You have indeed a set of natives to handle your own gamedata files. It's similar to what does SourceMod (I think there is some help on the wikl).
You create a folder (like "azazaa") in /data/gamedata/ and inside you create "master.games.txt" file which will reference any of your gamedata files.

About your last sentence, it looks like there is a typo in the code. Will fix soon.
__________________

Last edited by Arkshine; 01-08-2016 at 09:12.
Arkshine is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-08-2016 , 18:39   Re: [183] GameConfigs parser
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
You create a folder (like "azazaa") in /data/gamedata/ and inside you create "master.games.txt" file which will reference any of your gamedata files.
Normally for plugin gamedata files, they would be uniquely name for the thing using them.

example: tf2attributes plugin has a gamedata filed named tf2.attributes.txt which gets placed directly in the gamedata folder.

Last edited by WildCard65; 01-08-2016 at 19:10.
WildCard65 is offline
KORD_12.7
Senior Member
Join Date: Aug 2009
Location: Russia, Vladivostok
Old 01-08-2016 , 21:04   Re: [183] GameConfigs parser
Reply With Quote #4

GordonFreeman (RU),
Spoiler
__________________

Vi Veri Veniversum Vivus Vici
Russian Half-Life and Adrenaline Gamer community

Last edited by KORD_12.7; 01-08-2016 at 21:04.
KORD_12.7 is offline
Send a message via ICQ to KORD_12.7
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-09-2016 , 05:08   Re: [183] GameConfigs parser
Reply With Quote #5

Quote:
Originally Posted by WildCard65 View Post
Normally for plugin gamedata files, they would be uniquely name for the thing using them.

example: tf2attributes plugin has a gamedata filed named tf2.attributes.txt which gets placed directly in the gamedata folder.
Parser in SM has been extended to support master file for better management overall, but they keep old mechanism for backward compatibility. Having both is kind of redundant, so old mechanism has been disabled for AMXX. If this is really a big deal config without master could be allowed, I don't know.
__________________
Arkshine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode