Hard Light Productions Forums

Hosted Projects - Standalone => Diaspora => Diaspora 3rd Party Missions, Mods & Campaigns => Topic started by: festivefire on November 01, 2012, 05:18:04 pm

Title: freding an eject?
Post by: festivefire on November 01, 2012, 05:18:04 pm
Is it possible to script an custom key command that will spawn a viper pilot outside of your vessel and switch it to the player vessel, for ejects in missions?
Title: Re: freding an eject?
Post by: MatthTheGeek on November 01, 2012, 05:20:06 pm
Sure is. key-pressed to capture key input, change-ship to change player ship to viper pilot, ship-create to re-create your viper that you just switched from.
Title: Re: freding an eject?
Post by: festivefire on November 01, 2012, 05:33:39 pm
cool, thanks! time to fred! if i can get a test eject working that i like, ill upload it.
Title: Re: freding an eject?
Post by: festivefire on November 01, 2012, 05:39:17 pm
actual i just realized i can dock a seat inside the cockpit of hte viper, so is there a way to change which active ship is the player? that way i can just switch focus to the seat and undock it with an upwards velocity. i kinda think this would look better than if you changed the ship to a ejected seat and spawned a new viper.
Title: Re: freding an eject?
Post by: General Battuta on November 01, 2012, 05:40:27 pm
There is no way to do that.
Title: Re: freding an eject?
Post by: General Battuta on November 01, 2012, 05:56:21 pm
The change-ship-class idea Matth proposed will work wonderfully though!
Title: Re: freding an eject?
Post by: festivefire on November 01, 2012, 06:11:50 pm
i will build matth's, but i would like to try both if the other is possible.
Title: Re: freding an eject?
Post by: General Battuta on November 01, 2012, 06:48:21 pm
It isn't.
Title: Re: freding an eject?
Post by: festivefire on November 01, 2012, 07:02:58 pm
IDEA! i can just dock a new viper to the pilot after changing the player to a pilot so it looks like you are shooting out of the cockpit
Title: Re: freding an eject?
Post by: karajorma on November 01, 2012, 08:13:20 pm
If you're FREDding ejection as a mission specific plot point, what you're doing so far sounds great. If you want to include the ability to eject in all your missions, read this to see why we didn't do it (http://www.hard-light.net/forums/index.php?topic=82325.msg1643211#msg1643211).
Title: Re: freding an eject?
Post by: festivefire on November 01, 2012, 09:02:13 pm
i already read that thread and i get why you didnt' include it, but i think i am only going to unlock the key control if your craft goes critical, and you still die if an evac raptor doesn't pick you up before mission end. you can also still fail the mission if your wingmen can't complete enough objectives, so its not an instant mission win.
Title: Re: freding an eject?
Post by: karajorma on November 01, 2012, 09:14:30 pm
Just wanted to make sure you knew the potential pitfalls. Have fun.
Title: Re: freding an eject?
Post by: festivefire on November 01, 2012, 09:37:03 pm
thank you, i will  :)
EDIT: i am having trouble with the name of the new viper. any time i try to save the mission i get an error telling me that the name of the viper is causing a problem, however the mission runs fine as long as you run it in debug mode. does FRED not realize i am creating a new ship and just assume the ship name doesn't exist?

