Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Goober5000 on July 01, 2006, 01:26:19 pm
-
I posted about this ages ago, back when the change-ship-model and change-ship-class sexps were first added, but as usual very few people paid attention, despite repeated encouragement. So I finally decided to post an example of how they might work.
http://fs2source.warpcore.org/temp/cloaktest.zip
Unzip the file to a regular FS2 install running no mods (mediavps are okay). Run the "Cloaking Test" mission. Press 1 to cloak the Pegasus, and 2 to decloak it. :)
-
:eek2: :eek:
You Sir, are a true god, and my hero for today :)
http://wcsaga.com/~team/Starman/downloads/cloak.avi
You are right, I completly must have missed your first post :) , but this is (mostly) what I always wanted. I don't care that it needs a bunch of SEXP to work (our first autopilot version or deathscream were birth exactly the same way )
Adding a sound to the cloak/decloak action will be no problem, only thing that remains is the engine glow. Since we aren't using the thruster-anis anymore they are one problem less, but is it possible to turn the glows and thruster off without making the ship getting "disabled" ?
-
I'm no god, but I'm pleased to be a hero. :D
There's already an electric spark sound effect in the example (unless you're using an old build with broken sound). I don't think you can turn off the thrusters via sexp, but what you could do is rename the thruster texture in the model to "invisible" instead of "thruster01".
I should mention that the animation is supposed to gradually fade out instead of flickering. The animation appears to run much faster when it's a texture than when it's a cbani. I don't know if this is a bug or something I missed.
-
If you want my input, I'd say leave it. The flickering looks just as good as a transition as a fade-out/-in would.
-
I second that, the flickering is actually a nice effect. I was always used that the cloaking isn't immediately, but that it takes a few seconds. So it's just a matter of how the ani-file will be created
It will require some tryouts of how many conditionals I can pack into one event before it breaks. What additionally will be needed, is that the cloacked ship is not allowed to fire, but at least for enemy ships that shouldn't be hard.
Removing/renaming the thruster is also a solution, since they are all different models.
Pls tell me, does the deactivation of the glowpoints and removing of the thruster texture resulting into a disabled ship, or is this just a question of the destroyed engine-subsystem (of course the cloacked ship must be able to move).
BTW, your post has another nice sideeffect. I wasn't aware that you can use anis to texture a model. Now I know how the TBP guys made those cool glowing debris :)
-
The catch is getting the AI for non player ships to not react to the presence of the player if/while the player is cloaked.
-
This can be done with scripting, i.e. "Ignore Alpha 1" etc. However, I see this function more suitable for AI-Ships
-
Pls tell me, does the deactivation of the glowpoints and removing of the thruster texture resulting into a disabled ship
No. A ship is disabled if and only if its engine subsystem is destroyed.
-
Most excellent, than I will further work on this stuff and create the necessary content. Thanks again very much for showing us how to do that :)
-
*bows before Goober5000* All hail the SCP god! :D
Getter Robo G will be happy to see this, if he ever does. :D
-
Yays, prepare yourselves for phasing in battlecrabs :yes:
-
Yays, prepare yourselves for phasing in battlecrabs :yes:
Hooray! Happy-happy-joy-joy thinking that makes me feel all tingly :D
-
I am astonished. How many other SCP features are going unused because people aren't experimenting with them?
And don't say it's lack of documentation. I'm pretty sure all the features in this thread have been documented for at least a year. :p
-
It's because, for example, whilst everyone was struggling to come to terms with the Animation code, about 3 features appeared in the SCP that I totally missed. Personally, I think new stuff gets added to the CVS very rapidly, and particuarly for campaigns, this can cause a lot of consternation for people to use all the features. I'm fine with going back and HT&Ling my stuff for TI, but then, I'm not going to go back again and start adding bits for animation on a lot of the models, not because I don't appreciate the feature, but because if I keep going back and tweaking everything for each new feature, I'm never going to finish anything ;)
-
It's also a question of not seeing the whole picture, that's something you coders have an advantage against us :)
While I know this change-ship class quite some time (I use it for having the battlegroup vanish out when you move away with autopilot to increase the illusion of great distances), I simply didn't get the idea of using that for the cloaking because I was missing a vital piece, the animation.
And I didn't knew that it is possible to use an animation as a texture (though thruster is using it too). Sometimes you need a person that bangs your head against the obvious :D
-
If I'm seeing this right, poor man's cloaking requires 3 POFs with 3 table entries, right ?
-
4 pofs and 4 table-entries, if you count the standard model with them.
Normal textured model
cloaking model (animated)
cloaked model (invisible)
decloaking model (animated).
-
any chance you could to the same thing with texture replacement or render to texture? with scripting you take an existing ship texture, and then adds an alpha chanel (or modifies an existting alpha chanel). the script would slowly fade the alpha chanel to the desired opacity. with texture replacement you could have a series of textures, each with less opaque alpha chanels, and slowly go from one to another to another.
-
Okay, I spent the past few days confirming that the incorrect animation speed is in fact a bug, and fixing it accordingly. The next CVS or release candidate build will have proper animation support, which means that the Pegasus cloak effect supplied in my example will take the full 1 second, as designed. :)
-
You mean as intended. :) I still rather like the exisitng effect. And idea might be, why not allow both? Let the AI ships have the "instant on" cloak and (should a mission or campaign evolve around the usage of cloaking) the players ship after "aquiring" the technology (imperfectly, of course) have it do the effect in the video. Or would the effect in the video even still be possible?
-
Good one Goober. I first thought the animation was simply to short (which would mean making more frames for a longer animation ) That will save me a lot of work. :)
-
An idea might be, why not allow both? Let the AI ships have the "instant on" cloak and (should a mission or campaign evolve around the usage of cloaking) the players ship after "aquiring" the technology (imperfectly, of course) have it do the effect in the video. Or would the effect in the video even still be possible?
The cloaking effect is entirely dependent on the animation. If you want a flicker, you can have a flicker. My fix just makes the animation do what you intend it to do.
-
Is the animation a fade/flicker to an alpha channel?
V nice effect but i would like to see the specs/readme so i can have a go at makin an effect if poss many thanks :D
-
make 2 effects, something for Freespace and the wavy thing in Star Trek. :nervous:
-
any chance you could to the same thing with texture replacement or render to texture? with scripting you take an existing ship texture, and then adds an alpha chanel (or modifies an existting alpha chanel). the script would slowly fade the alpha chanel to the desired opacity. with texture replacement you could have a series of textures, each with less opaque alpha chanels, and slowly go from one to another to another.
I think so. Just make a new texture, assign it to the ship's slot. Then every frame, clear the texture to black, and redraw the original texture on it with a decreasing opacity value. (gr.setOpacity()).
EDIT: Actually, that's incorrect. You'd need to completely clear the texture to...completely clear. Not sure how you'd go about doing that, though, hmm.