Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Dragon on September 12, 2010, 01:54:09 pm

Title: Custom warp effects not working
Post by: Dragon on September 12, 2010, 01:54:09 pm
I've been recently trying to add a custom warp effects, using customized warpin and warpout entries in ships.tbl.
Unfortunately, it simply doesn't work, the ship is still using default jump effect (I'm using 3D warp and Warp Flash).
http://www.mediafire.com/?mekhp158160p2lh
I've made a mod that adds the custom warp effect and sounds to Aeolus, (pressing "1" calls it in).
Debug doesn't comaplain in any way.
Title: Re: Custom warp effects not working
Post by: Iss Mneur on September 13, 2010, 01:33:58 pm
It seems that $warpout animation: and $warpin animation: are ignored by default warptype.  Only Galactica and Homeworld warptypes use $warpout animation: and $warpin animation:.
Title: Re: Custom warp effects not working
Post by: Dragon on September 13, 2010, 02:15:38 pm
I see, I'm going to try "Homeworld" warp style.
I think that there is a potential for improvement there, I can see many potential uses for customizing "default" style warp effect.
It would be great if SCP could add something like $warpin model: , which would allow customization of 3D warp effects.
Of course, I'd also like to see similar functionality for warpouts, especially that in this case, there's no way to add a custom effect to warpout without setting it to "Galactica" style.

