Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Galemp on October 04, 2002, 10:46:25 pm
-
Have you noticed that everything corvette size and under has the small ship warpout sound and is scannable in one pass, but everything larger has the big warpout sound and scannable subsystems? Is there any way around this? I ask because for the FS1 Port, you need to scan the SD Eva and Lucifer in one shot. But because they're both flagged as 'Capital' they have scannable subsystems. I presently have duplicate entries in the Port tables with them flagged as Corvettes, but this takes up two precious table entries and they have the small ship warp sound effect.
-
Can you scan a capship in one pass if you don't select any subsystems? I thought you could....
-
Nope, one can only scan subsystems on capitals.
Maybe you could just take a free hand with those missions, Your Imperial Highness; having to scan all five major subsystems to finish the mission would make it a little bit more challeging. Challenging = good.
-
You realize, of course, that the Eva is in the area for all of thirty seconds before it jumps out again.
-
No, I didn't.
Umm, make them have to scan one particular subsystem, like nav or weapons or whatever seems appropriate, maybe?
-
Or we could just leave it how it is. I mean, until you pointed it out, I never even noticed they were different.
-
isn't there under 'misc' a 'scannable' option in fred2? There was a mission in derelict (IIRC) that required you to scan the waiting shivan fleet, and I know that there was a few caps in there...
-
I think that was in Derelict, actually (At leat it's the first thing that comes to mind)
-
isn't there under 'misc' a 'scannable' option in fred2?
That's what I'm using.You make it scannable, and you still can't scan the whole thing.
Umm, make them have to scan one particular subsystem, like nav or weapons or whatever seems appropriate, maybe?
That would mess up the voice acting and besides, you just want to target the thing and scan it, not have to cycle subsystems and waste valuable time.
Or we could just leave it how it is.
...this takes up two precious table entries and they have the small ship warp sound effect.
-
Well, I found the culpret on the subsystem thing.
From code\Playerman\PlayerControl.cpp:
if (cargo_sip->flags & SIF_HUGE_SHIP) {
return player_inspect_cap_subsys_cargo(frametime, outstr);
}
Now, a simple way around that would be to comment out that statement. That could break backwards compatability, but should work if you wanted to distribute a custom exe with the mod. A better solution would be if we could have it also check some other flag in addition to that one, one that would be set to false by default and would have to be specifically enabled. (The trick being that AFAIK we can't add any more flags to the current thing without breaking stuff so perhaps a second set of flags in it's own structure might be a nice thing. That way we could add all sorts of other flags that :v: never implimented without screwing up any existing ones.)
-
or we could just make a hack that looks to see the name of the ship or something
-
Ah yes, I knew those were linked somehow!
Perhaps you could add exceptions to that? Say, make Capitals have the huge warp sound but no scannable subsystems. Or make it the other way around, so only Supercaps have scannable subsystems. Change it to if (cargo_sip->flags & SIF_SUPERCAP) {
return player_inspect_cap_subsys_cargo(frametime, outstr);
}
or something. (Edited.)
-
I don't think that code would work. SIF_HUGE_SHIP is a #define that actually expands to mean SIF_CAPITAL, SIF_SUPERCAP, SIF_DRYDOCK, or SIF_KNOSSOS_DEVICE as I understand the #define.
#define SIF_HUGE_SHIP (SIF_CAPITAL | SIF_SUPERCAP | SIF_DRYDOCK | SIF_KNOSSOS_DEVICE)
-
I think, with some small modifications to the above function, parse_ship(), and an additional structure to hold extra flag info, we could create a "hull scan" flag that could be put into the table for ships where you want to be able to scan the entire ship not just the subsystems. The resulting function could look something like:
if (cargo_sip->flags & SIF_HUGE_SHIP && !strstr(extra_flags[cargo_sp->ship_info_index].flags,"HULL_SCAN")) {
return player_inspect_cap_subsys_cargo(frametime, outstr);
}
Then, to enable a ship itself to be scanned rather then it's subsystems you would add an entry to ships.tbl like this:
$Extra_Flags: HULL_SCAN
I'm not completely sure that the ship_info_index is the right variable to use to compare against the list that would be stored in extra_flags though. Ideally the order of the ships in the two lists (one containing all the regular info for a ship type and the other containing the extra info) should be the same so they would have the same indexes. I'm assuming, from what I've been looking at in the source code, that Ship_info is the structure array that basically stores all the ships.tb info. The extra_flags structure would (at the moment) just contain a char [255] for storing the extra flag data. (Don't know enough about the bitwise shift operators to store the flags in an int as is done for the regular flags. A char string is a little easier to use since there is a function designed to stuff strings with data from a table. A char string could also be expanded as needed while an int has a fixed size.)
What I don't know is if this would affect network play at all. And none of this has actually been tested since I've been looking at an old original copy of the source code and don't have a current copy of the fs2_open code. (Assuming it can still be compiled with GCC.)