So im wondering why i have to have " after sel= now for the add command when ' worked for replace commands.
Edit - It did actually work tho when i tried it your way, cheers mate ur a star. I still find it strange tho that it worked with ' before with my first mod as was shown on page 1 of this thread. Still it works and im happy thats the main thing. Thx again.
it is crucial that the add operation is completely in one line, otherwise the Newlines and spaces between the nodes seem to be interpreted as text and mess everything up. (just wasted about 3 hours before finding that..)
-> so before saving with a add Operation use the "Linarize XML" from your Editor of choice.
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
I'm having problem changing the tradeships range in trade.ship.xml. I tried quite some versions currently I'm sitting with this one after reading this thread from start to end. Seeing as traders are still not piling up at the DV-OM gate I have to think it's not working:
MutantDwarf wrote:It really should be mentioned in the first post that all selection arguments need to point to a unique node; there can't be any ambiguity, and if there is the whole node will just be ignored and left unchanged.
it is crucial that the add operation is completely in one line, otherwise the Newlines and spaces between the nodes seem to be interpreted as text and mess everything up. (just wasted about 3 hours before finding that..)
-> so before saving with a add Operation use the "Linarize XML" from your Editor of choice.
Also true for replace operations. Check for 'invalid character' warnings in the debug log. What a waste of time tonight was. Ten minutes coding, over an hour to get the patch working, two hours and counting to redo chapter 3 so I know everything works.
Challenge: Tell me one advantage of the XML scripting language and XML patch over a more conventional language and standard diffs.
andrewas wrote:Challenge: Tell me one advantage of the XML scripting language and XML patch over a more conventional language and standard diffs.
- diff can only change whole lines, xmldiff can change as little as an attribute without affecting the rest of the file line/node
- diff depends on line numbers or previous/next line context, which can change if multiple extensions change the same file in the same context (eg adding compatible missiles to a ship)
- there are already many standard editors available for xml which implement things like validation and auto-completion
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
But what, if you want to create a second mod without creating a new Pagefile?
You shouldn't force people to use both mods, just to have a proper t-File with the first mod adding the page and the second one adding to that page.
But how could you do something like "Add to the page or create it, if it doesn't exist" ?
if you just want to add stuff i would suggest merge files instead of diff files see 2nd Post (basically a t-file like in the previous games which contains only your new stuff) - it is possible to have the same page in the file multiple times and it still works as intended not sure what happens if you use the same page/t id twice though, altough i think the last loaded one wins.
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
the Game tries to interpret the xml as merge file first, which is not succesful (because it doesnt know how to use the nodes in there with this method). afterwards it applies this file as diff file.
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
as long as one of the sub-nodes has something unique the parent node doesnt need to be unique
or you can also adress the nth node with this name using this mehthod:
/root/bar[2]/foo
although i would recommend the first method since its more reliable.
PS if you use an XML Editor it should have an "evaluate XPath"-function - if you are not sure that your XPath works then play around with that in the end it should return only one result
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help