the event:
(http://i.imgur.com/EmXHW.png) (http://imgur.com/EmXHW)

the error:
(http://i.imgur.com/QeAM0.png) (http://imgur.com/QeAM0)

EDIT: changed the photos to imgur links, they should work now.
Title: Re: freding an eject?
Post by: MatthTheGeek on November 02, 2012, 02:35:44 am
I don't see neither the event nor the error. Can you post a debug log ?
Title: Re: freding an eject?
Post by: karajorma on November 02, 2012, 03:10:25 am
The site you've uploaded it to won't give us permission to view the images.
Title: Re: freding an eject?
Post by: festivefire on November 02, 2012, 09:04:58 am
Sorry I will fix that when I get home.
EDIT: fixed it during Spanish class.
Title: Re: freding an eject?
Post by: festivefire on November 03, 2012, 12:21:27 am
bump. still need some help please.
Title: Re: freding an eject?
Post by: karajorma on November 03, 2012, 12:47:04 am
I'm guessing FRED doesn't like the name containing Alpha 1. Do you have to use that name?
Title: Re: freding an eject?
Post by: festivefire on November 03, 2012, 11:25:59 am
no, ill try just using splash1, to signify a crashed or abandoned viper.
EDIT: nope, that didn't work, now i get the same error for splash1
EDIT again:
this is the error i get when i run the mission ingame, if this helps anyboy:
Code: [Select]
Invalid point.

In sexpression: ( when
   ( key-pressed "\" )
   ( change-ship-class
      "Viper Pilot"
      "Alpha 1"
   )
   ( ship-create
      "splash1"
      "Viper Mark VII"
      0
      0
      0
   )
   ( set-object-position
      "splash1"
      ( get-object-x "Alpha 1" )
      ( - ( get-object-y "Alpha 1" ) 5 )
      ( get-object-z "Alpha 1" )
   )
   ( set-object-speed-y "Alpha 1" 25 )
)
(Error appears to be: splash1)
KERNELBASE.dll! ReleaseMutex + 91 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
FS2_Open_Diaspora_R1.exe! <no symbol>
FS2_Open_Diaspora_R1.exe! <no symbol>
i did run it in debug, but the event.log only  said mission loaded, so the mission runs fine, it just doesn't want to load the event.
Title: Re: freding an eject?
Post by: General Battuta on November 03, 2012, 12:11:28 pm
If you ship-create a ship I believe you'll need to store its name as a var or argument, then reference that var or argument rather than the name directly.
Title: Re: freding an eject?
Post by: festivefire on November 03, 2012, 01:27:19 pm
so if i rigth-click and click add variable on the event, and save alpha 1 splash or whatever i name it as a variable it should work? I'll try that. thanks!
Title: Re: freding an eject?
Post by: festivefire on November 03, 2012, 02:46:27 pm
Ok so that worked, the mission runs fine with no errors now. i added a camera shake to the eject, but it is rather hard to see the crashed viper as it zooms away. it seems to have allot less motion damping than the viper-pilot (and the engines are disabled and the AI is off, so its not the AI flying away)
the only thing i really want to do now to finish it up is add the afterburner sound when you eject, so if anybody knows the file name for that i would very much appreciate it.

EDIT: if you want to try it out and give suggestions on the eject, here is a mission with the eject event added for the players viper. there are two waves of raiders, ion, and fractal which has missiles. tell me what i could do to make it work better or look better. EDIT again: the key to eject is / on the numpad.

[attachment deleted by a basterd]
Title: Re: freding an eject?
Post by: festivefire on November 04, 2012, 03:22:04 pm
is there a FRED command to activate an animation on a ship? like for instance, opening a raptors door, so it can recover a lost pilot? if so please tell me where, because i can't find it right now.
EDIT: I started coding in a raptor recovery for the ejected pilot, but the raptor never follows the orders given to it in the event. It is supposed to warp in, and after it warps in it is supposed to approach alpha 1, the now ejected pilot. the door should open, and then the raptor is supposed to dock with the pilot so it is flush with the electronic warfare officer's chair. after the raptor warps in, it ignores the orders its given and either shoots raiders, or if my wing mates have already killed them, it just flies around doing nothing.
the event:
(http://i.imgur.com/01Mte.png?1)

Title: Re: freding an eject?
Post by: karajorma on November 07, 2012, 09:54:31 pm
Best advice I can give it to take a good look at how we did it in Mission 3.

I am wondering if you're having issues because Alpha 1 isn't a viper by that point.
Title: Re: freding an eject?
Post by: festivefire on November 08, 2012, 04:13:04 pm
does it matter that alpha 1 isn't a viper? alpha 1 isn't the one docking, the raptor is. ill check out what you did in mission 3 though.
Title: Re: freding an eject?
Post by: karajorma on November 08, 2012, 06:19:01 pm
What matters is how the docking code works. At some point the game has to convert the docking point you've written down into an index into the array of docks for Alpha 1. If at that point it still thinks alpha 1 is a Viper, it will never find the correct dock.

Without looking at the code I can say that I think what you have should work, but there is a slight possibility that it's actually impossible to do things that way.