Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: MetalDestroyer on January 16, 2006, 06:30:09 am

Title: Simulate S-Foil movement
Post by: MetalDestroyer on January 16, 2006, 06:30:09 am
I think it's a moment for me to put S-Foil movement into the X wing, but I don't know how to do.
I read somewhere it is a FRED2 SEXP related, but i'm not sure. I'm wondering if the model must be followed some restriction issues (normal ? wings ? ).

Title: Re: Simulate S-Foil movement
Post by: aldo_14 on January 16, 2006, 06:57:45 am
I think it's a moment for me to put S-Foil movement into the X wing, but I don't know how to do.
I read somewhere it is a FRED2 SEXP related, but i'm not sure. I'm wondering if the model must be followed some restriction issues (normal ? wings ? ).



I don't know the exact details offhand, I'm afraid, but it involves setting the wings to be a seperate rotating subobject, with that objects' rotation set as 'triggered' (or similar) in the tbl entry.  Can't be any more specific than that, natch. :(
Title: Re: Simulate S-Foil movement
Post by: TrashMan on January 16, 2006, 07:52:41 am
Wouldn't that couse problems with the primary weapon points?

As I recall, they don't rotate with the object, so an X-wing that fires lasers in closed wings mode would look a bit silly - as the lasers would originate from the extended wings mode.
Title: Re: Simulate S-Foil movement
Post by: MetalDestroyer on January 16, 2006, 08:06:05 am
Wouldn't that couse problems with the primary weapon points?

As I recall, they don't rotate with the object, so an X-wing that fires lasers in closed wings mode would look a bit silly - as the lasers would originate from the extended wings mode.

If I made rotative part like turret's barrel, the firing point will generally move, no ?   
Title: Re: Simulate S-Foil movement
Post by: aldo_14 on January 16, 2006, 09:44:38 am
Wouldn't that couse problems with the primary weapon points?

As I recall, they don't rotate with the object, so an X-wing that fires lasers in closed wings mode would look a bit silly - as the lasers would originate from the extended wings mode.

I thought that might have been fixed, but I'm not too sure.  Stupid way to overcome that could to use the switch-model SEXP one the s-foil change completes.
Title: Re: Simulate S-Foil movement
Post by: Flipside on January 16, 2006, 11:14:41 am
I thought the X-Wing couldn't fire with S-Foils locked anyway?
Title: Re: Simulate S-Foil movement
Post by: TrashMan on January 16, 2006, 06:10:08 pm
That would b the dumbest restriction in the history of all restrictions.
the guns point in the right direction and aren't obstructed by anything.

b.t.w. - I might be wrong, but as far as I recall the fire point will move on the turret becose the game recognizes it as a turret and the fire point is based on the subobject (barrel) part. I don't think ti will work for the wing.
Title: Re: Simulate S-Foil movement
Post by: NGTM-1R on January 16, 2006, 07:54:59 pm
That would b the dumbest restriction in the history of all restrictions.
the guns point in the right direction and aren't obstructed by anything.

Doesn't matter, it's canon. :P

They can fire, but they're not supposed to; IIRC, the cooling jackets for the weapons don't function well with the wings closed, since they're almost in direct contact with each other. Firing more then a few times with the wings closed can damage the cannons.
Title: Re: Simulate S-Foil movement
Post by: Nuke on January 17, 2006, 09:53:24 am
if you can get the coders to implement a "no linked fire" weapon flag you could do the sfoils. i actually do something similar with the pf chimera's secondary banks. the first bank is a missile pod that drops down through doors in the underside of the cockpit hen selected, the other bank is an array of missile launchers which are in winglets that must open up before they can be used. for an xwing fighter you would need to model the moving part of the wings seprately from the rest of the ship, making them their own subobject with their orgin (rotational center) at the point of rotation. you would then position them in their closed state. then using the animation code (it should be in the wiki) open them to howmany ever degrees they are supposed to open to when the second primary bank is selected. you will need 2 banks, the first will be the closed set, and the second will be the open set. so you could fire in either position.you need the no link option so that you cant fire both banks at the same time. to accomidate cannon you can use 2 versions of the blasters they fire, the normal version that the second bank would use, and a crippled slower firing version for the closed configguration. tada, a working xwing.
Title: Re: Simulate S-Foil movement
Post by: MetalDestroyer on January 17, 2006, 11:21:50 am
if you can get the coders to implement a "no linked fire" weapon flag you could do the sfoils. i actually do something similar with the pf chimera's secondary banks. the first bank is a missile pod that drops down through doors in the underside of the cockpit hen selected, the other bank is an array of missile launchers which are in winglets that must open up before they can be used. for an xwing fighter you would need to model the moving part of the wings seprately from the rest of the ship, making them their own subobject with their orgin (rotational center) at the point of rotation. you would then position them in their closed state. then using the animation code (it should be in the wiki) open them to howmany ever degrees they are supposed to open to when the second primary bank is selected. you will need 2 banks, the first will be the closed set, and the second will be the open set. so you could fire in either position.you need the no link option so that you cant fire both banks at the same time. to accomidate cannon you can use 2 versions of the blasters they fire, the normal version that the second bank would use, and a crippled slower firing version for the closed configguration. tada, a working xwing.

What animation code are you talking about ?
Title: Re: Simulate S-Foil movement
Post by: Wanderer on January 17, 2006, 11:27:10 am
FSwiki (http://www.hard-light.net/wiki/index.php/Animation_Code)
Title: Re: Simulate S-Foil movement
Post by: Unknown Target on January 17, 2006, 12:30:53 pm
You could maybe run the animation with a lock-weapons SEXP until it finishes, then once the animation is done, use a change-ship SEXP.
Title: Re: Simulate S-Foil movement
Post by: Trivial Psychic on January 17, 2006, 02:58:21 pm
If you go with animated wings, you'll have another problem... engine glows.  IIRC, you can't bind the location of an engine glow to a moving submodel, so when the wings move from one position to another, the engine nacelles will move too, but the engine glows will stay in their previous location.
Title: Re: Simulate S-Foil movement
Post by: Nuke on January 17, 2006, 03:01:11 pm
What animation code are you talking about ?

Code: [Select]
$Subsystem: sfoil,0,0
+non-targetable
$animation: triggered
$type: "primary_bank"
+sub_type: 1
+delay: 0
+relative_angle: 0,0,20
+velocity: 0,0,4000
+acceleration: 0,0,80
+time: 5000

submodel animation :D
Title: Re: Simulate S-Foil movement
Post by: Nuke on January 17, 2006, 03:05:57 pm
If you go with animated wings, you'll have another problem... engine glows. IIRC, you can't bind the location of an engine glow to a moving submodel, so when the wings move from one position to another, the engine nacelles will move too, but the engine glows will stay in their previous location.

i wonder when somones gonna bite the bullet and implement moving gun and thruster points.
Title: Re: Simulate S-Foil movement
Post by: Trivial Psychic on January 17, 2006, 03:13:39 pm
As soon as there's a pof editor available to support such features *cough*PCS2*cough*.
Title: Re: Simulate S-Foil movement
Post by: Nuke on January 18, 2006, 12:14:08 am
probibly be able to do it with scripting evenually.
Title: Re: Simulate S-Foil movement
Post by: Xeandra on January 18, 2006, 03:28:24 pm
How would the ai know witch gun to use?
Title: Re: Simulate S-Foil movement
Post by: Nuke on January 19, 2006, 09:14:04 am
if the ai is smart, it will open its sfoils and use the better weapon. i doubt the ai is smart :D
or you can just simply not give them a weapon in the first bank.

and theres a way (albeit very cheap) to get the engine points to translate, use glowpoints instead. those can translate with an object. maybe the coders can ad a type 2 glow, that is essentially and engine point alternative that would tell the engine to render ingine glows in the glowpoint position, and scale them with thrust in the same way engine glows work.