Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: mjn.mixael on June 25, 2011, 12:09:12 am

Title: Cloaking Device?!
Post by: mjn.mixael on June 25, 2011, 12:09:12 am
So, I had this idea about how to get a working cloaking device in FSO. I started working on it and got pretty close to finished when I learned that this idea had already been explored at least once.. but I figured I'd post it anyway...

Anyhow, I used the change-ship-class sexp and created some ship variations and just swapped between them upon the keypress. I also added a hud element to tell you the status of your cloak. Once I got the basics working, I decided to test it on some Maras. I set it up so that when cloaked they would ignore the player UNLESS the player has fired a weapon within the last 15 seconds. Also, with the cloak on, you don't have shields or afterburners... (That + my horrid piloting skills and the fact that I didn't realize the shield bug at first caused me to not do so hot in this preview video.) Also, I cut out the latter half of the mission test because I figured you guys didn't really want to watch 12 minutes of me shooting Maras...  :lol:

Anyhow, I fixed the shield thing and am uploading a small modpack so you can rummage through it and see how I pulled it off.

Lastly, I was more interested in seeing if the idea would work so the actual cloaking effect is sub-par at best, IMO. Were I to actually use this in a campaign, I would make a cooler effect.

here's the Youtube video. (http://www.youtube.com/watch?v=pDlXmS4B-Gc)

Here's the link to the modpack. (http://www.mediafire.com/?xg6ythgvzceo8pz)

EDIT: In retrospect, I might see what I can do about the engine flares dissapearing... And I would consider a texture trick to distort the cloaked ship rather than have it purely invisible.

EDIT2: I forgot to unflag 'invulnerable' for Alpha 1 when I zipped this up. I'll upload a new version soon.
Title: Re: Cloaking Device?!
Post by: Vertigo 7 on June 25, 2011, 12:46:33 am
badassery at work, ladies and gentlemen.
Title: Re: Cloaking Device?!
Post by: mjn.mixael on June 25, 2011, 01:54:22 am
Here's another look at the effect. (http://www.youtube.com/watch?v=fzu4yc-exF0)

EDIT: also, here's a new version of the mission file that fixes a few bugs with the system. (Secondary ammo and whatnot) It's now in the main pack linked in the OP.
Title: Re: Cloaking Device?!
Post by: Deadly in a Shadow on June 25, 2011, 03:28:20 am
Do you know what is cool?

That.
Title: Re: Cloaking Device?!
Post by: Spoon on June 25, 2011, 08:20:03 am
Here's another look at the effect. (http://www.youtube.com/watch?v=fzu4yc-exF0)

EDIT: also, here's a new version of the mission file that fixes a few bugs with the system. (Secondary ammo and whatnot)
Good sir, this looks absolutely stunning.
I hereby declare my intent to use this awesomeness and humbly request your permission
Title: Re: Cloaking Device?!
Post by: Trivial Psychic on June 25, 2011, 08:54:40 am
The ideal combat method under those kinds of power restrictions would be to either get in close and hammer a target with combined primary and tempest fire, or to hit them one by one with volleys of Tornadoes.  After each kill, evade for the required 15 seconds and then line up for the next kill.

Most sci-fi *cough*Star Trek*cough* have different cloaking restrictions, with weapons being usually disabled, and sometimes shields being allowed.  You may wish to create a secondary mod for these possibilities.
Title: Re: Cloaking Device?!
Post by: mjn.mixael on June 25, 2011, 09:03:29 am
I posted the files here so people could use it. The shields restrictions I put in there are just what I came up with for the test. It's mostly done with sexps, so you can easily just go in and change what the restrictions are.

Spoon, if you want nifty cloaking animations for some ships... I'd be happy to make something nicer for you.

