Page 6 of 14

Re: [Modding] R&D and current findings

Posted: Sun Sep 23, 2012 6:53 am
by Icehawk78
buzzyrecky wrote:I tried everything I could for the past 2 hours or so, and nothing worked to remove the weapon. Not sure if only augments are removable and not weapons as well, but either way that sucks. I'll just work around it.
You also cannot add/remove ship systems, to the best of my knowledge. (ie no "an Engi showed up, laughed at your lack of stealth, and added it for you" events)

Re: [Modding] R&D and current findings

Posted: Sun Sep 23, 2012 7:54 am
by buzzyrecky
Icehawk78 wrote:
buzzyrecky wrote:I tried everything I could for the past 2 hours or so, and nothing worked to remove the weapon. Not sure if only augments are removable and not weapons as well, but either way that sucks. I'll just work around it.
You also cannot add/remove ship systems, to the best of my knowledge. (ie no "an Engi showed up, laughed at your lack of stealth, and added it for you" events)
well can you explain how the removal of the damaged stasis pod?

Re: [Modding] R&D and current findings

Posted: Sun Sep 23, 2012 7:58 am
by Hikori
Hmm, i'm curious if the adding weapons method will be usable to add new races into the game... probably not, but i do want to attempt to add a few new races if possible.

Re: [Modding] R&D and current findings

Posted: Sun Sep 23, 2012 1:32 pm
by buzzyrecky
Hikori wrote:Hmm, i'm curious if the adding weapons method will be usable to add new races into the game... probably not, but i do want to attempt to add a few new races if possible.
should just be able to add the race in normally, and any event that doesnt give a specific crew type will have a chance for it (and then you can just follow the format for the engi from the donor pony event if you want to specifically have it in an event... easy stuff)

Re: [Modding] R&D and current findings

Posted: Sun Sep 23, 2012 1:33 pm
by swixel
buzzyrecky wrote:
Hikori wrote:Hmm, i'm curious if the adding weapons method will be usable to add new races into the game... probably not, but i do want to attempt to add a few new races if possible.
should just be able to add the race in normally, and any event that doesnt give a specific crew type will have a chance for it (and then you can just follow the format for the engi from the donor pony event if you want to specifically have it in an event... easy stuff)
Races are hardcoded.

Also worth noting: all data file references are hardcoded to data.dat and resources.dat. Only way to fix this is to rewrite it.

Additionally, lots of file IO going on here ...

Re: [Modding] R&D and current findings

Posted: Mon Sep 24, 2012 1:15 pm
by Icehawk78
buzzyrecky wrote:well can you explain how the removal of the damaged stasis pod?
It appears to be hardcoded. Nothing in the event files indicates removal of anything. (Also, when I said "systems" I meant things like "shields/stealth/etc" not augments. But it still doesn't appear to be possible with the current system to remove anything other than scrap/fuel/missiles/drone parts.)
buzzyrecky wrote:should just be able to add the race in normally, and any event that doesnt give a specific crew type will have a chance for it (and then you can just follow the format for the engi from the donor pony event if you want to specifically have it in an event... easy stuff)
As mentioned by another person, this also doesn't appear possible. I attempted to do this, and the crew received/assigned is simply replaced with a human (and the associated event check will thus fail).

Re: [Modding] R&D and current findings

Posted: Mon Sep 24, 2012 2:07 pm
by swixel
Icehawk78 wrote:
buzzyrecky wrote:well can you explain how the removal of the damaged stasis pod?
It appears to be hardcoded. Nothing in the event files indicates removal of anything.
String reference in the binary at 0x006A52EB into the RAM on load: "STATUS_POD". (Augments are all referenced in the string table like this.) It's used at 0x000755F5, where it's used to check if the ship has the augment, and it's subsequently removed before a crystal crew member is offered. (For those who've done the quest, this all sounds a bit familiar ...)

Not that I'm looking at the XML, but the events seem to add augments, this example adds the STASIS_POD:

Code: Select all

<event>
	<text>text goes here</text>
	<augment name="STASIS_POD"/>
	<autoReward level="LOW">scrap_only</autoReward>
</event>
They're augments, not systems though (as Icehawk said); the systems themselves are tied to blueprints and "store clicks" (there's a GUI class for this). Presently there's no direct link between an event and systems -- or if there is some wicked compiler optimisation is hiding it very well. Augments, sure (as we can see).

Re: [Modding] R&D and current findings

Posted: Mon Sep 24, 2012 2:39 pm
by Icehawk78
The augment removal is specifically looking for having a status_pod, and not looking for the firing of the specific event? Weird.

Re: [Modding] R&D and current findings

Posted: Mon Sep 24, 2012 8:06 pm
by swixel
Icehawk78 wrote:The augment removal is specifically looking for having a status_pod, and not looking for the firing of the specific event? Weird.
To be entirely honest, I haven't looked too closely at the ASM, I had a quick scan for the strange value and poke about with the closest function calls (entirely corrupting my profile, yay). All I can tell you is that the function I tried last night removes augments, but I got the string comparison call backwards... When I nopped the call it stopped removing *other* things. So it looks like the pod's string is pulled from the table to stop removal ... the mystery deepens =\ (But agreed, weird it's not looking for an event!)

Tracing it back quickly again now it seems to be checking the required field then removing it. The whole sequence of checks here is:

- Has equipment (dynamic) (if not, jmp)
- Has crew of race (dynamic)

- If the crew member is of this mystical dynamically assigned race, <do something>
- else: if the string *does not match* "STASIS_POD" remove this augment.

(It then continues to check for requirements matches ... then magic which I'm too tired to try to process at the moment as there a load of function calls here.)


Looks like I read something backwards last night o.O My bad and apologies about that.

Re: [Modding] R&D and current findings

Posted: Tue Sep 25, 2012 12:33 am
by chronial
The structure of the event files: http://ftlwiki.com/wiki/Events_file_structure