[Modding] R&D and current findings

Discuss and distribute tools and methods for modding. Moderator - Grognak
Post Reply
Icehawk78
Posts: 230
Joined: Tue Sep 18, 2012 4:55 pm

Re: [Modding] R&D and current findings

Post 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)
buzzyrecky
Posts: 43
Joined: Wed Sep 19, 2012 8:15 am

Re: [Modding] R&D and current findings

Post 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?
Hikori
Posts: 1
Joined: Sun Sep 23, 2012 7:33 am

Re: [Modding] R&D and current findings

Post 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.
buzzyrecky
Posts: 43
Joined: Wed Sep 19, 2012 8:15 am

Re: [Modding] R&D and current findings

Post 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)
swixel
Posts: 80
Joined: Mon Sep 17, 2012 6:08 am

Re: [Modding] R&D and current findings

Post 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 ...
Icehawk78
Posts: 230
Joined: Tue Sep 18, 2012 4:55 pm

Re: [Modding] R&D and current findings

Post 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).
swixel
Posts: 80
Joined: Mon Sep 17, 2012 6:08 am

Re: [Modding] R&D and current findings

Post 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).
Icehawk78
Posts: 230
Joined: Tue Sep 18, 2012 4:55 pm

Re: [Modding] R&D and current findings

Post by Icehawk78 »

The augment removal is specifically looking for having a status_pod, and not looking for the firing of the specific event? Weird.
swixel
Posts: 80
Joined: Mon Sep 17, 2012 6:08 am

Re: [Modding] R&D and current findings

Post 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.
chronial
Posts: 15
Joined: Tue Sep 25, 2012 12:17 am

Re: [Modding] R&D and current findings

Post by chronial »

The structure of the event files: http://ftlwiki.com/wiki/Events_file_structure
Post Reply