EDIT: Yeah, I really don't have a place for this in my projects currently. I guess I'm putting the idea out there for other campaign creators to use. You could probably do some pretty interesting things with it to make a mission unique.
Title: Re: Cloaking Device?!
Post by: Angelus on June 25, 2011, 10:11:31 am
that's awesome, MM. But y is i not allowed to DL the second mission you attached?
Title: Re: Cloaking Device?!
Post by: Dragon on June 25, 2011, 10:20:24 am
It's in the main pack now.
Title: Re: Cloaking Device?!
Post by: Spoon on June 25, 2011, 12:57:06 pm
I posted the files here so people could use it. The shields restrictions I put in there are just what I came up with for the test. It's mostly done with sexps, so you can easily just go in and change what the restrictions are.

Spoon, if you want nifty cloaking animations for some ships... I'd be happy to make something nicer for you.

EDIT: Yeah, I really don't have a place for this in my projects currently. I guess I'm putting the idea out there for other campaign creators to use. You could probably do some pretty interesting things with it to make a mission unique.
Of course, I'll gladly accept that offer  ;7
Title: Re: Cloaking Device?!
Post by: mjn.mixael on June 25, 2011, 06:55:55 pm
Yeah, just let me know.

Also, here's yet another update to the mission that allows you to choose your weapons.

Check out the mission file to see how it works, but essentially because the sexp tree uses change-ship-class, it would reset the weapons to the default weapons for the ship when you cloaked or decloaked. This mission though has a way around that, so you can choose better weapons.

Perhaps it's because I'm a terribad pilot, but I've yet to beat this with a high enough hull percentage to get the special commendation. (Nothing fancy, just a congrats in the debrief.)

[attachment deleted by ninja]
Title: Re: Cloaking Device?!
Post by: T-Man on June 27, 2011, 02:24:15 pm
*drooool followed by manic evil laughter*

