modding missions

Corrodias

Generally Awesome
If i want to make a change to Mission 02, i find m02.lua in m02_modal.str2_pc.

That's fine... putting the .lua file itself into the SR3 folder doesn't seem to make any change, but re-packing the .str2_pc file does.

But... how do i know what .asm_pc file(s?) i need to update? I assume i need to update one because it just crashes when loading the mission, as it is.
 
I can only tell you what I tried and failed, as well as confirm what you tried.

Repacking the str2 file causes crash, as well as repacking the entire sr3_city vpp. I kept my changes simple so it wasn't any problem in syntax. I was loading missions in the sr3_city_main function, but this was working fine before changes.

I dug through a few of the asm files within sr3_city and have yet to find anything hidden pertaining to the missions aside from the data as it's labeled.

Best of luck to anyone else looking for how to modify these files, please report anything that might help.
 
I tried updating every asm_pc file in the sr3_city_0 file, but i don't think it was actually able to update any. Lots of unsupported primitive types.

stream_grid.asm_pc mentions m02.lua by name. It's probably the only file that needs to be updated. Gibbed's UpdateASM claims an error, unsupported primitive type 17.

What, precisely, is UpdateASM supposed to do when you run it on an asm_pc file? I can convert it to XML and i see that this is what it says regarding m02.lua:

<PrimitiveEntry>
<Name>m02.lua</Name>
<Type>32</Type>
<Allocator>0</Allocator>
<Unknown3>0</Unknown3>
<Unknown4>0</Unknown4>
<HeaderSize>141847</HeaderSize>
<DataSize>0</DataSize>
<Unknown7>0</Unknown7>
</PrimitiveEntry>

Edit: I'd like to think that the answer seems to be merely that it's updating the HeaderSize field with the file size. If i can keep the size of the m02.lua file the same, then i don't have to update the asm_pc file. However, changing the size of the .lua file, updating the value in the asm_pc XML, and converting the XML back to asm_pc, then putting everything in the sr3 folder still crashes.

And there's got to be more to it than just that, because i also can't just make ANY changes i want. Apparently i have to be very careful. I was able to change a == to a ~=, but i couldn't comment out several lines.
 
I know nothing of the asm file structure, so this is speculation, but I think it tracks the compressed position of the other files, so you would somehow have to update the rest of the positions for the change in file size as well.

But based on that, I followed your idea of not changing the file size and was able to make some mission changes. It involved not changing the file size, as well as not changing the compressed file size. Accomplished by deleting comments and replacing with code, and then mucking about with the comments to make them more or less compressable until I got to the exact file size.

Not much to learn from this, but it at least allows you to play with some things. I played with m16, don't turn into a toilet at very start to see that the mission is changed, this was just commented out. At the end of the mission when you turn into the avatar, you will be teleported to the mission exit point, and can run around as a bahamut avatar in the streets. The kill decker checkpoint is timed, so if you reset to checkpoint you'll continue the mission.

The avatar works as he does in the mission, but I know when I jumped in the water he definitely broke.
 

Attachments

I was able to make the tiny change i needed to, to help a couple of people whose "shoot out the plane window" in mission 2 didn't work.

I think you're right about positions. Each of these primitives seems to be in a ContainerEntry, which has a CompressedSize and a DataOffset. It'd be nice if the UpdateASM tool could handle this file. I'll think about this more. I'd try updating the CompressedSize of the container, too, but i'm not sure just what that's a measure of.

edit: CompressedSize matches offset 0x168 in the str2_pc file, 16-bit or 32-bit little-endian integer. There's also a <Sizes> tag that contains another copy of the size of the m02.lua primitive that has to be updated. Once all 3 numbers are changed... boom! It works.
 
Glad to hear you got that working properly, I'm sure it's in the works for UpdateASM, just takes time and thanks to Rick for all his work so far. Make sure you're also using up to date releases, as just reading he added more type supports on the 25th, r69.

edit: The way this specific asm file works I'm not even sure where to begin with UpdateASM, as it doesn't even seem to pair with a single container.

I am curious what you're using for editing the xml file as it gave Notepad++ lots of trouble with it's 80 MB size.
 
I was using Notepad++, all right. It takes a while, but it works if you let it sit a while.

I downloaded the latest source for UpdateASM and i'm trying to add adding the necessary data types, at least for my copy. Rick will be more than welcome to examine and include my changes if he wants to. Of course i won't commit them without permission, if that's even possible.
 
I've added support for all data types used by stream_grid.asm_pc. As far as i can tell, it's working nicely. I was able to change whatever i wanted in m02.lua.
http://www.mediafire.com/?5xb6dc65qlmqw

The files required by this asm_pc file are the entire contents of both sr3_city_0 and sr3_city_1, so extract them into the same folder and point UpdateASM at it when updating your stream_grid file for mission changes.
 
You only need to point UpdateASM to a directory with str2_pc files that have changed, it will leave files that are missing alone (and assume they have not been touched).
 
Back
Top