Also, the wiki entry states something like this:
Code: [Select]
$Warpout Speed:
FS2 Open 3.6.10:
Sets the speed at which the ship warps out for default warpout effect
Sets the time that the ships warp out (not the animation itself) takes for BTRL type warpout effects
Syntax: Float, meters per second or milliseconds
It doesn't work as described, ships with "Galactica" (former BTRL) style warp still used this like "default" style.
(especially visible on warpouts, where they would accelerate to ridiculus speeds if the value was set to 3000 (which would give 3s warpout time if it worked like described).
Title: Re: Custom warp effects not working
Post by: Iss Mneur on September 13, 2010, 06:09:21 pm
I see, I'm going to try "Homeworld" warp style.
I think that there is a potential for improvement there, I can see many potential uses for customizing "default" style warp effect.
It would be great if SCP could add something like $warpin model: , which would allow customization of 3D warp effects.
Of course, I'd also like to see similar functionality for warpouts, especially that in this case, there's no way to add a custom effect to warpout without setting it to "Galactica" style.
It looks like it would be straight forward to enable the "default" warp style to use a custom animation rather than the blue or green swirl.  This would not change the warpin/out mechanics.

But the question is, what would the the use case?  That is, would it be something that is not already supported.

Also, the wiki entry states something like this:
Code: [Select]
$Warpout Speed:
FS2 Open 3.6.10:
Sets the speed at which the ship warps out for default warpout effect
Sets the time that the ships warp out (not the animation itself) takes for BTRL type warpout effects
Syntax: Float, meters per second or milliseconds
It doesn't work as described, ships with "Galactica" (former BTRL) style warp still used this like "default" style.
(especially visible on warpouts, where they would accelerate to ridiculus speeds if the value was set to 3000 (which would give 3s warpout time if it worked like described).
Well, I don't know what to say to that1.  The code for the "Galactica" warp style uses $Warpin Time: and $Warpout Time:.  The reason that you would still accelerate would be a result of the AI doing its normal thing when a warpout is ordered..


1) After more sleuthing there are even comments that say it uses $Warpin Speed: and $Warpout Speed: but the code immediately contradicts it, but this code is commented out anyway  :wtf:
Title: Re: Custom warp effects not working
Post by: karajorma on September 13, 2010, 08:12:29 pm
It doesn't work as described, ships with "Galactica" (former BTRL) style warp still used this like "default" style.
(especially visible on warpouts, where they would accelerate to ridiculus speeds if the value was set to 3000 (which would give 3s warpout time if it worked like described).

I seem to remember noticing that once but deciding not to Mantis it cause having the ship accelerate to a ridiculous speed and then disappear with a flash basically gave us Star Trek warpouts as a side effect. :p
Title: Re: Custom warp effects not working
Post by: Goober5000 on September 14, 2010, 12:53:13 pm
1) After more sleuthing there are even comments that say it uses $Warpin Speed: and $Warpout Speed: but the code immediately contradicts it, but this code is commented out anyway  :wtf:
You may want to look at the revision history then.  Some people (not naming names here) had, or have, a tendency to rewrite code but not rewrite the comments that describe that code.
Title: Re: Custom warp effects not working
Post by: Dragon on September 24, 2010, 07:13:41 am
OK, I tried Homeworld warp style and it indeed does work, but it doesn't look like I'd like it to.
Also, there's no Homeworld style warpout effect, which seems weird to me.
It looks like it would be straight forward to enable the "default" warp style to use a custom animation rather than the blue or green swirl.  This would not change the warpin/out mechanics.
It would be great if that could be done, I see no reason why custom animations shouldn't function for "default" warp style.
Title: Re: Custom warp effects not working
Post by: Goober5000 on September 24, 2010, 08:28:30 pm
That probably wouldn't be hard to get working.
Title: Re: Custom warp effects not working
Post by: Iss Mneur on September 24, 2010, 11:01:26 pm
That probably wouldn't be hard to get working.
Does that mean you are volunteering?
Title: Re: Custom warp effects not working
Post by: Goober5000 on September 25, 2010, 12:50:20 am
I didn't say that. :p

But I was thinking about how to go about doing it.  If I have some time this weekend I'll check it out.
Title: Re: Custom warp effects not working
Post by: Goober5000 on September 27, 2010, 12:57:41 am
Bleh, I take back my prediction about the difficulty level.  It turns out that the "Default" warp effect uses the fireball code to play the warp animation, whereas the other warp effects use the standard animation code.  You can't mix those easily because one has distance LODs and the other doesn't, and they go through different code paths.  So you'd have to create a new warp effect if you wanted to specify an arbitrary animation.
Title: Re: Custom warp effects not working
Post by: Dragon on September 27, 2010, 12:06:53 pm
Would that be possible to add a new "custom" type then?
It'll work just like default, but using a different code.
Title: Re: Custom warp effects not working
Post by: Goober5000 on September 28, 2010, 12:28:57 am
Yes, it's certainly possible, but someone would have to figure out how to do it.  They'd have to make a new code strategy (standard animation code) work exactly like the old code strategy (fireball code) and that could get tricky.
Title: Re: Custom warp effects not working
Post by: pecenipicek on September 29, 2010, 02:04:00 am
OK, I tried Homeworld warp style and it indeed does work, but it doesn't look like I'd like it to.
Also, there's no Homeworld style warpout effect, which seems weird to me.


There's no HW style warpout effect because, well, there's no HW style warpout effect specified.


to be more specific, in ships.tbl

Code: [Select]
<stuff before>
...
$Warpin type: Homeworld
$Warpin start sound: 192
$Warpin speed: 0
$Warpin time: 9.5
$Warpin animation: HGN_WARP
$Warpout type: Homeworld
$Warpout start sound: 193
$Warpout speed: 0
$Warpout time: 9.5
$Warpout animation: HGN_WARP
...
<stuff after>


the $Warpin/out animation: field is where you enter the name of your bitmap/eff/whatever that you want to be displayed. it needs to be in the good old Effects folder.
Title: Re: Custom warp effects not working
Post by: Dragon on September 29, 2010, 12:32:33 pm
No, I meant that Wiki states that $Warpout type: can't be set to "homeworld" and I remember that debug once complained when I tried (long time ago though).
It's good to know Homeworld style works for warpouts.
Somebody who knows exactly what can be done and what not should take a look at the Wiki and update such stuff.
Title: Re: Custom warp effects not working
Post by: pecenipicek on September 29, 2010, 01:05:30 pm
the effect has been in trunk for almost 2 years. whoever was editing that part wasnt exactly thorough.

as a side note, its possible the string is case sensitive, since homeworld warpin/out has worked in the exact form its in the code snippet up there since WMC first gave it to me to test it, on 9th Feb. 2008.

[edit] fixed the wiki page.




and upon further review, it looks like both the Homeworld style Hyperspace and Star Wars style Hyperspace were coded in at the same time most likely, so whoever edited the wiki at first was probably not paying any attention.