I love the energy effect as it phases in and out; has a nice polish to it. The predator-like effect (where it can still be made out but is invisible) is cool too. Imagine a lot of mods will be grabbing this! :)
Title: Re: Cloaking Device?!
Post by: Goober5000 on June 27, 2011, 11:50:03 pm
Well, when I first posted about this capability eight (http://www.hard-light.net/forums/index.php?topic=12640.0) and five (http://www.hard-light.net/forums/index.php?topic=40783.0) years ago, the only mod that grabbed it was WCSaga -- and then only after I posted the second thread. :p

It might have better luck this go 'round because mjn.mixael posted something a little more fleshed out than a proof of concept.  His mission actually makes the weapons and AI dependent on whether the ship is cloaked or not. :yes:
Title: Re: Cloaking Device?!
Post by: Spoon on June 28, 2011, 05:33:05 am
It might have better luck this go 'round because I'm here (and I wasnt in 2003 and 2006)  :p

Right now I'm kinda waiting for the replace texture sexp Zacam is working on. That should prevent the need for 4 seperate pofs, table entries and the whole sexp tree needed to keep the weapons&ammo count for the player.
Title: Re: Cloaking Device?!
Post by: yuezhi on July 01, 2011, 12:25:37 am
suppose an awacs ship was called in to deal with the stealth ship. What happens when the awacs activates? I'm guessing either the electronics disable the cloak or the ship provides friendlies with sonar vision, so to speak (thinking about bats).
Title: Re: Cloaking Device?!
Post by: mjn.mixael on July 01, 2011, 12:30:08 am
Either are easily possible with the current setup... which would you prefer that I add to the test mission?
Title: Re: Cloaking Device?!
Post by: Commander Zane on July 01, 2011, 01:23:54 am
Personally I'd go with the second option, which could be compared to detector units in Starcraft allowing units to target cloaked units, since whatever band of waves being used by the AWACS sensors (For the sake of having some sort of explanation) isn't going to directly botch the cloaking device, and it wouldn't make much sense if the AWACS was using EMP bursts to do the job since that would mess everyone's everything up.
Title: Re: Cloaking Device?!
Post by: mjn.mixael on July 01, 2011, 01:46:26 am
Well since this whole pack is a proof-of-concept.. I did a little bit of both. The AWACS will disable your cloak when it arrives. Destroy its radar dish to restore it. However, as long as it lives the enemy wing will be able to gain an intermittent lock on you.

Download updated in first post.
Title: Re: Cloaking Device?!
Post by: Black Wolf on July 01, 2011, 03:04:47 am
You should have used a bigger ship. :p
Title: Re: Cloaking Device?!
Post by: yuezhi on July 01, 2011, 04:19:19 pm
Either are easily possible with the current setup... which would you prefer that I add to the test mission?
my first option sounds simpler but the concept of sonar vision sounds cool
Personally I'd go with the second option, which could be compared to detector units in Starcraft allowing units to target cloaked units, since whatever band of waves being used by the AWACS sensors (For the sake of having some sort of explanation) isn't going to directly botch the cloaking device, and it wouldn't make much sense if the AWACS was using EMP bursts to do the job since that would mess everyone's everything up.
your statement reminds me of the eurocopter tiger featured in goldeneye. Not sure if EM immunity on large military equipment is possible on our planet anyways.
Title: Re: Cloaking Device?!
Post by: mjn.mixael on July 02, 2011, 07:50:58 am
I thought of something interesting just now that I'm going to try to implement when I get a chance.. What happens if you die?!

I dawned on my that it would seem pretty silly if your ship exploded and the death cam showed your hull pieces in their cloaked or glowing stage..

The simple fix would be to force decloak at 5% or something.. but I need to play a bit to see what can be done.
Title: Re: Cloaking Device?!
Post by: jr2 on July 02, 2011, 11:44:51 am
How about sort of like with the shield generator subsystem, if it gets damaged too much, the shield is intermittent, if it's almost dead, it fails?
Title: Re: Cloaking Device?!
Post by: yuezhi on July 02, 2011, 03:54:40 pm
i have a problem with this mod. I select the mission and i get an instant CTD
Code: [Select]
Unrecognized operator.

In sexpression: ( when
   ( true )
   ( hud-gauge-set-active
      "MinesGraphic"
      ( true )
   )
   ( hud-gauge-set-active
      "MinesNumber"
      ( true )
   )
   ( hud-set-text "MinesNumber" "Off" )
   ( hud-set-text
      "MinesGraphic"
      "Cloak Status"
   )
   ( send-message
      "#Command"
      "High"
      "CloakInstructions"
   )
)
(Error appears to be: hud-gauge-set-active)
ntdll.dll! KiFastSystemCallRet
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_6_12r_sse2.exe! <no symbol>
fs2_open_3_6_12r_sse2.exe! <no symbol>
fs2_open_3_6_12r_sse2.exe! <no symbol>

and then
Code: [Select]
         "0"
         "Tornado"
      )
      ( modify-variable 1[] "Tornado" )
   )
   ( when
      ( has-secondary-weapon
         "Alpha 1"
         "0"
         "Harpoon"
      )
      ( modify-variable 1[] "Harpoon" )
   )
   ( when
      ( has-secondary-weapon
         "Alpha 1"
         "1"
         "Rockeye"
      )
      ( modify-variable 2[] "Rockeye" )
   )
   ( when
      ( has-secondary-weapon
         "Alpha 1"
         "1"
         "Tempest"
      )
      ( modify-variable 2[] "Tempest" )
   )
   ( when
      ( has-secondary-weapon
         "Alpha 1"
         "1"
         "Tornado"
      )
      ( modify-variable 2[] "Tornado" )
   )
   ( when
      ( has-secondary-weapon
         "Alpha 1"
         "1"
         "Harpoon"
      )
      ( modify-variable 2[] "Harpoon" )
   )
)
(Error appears to be: has-primary-weapon)
File: missionparse.cpp
Line: 5388

ntdll.dll! KiFastSystemCallRet
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_6_12r_sse2.exe! <no symbol>
fs2_open_3_6_12r_sse2.exe! <no symbol>
fs2_open_3_6_12r_sse2.exe! <no symbol>
Title: Re: Cloaking Device?!
Post by: mjn.mixael on July 02, 2011, 04:02:09 pm
Use a newer build. Looks like 3.6.12 didn't have those sexps available.