Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: JFK on March 22, 2009, 03:52:35 pm

Title: XML functions v0.9b
Post by: JFK on March 22, 2009, 03:52:35 pm
Script Name: XML Functions 0.9b
Script Description Functions to load, save and edit XML files.
Author: JFK (http://soldatcentral.com/index.php?page=profile&u=95)
Compile Test: (http://soldatcentral.com/images/pass.gif) Passed
Core Version: 2.6.3
Hosted by: Soldat Central - http://soldatcentral.com/ (http://soldatcentral.com/)

Full Description:

Using XML can help you organize and store large data structures, such as scripts that will work a lot of statistics, settings or tweakpoints. These functions will able your scripts to load, save and edit XML-files and store your data in a XML structure.

Comes with a manual.


(http://soldatcentral.com/images/download.gif) (http://soldatcentral.com/dl.php?id=106&act=1)
(Size 163.75 KB)
- http://soldatcentral.com/index.php?page=script&f=106 -


** Script hosted by Soldat Central (http://soldatcentral.com/index.php?page=script&f=106)! Please visit the author's script page (http://soldatcentral.com/index.php?page=script&f=106) and Rate this script **
Title: Re: XML functions v0.9b
Post by: xmRipper on March 22, 2009, 04:31:50 pm
Good work.

Quote
1598> //YOUR SCRIPT STARTS ON LINE 1601! thats including the +1 from the soldat compiler..
1599> //so line 1601 is line 1 of your script if you didn't get it yet.

ehh useful =)
Title: Re: XML functions v0.9b
Post by: iDante on March 22, 2009, 05:41:38 pm
That is awesome.
Title: Re: XML functions v0.9b
Post by: DorkeyDear on March 22, 2009, 08:07:31 pm
Wow this seems really cool. I guess it could used in combo with GetURL to try to get a piece of a site somehow or something.. or for many other things too. :)
Title: Re: XML functions v0.9b
Post by: JFK on March 22, 2009, 08:44:10 pm
Wow this seems really cool. I guess it could used in combo with GetURL to try to get a piece of a site somehow or something.. or for many other things too. :)

Yep you can, although XMLstrtoElem and XMLelemtoStr aren't primary functions. You'd have do disassemble some pointers to use them or parse the XML as whole document. It would be cool to add XMLgetURL or URLtoELem or something later, for easy communication with php and such.

Thanks for the replies. I was hoping to use this for a new open XML standard for maps, so a mapmaker or owner can create a XML file with additional settings for each map. I'll open a topic about it in discussions soon, cause I'm definitly going to need some help :)
Title: Re: XML functions v0.9b
Post by: danmer on March 24, 2009, 05:38:28 am
hell... how long did it take you to make this... Looks ridiculously useful Oo
Title: Re: XML functions v0.9b
Post by: JFK on March 24, 2009, 06:51:26 am
hell... how long did it take you to make this... Looks ridiculously useful Oo

Thank you :D

About a month.. let's say 10 hours total :p
Hardest part was to translate a XML-file to the memory. I challenge anyone who thinks is more expert with regular-expressions then me now ;)
And to be honest, I'm not too sure about the usefulness. It's all pretty heavy on the processor. I mean, look at the compile log. It took the test compiler 2 full seconds to compile it all (I don't know if that includes the ActivateServer() procedure, cause then it would explain a lot). But assuming that server-hardware will only get better, i'd guess it would be a wise choice to use a bit more processor-intensive methods if that will help you keep a solid programming structure.
Title: Re: XML functions v0.9b
Post by: danmer on March 24, 2009, 01:55:45 pm
compare it to the ini files people are using now
Title: Re: XML functions v0.9b
Post by: EnEsCe on March 24, 2009, 04:25:14 pm
I mean, look at the compile log. It took the test compiler 2 full seconds to compile it all (I don't know if that includes the ActivateServer() procedure, cause then it would explain a lot).
Don't rely on the compile time shown there, the server doing the compile is on a shared web hosting environment with 113 other domains. It barely has any CPU/Memory resources available.

EDIT: Recompiled it, came out as 0.193, seems about right.
Title: Re: XML functions v0.9b
Post by: CurryWurst on May 04, 2009, 02:40:47 pm
Jesus, this script is awesome. Very useful indeed. Hope you keep it updated :)
XML support and classes is one of the best inventions for the soldat scriptcore I've ever seen.
It's always a good idea to revive the "obsolete" scriptcore by adding new sensible functions.