churchill Posted August 6, 2008 Share Posted August 6, 2008 (edited) I originally included a help.xml file in my about to be released resource, but in it I mention pressing a key that is server-owner definable in an config.xml file that is also included in the resource. So, if i want the help.xml file to display the correct key to press, do I need to make it write the help.xml file on the fly when the resource is first started on the server, or is there some other kind of fancy way of doing it? edit: all sorted - introduced to the joys of the help manager and creating help panels programatically. Much nicer, once you remember to include the helpmanager resource in your meta.xml file Edited August 8, 2008 by Guest Link to comment
Gamesnert Posted August 6, 2008 Share Posted August 6, 2008 Definable keys? Well, for as far as I know you can just edit helpmanager (or something) to change the keys. Otherwise you can just make a small script to read something like: Hello cruel world! Or..... Something... And I think xmlNodeGetValue is the right scripting command to read it out. Don't know for sure though... Link to comment
churchill Posted August 6, 2008 Author Share Posted August 6, 2008 well that's the plan - when the resource starts on the server, load the help.xml file, write a pre-defined string to the value of the node, replacing a %token% with the key defined in my config file. Seems simple enough Link to comment
Mr.Hankey Posted August 6, 2008 Share Posted August 6, 2008 You might want to read this: http://development.mtasa.com/index.php? ... Custom_GUI as in the example stated you can create the help tab inside a script of your resource so you dont need a help.xml file at all Link to comment
churchill Posted August 6, 2008 Author Share Posted August 6, 2008 aha! yes, that'll do it ta for that! Link to comment
churchill Posted August 8, 2008 Author Share Posted August 8, 2008 helpTab = call(getResourceFromName("helpmanager"), "addHelpTab",getThisResource(),false) helpMsg = "Initial resource description." if (enabled == "true") then helpMsg = helpMsg .. " if feature has been enabled in config, then you can hit " .. keymap .. " to activate it" end guiCreateMemo ( 0.05, 0.05, 0.9, 0.9,helpMsg,true, helpTab) I'm getting Bad argument @ 'call' on that very first line. I thought it was because originally I'd have been trying to call it from the server side script, but then I realised it would obviously be a client side script, so I moved it. But I still get that error. Because of the error I get the memo appearing attached to nothing (because helpTab is probably nil due to the call failing) and the help window isn't activated when you hit F9, either, so it well and truly screws things up. What am I doing wrong? Do I need to add some permissions or something to a file in order to let my resource use helpmanager? Link to comment
Ace_Gambit Posted August 8, 2008 Share Posted August 8, 2008 Stupid question but is the helpmanager resource loaded? Link to comment
churchill Posted August 8, 2008 Author Share Posted August 8, 2008 yes, that was the first thing I checked. Before I start my resource, helpmanager works fine (shows the Freeroam help), but when I run my resource, I get that error on the line above. if I haven't got the answer by tonight I'll try duplicating it in another resource to see if it is still a problem. Link to comment
Gamesnert Posted August 8, 2008 Share Posted August 8, 2008 This is the one from Battlefield69, except the last thing is false now. If this doesn't work, try making false true. =/ helpTab = call(getResourceFromName("helpmanager"), "addHelpTab", getThisResource(), false) Link to comment
churchill Posted August 8, 2008 Author Share Posted August 8, 2008 I had a look at the battlefield resource this afternoon, but couldn't see anything different. Just had a look again tonight, and I figured it out. needed to be added to the meta.xml file in my resource. Link to comment
Gamesnert Posted August 8, 2008 Share Posted August 8, 2008 Wasn't that Ace's question? Link to comment
churchill Posted August 8, 2008 Author Share Posted August 8, 2008 by loaded I assumed he meant loaded on the server, which is was (other resources were accessing it!) but it wasn't included in my resource, which is a different thing Link to comment
Gamesnert Posted August 8, 2008 Share Posted August 8, 2008 (edited) ... Why isn't it shown on the page Ace gave anyway? Well... I thought he meant that atleast... Well problem solved so no problem. EDIT: Mr.Hankey, my bad. Edited August 9, 2008 by Guest Link to comment
churchill Posted August 8, 2008 Author Share Posted August 8, 2008 Ace didn't give any page link? Mr Hankey did, which was most useful, but from what I can see, that page has no mention of including the helpmanager resource in your meta.xml file? maybe I missed something, but I've not seen it documented on the pages I was looking at. When I was getting errors my immediate thought was that I probably needed to add a reference to it somewhere, as I mentioned in my first post regarding the error - I just needed someone to confirm it Link to comment
50p Posted August 9, 2008 Share Posted August 9, 2008 The resource must be running to call functions from it. You don't have to include the resource into meta.xml but it must be running. You can add the helpmanager to the list of resources which start with the server and you won't have to include it into meta.xml either. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now