Alright. Here's the principle.
The game has random enemy spawns. Each time it wants to do one, it runs a certain code, and increments a certain value. Then, that value is used to read data from a ROM offset, which is used to set the amount of enemies to spawn. Which means, if you have different amount of random spawns than the other movie, the amount of enemies to spawn at those random places will differ.
Exactly: MaTo walks through some area in Mission 2 where first random spawns occur to him, so his random spawn counter starts increasing. You don't have any of those until Mission 3, so you 2 start it with different counter values.
The address for that counter is FFC17F. The script shows it, along with some other data I used. See how it's different for your start of Mission 3 and MaTo's.
Conclusion: since it's actually not so random (depends on which areas with random spawns you visit), you can't manipulate it.
Script:
Download Rambo3.luaLanguage: lua
count = 0
function object(base)
id = memory.readbyte(base)
if id == 0 then return end
hp = memory.readwordsigned(base+0x2f)
x = memory.readwordsigned(base+0x18)-130
y = memory.readwordsigned(base+0x14)-130
x1 = memory.readwordsigned(base+0x38)-130
x2 = memory.readwordsigned(base+0x3a)-130
y1 = memory.readwordsigned(base+0x3c)-130
y2 = memory.readwordsigned(base+0x3e)-130
gui.box(x1,y1,x2,y2,"#00ff0040")
gui.text(x-5,y,string.format("%X",base-0xff0000))
--gui.text(x-5,y,string.format("%X\n%d\n%d",id,x+camx,y+camy))
end
gui.register(function ()
camx = memory.readword(0xffc210)
camy = memory.readword(0xffc218)
total = 0
for i = 0xffd000, 0xFFE100, 0x40 do
object(i)
num = (i-0xffd000)/0x40
x0 = num%26*12
y0 = math.floor(num/26)*10
if id ~= 0 and num > 0 then
--gui.line(x0+3,y0+6,x,y,"#ff0000c0")
gui.text(x0,y0,num,"yellow")
total = total+1
end
end
c170 = memory.readword(0xffC170)
c17f = memory.readbyte(0xffC17F)
gui.text(10,230,string.format("TOTAL OBJECTS: %2d CamY: %3d C17F: %X C170: %X Count: %d",
total,camy,c17f,c170,count),"green")
end)
function spawn()
address = memory.getregister("a2")
count = memory.readword(address)
--count = AND(memory.getregister("d7"),0xF)
emu.pause()
end
memory.registerexecute(0xBD1A, spawn)