FourFire's Mod Derps

A place to discuss mods in development and concepts for new mods.
Post Reply
FourFire
Militia Captain
Militia Captain
Posts: 567
Joined: Sun Aug 12, 2012 5:56 pm

Hello, this is a thread which I am starting in order to have a place to post my derp ups and ask how to do things properly with xml...

First up:
In transdata there is the following xml file: paste.neurohack.com/view/YrkFv/

I am wondering how to turn it into a mod and from there modify values so that those overwrite the default values and I can have fun stuff like centauri exploding like phobii.

I have already tried to simply insert it into my extensions folder, but upon testing the changes I made to explosion power have failed to take effect so that's not right.

Second of all:
The tinkers.xml looks like this: http://paste.neurohack.com/view/YLM3F/
on lines #246 to #248 the price of the customwork action is defined, currently it is the same (50 credits) indescriminate if you are converting five ceralloy ore into an armor plate or if you are producing patcher arms from barrels of repairing nanites.
what I would like to know is:
how may the price be set to 10% of the default value of the output item?

that way if one were to add further customwork recipes producing low value items wouldn't be exhorbiantly expensive, and producing high value items wouldn't be laughably cheap.
(func(Admin Response)= true){
if(admin func(amiable) = true)
Create func(Helpful Posts)
else func(Keep Calm and Post derisive topics)}
TVR
Militia Commander
Militia Commander
Posts: 334
Joined: Sat Sep 08, 2012 3:26 am

Code: Select all

(setq gCost (multiply gCount 50))
Replace the above with this:

Code: Select all

(setq gCost (multiply (divide (itmGetPrice (itmCreate (item gMatch 2))) 10) gCount))
Where cost to manufacture is value of finished item * 10% * quantity of finished items.

As for overwriting (vanilla) global functions, it needs to be in a Transcendence extension:

Code: Select all

<?xml version="1.0" ?>

<!DOCTYPE TranscendenceExtension
	[	
		<!ENTITY tsFourFireExtensionAlpha	"0xE0001337">
	]>

<TranscendenceExtension UNID="&tsFourFireExtensionAlpha;" version="1.1" name="FourFire's Mod">

<!-- Mod stuff here -->

</TranscendenceExtension>
Just copy and paste the <Globals> section to inside the Transcendence extension tags. Remember to change the UNID as appropriate. I believe Globals from mods are loaded after the ones in vanilla, therefore overwriting them.
Fiction is reality, simplified for mass consumption.
PGP: 0x940707ED, 5DB8 4CB4 1EF5 E987 18A0 CD99 3554 3C13 9407 07ED
Bitcoin: 1LLDr7pnZDjXVT5mMDrkqRKkAPByPCQiXQ
FourFire
Militia Captain
Militia Captain
Posts: 567
Joined: Sun Aug 12, 2012 5:56 pm

Thanks a Heap TVR
the line I was missing was the "<!DOCTYPE TranscendenceExtension" before the UNID list

I'll test that other code right now :)
(func(Admin Response)= true){
if(admin func(amiable) = true)
Create func(Helpful Posts)
else func(Keep Calm and Post derisive topics)}
Post Reply