Author Topic: Ejection seat script  (Read 5178 times)

0 Members and 1 Guest are viewing this topic.

Offline m!m

  • 211
What do you mean by
Quote
it does nothing to make $Preview work
? If you mean that you can't see the seat model then this is because the model isn't loaded at that point. For the model to be rendered correctly is has or had to be present in the mission as only then the model is actually loaded. Before that you will only see the two circles showing the ejection direction.

 

Offline Alan Bolte

  • 28
  • Deneb III
    • @Compellor
I mean the game still crashes the moment I try to look at a Perseus. I should have clarified that while I don't get actually error messages any more I still get that crash.
Anything worth doing is worth analyzing to death -Iranon

 

Offline m!m

  • 211
:sigh: I have absolutely no idea what could cause this. Can you run it with an attached debugger to get the stacktrace of the crash?
In case you don't know what I mean that look at this tutorial.
Maybe we can track down that error this way.

 

Offline Alan Bolte

  • 28
  • Deneb III
    • @Compellor
After some tests, it is not, strictly speaking, a crash bug. In fact, it will never actually crash to desktop, it just stops responding, and sometimes it'll start responding again if I wait. The issue seems to be specific to the normal cockpit view from a ship with $Preview: if I hit * to look at my ship as I'm flying, or if I'm looking at but not flying a Perseus, then there's no problem. It seems mainly to be a performance problem, although my fps counter never drops below 20. What I'm seeing with the vertical blue line and the occasional blue flash is the preview path of my own ship's ejection. The problem seems most pronounced when I afterburn and make sharp turns.

I'm only guessing because I haven't looked closely at your code, but I suspect that it can't decide whether to render the preview path in front of the camera or not, and somehow that's causing the script to short-circuit or something.

I also tried commenting out the +offset in the config file, and that prevented the lockups. Locating an ejection seat origin too close to the camera is clearly the problem.
« Last Edit: September 21, 2011, 02:35:54 am by Alan Bolte »
Anything worth doing is worth analyzing to death -Iranon

 

Offline m!m

  • 211
I did exactly what you said but I can't reproduce your issue :sigh:
Sorry but if I can't reproduce the bug I can't fix it :(

 

Offline Alan Bolte

  • 28
  • Deneb III
    • @Compellor
It might be hardware dependent, i.e. your computer is better than mine. It might also be OS-specific. My specs:
AMD Athlon II x4 630 processor, 2.8 GHz
Memory: 4 GB DDR2
OS: Windows 7 Professional 64-bit
ATI Radeon HD 4650

Also, do no never see the blue line or big circle from the cockpit view when flying a Perseus with $Preview enabled? That would be a pretty weird difference.
Anything worth doing is worth analyzing to death -Iranon

 

Offline m!m

  • 211
That shouldn't be a problem. I have only slightly better specs than you which all don't matter when you look at FSO (Phenom II X6 at 2.8 GHz, and a HD5770) but well, the $Preview option isn't thought to be activated in a release version of a mod so that may be a small consolation...

 

Offline Alan Bolte

  • 28
  • Deneb III
    • @Compellor
Yeah, it's easy enough to work around and not relevant for non-modders, but I'm as flabbergasted as you are that you can't reproduce it.

Anyway, how easy would it be to switch the player's ship so that they occupy the ejection seat from their fighter rather than blowing up? I'm not aware of how that could be done in FRED, but is it scriptable? I think I remember a mod having the player eject and use that bulky space suit, but I'm fairly certain they switched missions to do that.
« Last Edit: September 21, 2011, 02:02:21 pm by Alan Bolte »
Anything worth doing is worth analyzing to death -Iranon

 

Offline m!m

  • 211
I already thought about how to do this but I only offer some non optimal solutions:
  • Override the dying flag of the player ship, hacky way that will need additional hacks in the FSO Engine (I don't want to do this :nono:)
  • Setting a minimum hull integrity where the player will eject (change player shipclass to seat class and create ship to represent the former player ship that will be killed) but here the player can still die when he gets hit by a weapon that does enough damage
  • Have the player eject manually but the player can still die when he fails to eject in time
Well, not totally perfect but I can't think of a better way currently.

 
It would be cool if you could call a support ship after you eject to have them pick you up. Having a battle raging around you while you wait for SAR. Would the model need a dock point for something like that?
Did you hear that fellas? She says I have a Meritorious Unit.

 
 

Offline Alan Bolte

  • 28
  • Deneb III
    • @Compellor
3 or a combination of 2 and 3 would work well enough for a mod that wanted a 'realistic' or sim-like feeling, yes. However, for something more gameplay oriented or arcade-like, such as emulating the escape pods in Allegiance, you'd have to have option 1 or a close facsimile.

One idea I had for modifying option 2 was to, for example, multiply the player's hp by 10, then cause them to eject when they hit 90% of their total hitpoints. Clearly you'd have to change the hull integrity display on the HUD to correct for that but I'm under the impression we have fairly thorough HUD control these days. I don't know what other effects that might have, though. It'll surely effect damage lightning, but it might affect collisions or I don't even know.

Ideally though, there'll be a percentage hitpoints constant implemented in armor.tbl as in this thread, so we could just combine that with option 2 to emulate option 1.
Anything worth doing is worth analyzing to death -Iranon

 

Offline m!m

  • 211
One idea I had for modifying option 2 was to, for example, multiply the player's hp by 10, then cause them to eject when they hit 90% of their total hitpoints. Clearly you'd have to change the hull integrity display on the HUD to correct for that but I'm under the impression we have fairly thorough HUD control these days. I don't know what other effects that might have, though. It'll surely effect damage lightning, but it might affect collisions or I don't even know.
This will most likely not work as the hull integrity gauges content can't be manipulated from a script.
But I just had another idea that will work without any code hacks, overrides, ... and that would be the usage of ship guardian which will prevent the destruction of the player ship. That way you could set the flag on the player ship in FRED when destruction of the player is not wanted/intended and then set a minimum hull integrity (like 3%) where the player will eject.

  

Offline Alan Bolte

  • 28
  • Deneb III
    • @Compellor
Well between mantis and the armor table thread I derailed I get the impression ship-guardian is a controversial issue. I think I'm just going to back off and let the experienced modders speak, I'm feeling in over my head.
Anything worth doing is worth analyzing to death -Iranon