View Single Post
  #3  
Old 06-03-2010, 06:31 AM
Trucidation
Guest
 
Posts: n/a
Arrow

Moved the discussion from the first post to reduce clutter. This post will be updated as I figure out more stuff about missiles.

Note: It's possible to add new missiles and not just replace LRMs like I did (because I felt they were not useful). I don't think there are any hard limits and in any case there aren't that many missile types anyway. I don't have enough graphics to do that however, as you can see I managed to dig up 4 unused graphics but that's about it, there isn't really any more so you'll have to recycle graphics from existing missiles or import your own.

Custom sound effects for each explosion are also pointed by the esc file referenced by the related explosion script. I wanted to do this too but I don't have any good explosion sfx currently. Damn, where was that Crusader: No Remorse sound pack...

-
1) The bulk of the work is in \Data\Game\'s Modules.xml and Rockets.xml files. Each missile has one entry in Modules.xml, this is like the entry for the trade interface so you have stuff like cost in here. By the name you can also figure out it's not just for missiles so there isn't much here. Each missile entry references a missile definition and detonation definition.

2) Continuing from (1), Rockets.xml is where you define the missile and the detonation. Since I created cluster weapons, I needed two pairs of definitions: one for the parent delivery vehicle, then another for the payload.

3) \Data\LocData\English\ merely contains an edited m_modules.loc, which is basically the text descriptions which show up in trade. That's what you read in the screenshots below. By the way, the missile icons are in Modules.xml mentioned in step (1), look for the flat_image line in each entry.

4) The rest of the mod is new files for the custom explosion colours. It's very simple actually. In Rockets.xml mentioned in step (1) each detonator has an explosion script linked to it. So what I did was simply clone the default rocket_explosion script and the exp file that script points to, and then edit the RGB colour value of the flare. There are 4 because I created one for each missile type, so all four of them have different colours.

Very straightforward

5) In the explosion exp file referenced by the explosionscript esc, editing the FlashLiveTime will change how long the flare stays (we know it's the explosion flare because that section has a reference to a dds which you can view). Below it, FlashLiveTimeSpread seems to be how long each frame of the flare lasts. Since there's only 2 frames, simply divide the FlashLiveTime by 2.

6) Some rocket and detonator definitions are shared. This can be a huge gotcha as I deleted the detonators from rocket definitions I replaced. The game didn't complain because I suspect it doesn't actually check the script until you actually fire the missile. You'll probably get a CTD. There'll likely be an entry in ScriptErrors.log or LOGfile.txt, so if this happens to you please post the contents of these files here; thanks!
Update:
This should not happen anymore because I only add new entries now, without deleting existing ones. Just remember this note if you're making your own missile mods.

7) The game actually has code to handle multiple missile launches, not just single-parent-with-multiple-warhead MIRVs. They're named MultiRocket and they're basically defined the same as other rockets except with the addition of a rocket_slot entry, which defines how many rockets are subtracted from the total in max_rocket_count per launch. So if you have max_rocket_count=20 and rocket_slot=4, you'll fire 4 rockets per launch for a total of 5 launches (4 x 5 = 20). By the way, MultiRocket's RocketParams can be set to launch MIRVs and not just regular rockets, so you can actually create multiMIRV launchers. Better beware of the total damage though :p

8 ) Explosion sound effects are also in the explosion exp file referenced in step (5), it seems you can assign one to each fx frame.
NOTE: All sounds must be in mono format or the game will not play them! So if you have any stereo sounds make sure to mix them into mono.

9) MultiRockets appear to be logged - they will show up in LOGfile.txt. The problem is timestamps are not attached. They simply show something like:
Code:
[MULTI_ROCKET] - IDLE
[MULTI_ROCKET] - SEEKING
[MULTI_ROCKET] - FIRE
[MULTI_ROCKET] - IDLE
...and it goes on for literally hundreds of lines. The original game didn't have any working MultiRockets, I assume there were bugs they couldn't fix so they took them out. The only bug I've seen is most likely performance related - I only experienced in the large endgame battles when there were like 100+ ships in the entire sector. Game CTDs but LOGfile.txt doesn't mention any specific error, it just complains about "memory access violation blahblahblah". WARNING: You may want to avoid using the salvo skill especially if you have MultiRocket MIRVs installed. No, I haven't tried it - but have you seen how salvo works? It launches like half the entire missile pod in one shot, especially noticeable if you're using those 32x dumbfires. I imagine if you activate it with my high-end MultiRocket MIRVs (the HR or the KS models), you'll most likely notice an immediate drop in the framerate and I assume you may even CTD. (I bet if this happens you'll see a lot of those MULTI_ROCKET entries and a final "memory access violation" complaint at the end of LOGfile.txt).

10) There is a limit to how many MultiRockets can be launched! Maximum observed appears to be 10. You can define a larger number in rocket_slots but the game will only ever 10 at one go, and less if the target happens to fly out of firing angle/range.

11) Missile speed has an effect on the impact - kinetic energy appears to be transferred, I've seen stationary targets get blasted aside when hit by multiple warheads travelling at high speed. I use pretty small warheads though (I simply cloned existing ones), but if I'm not mistaken there are values for mass. It may be prudent to keep those values low otherwise your targets will scatter as if hit by a bowling ball when the missiles hit them.

Last edited by Trucidation; 06-18-2010 at 01:15 AM. Reason: Added note 11 about missile speed and impact
Reply With Quote