Author Topic: Set-object-facing-object: rotation time?  (Read 3476 times)

0 Members and 1 Guest are viewing this topic.

Set-object-facing-object: rotation time?
In the set-object-facing-object SEXP, the logic of the rotation time is rather fuzzy. Use a short value, and the ship will spin like a top; use a realistic (i.e. long) rotation time and the ship doesn't get to the right direction. Demonstration mission (FSO 3612, no mods) attached.

Has anyone run into this before, gotten it working, or found a decent workaround?

[attachment deleted by ninja]

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
Re: Set-object-facing-object: rotation time?
Try creating a new camera before using any of the facing-object sexps, that might help.

el hombre vicio...

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Set-object-facing-object: rotation time?
If it works anything like the set-camera-facing* SEXPs, a few possibilities come to mind:

1. You might need to reset the facing of the object to the default orientation first. EDIT: Nevermind that, I was thinking of something else.
2. The object will face the location where the target object was at the start of the turn, not where it is at the end.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Set-object-facing-object: rotation time?
It's a wonky sexp, best used with a repeat/everytime kinda setup
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
Re: Set-object-facing-object: rotation time?
I thought you where using a ship as a camera, never mind that earlier post of mine I have no clue as to why this happens.

Why not using an attack order with locked turrets/ignore orders and then reset the orders after a second?
el hombre vicio...

 
Re: Set-object-facing-object: rotation time?
2. The object will face the location where the target object was at the start of the turn, not where it is at the end.

I'm pointing to a still object, see demonstration mission.


It's a wonky sexp, best used with a repeat/everytime kinda setup

I guess... but how would that work? You'd need something like "every-time (not (ship is facing object))", but I can't find the "ship is facing object" SEXP for non-player ships.


Why not using an attack order with locked turrets/ignore orders and then reset the orders after a second?

1. Attack orders are not guaranteed to point the ship towards its target, at close range it will start to run circles around the target.
2. I'd prefer the pointing ship not to move (or as little as possible), because of collision danger.

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Set-object-facing-object: rotation time?
It's a very badly written sexp (by yours truly when I somewhat unsuccessfully tried to bypass the AI system).

The problem is that the game will apply a torque to the object to get it to rotate, but the torque will only be active in the frame in which it is called.  So you'll need to use the every-time sexp to ensure that the torque is applied every frame.

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Set-object-facing-object: rotation time?
The problem is that the game will apply a torque to the object to get it to rotate, but the torque will only be active in the frame in which it is called.  So you'll need to use the every-time sexp to ensure that the torque is applied every frame.
Well, unless it's getting fixed sometime soon, that detail should really be added to the SEXP description.

 
Re: Set-object-facing-object: rotation time?
1. Make set-object-facing event
2. Add repeat count
3. ?????
4. The ship is ticking like the second hand of a clock.

Bah, it'll have to do... rotdamp makes the ticking not too obvious.

 

Offline Sushi

  • Art Critic
  • 211
Re: Set-object-facing-object: rotation time?
1. Make set-object-facing event
2. Add repeat count
3. ?????
4. The ship is ticking like the second hand of a clock.

Bah, it'll have to do... rotdamp makes the ticking not too obvious.

Try the following:

1. Use every-time instead of when.
2. Add trigger count, leave repeat-count alone.
3. Set interval time to 0 (not sure if you need this or not for every-time)...

 

Offline CooperHawkes

  • 28
  • NippleNeck (at least i got something to play with)
Re: Set-object-facing-object: rotation time?
no offence goober, but most of the time set-object-facing(-object) acts like "im going to do whatever i want to do!". but with your explanation it gets a lot clearer why it acts like it does.
an overhaul of this sexp would be much appreciated. would make something im trying to realise atm a lot easier if this sexp/s would work like it/they should.

be aware that everytime-events are very framerate depentend. outcomes may differ vastly with different FPS.
take me out to the black,
tell 'em i ain't coming back,
i don't care, i'm still free,
you can't take the sky from me

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Set-object-facing-object: rotation time?
Do keep in mind that overhauling this sexp to work 'like it should' could potentially break already released campaigns that use the sexp in the way it works currently.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline CooperHawkes

  • 28
  • NippleNeck (at least i got something to play with)
Re: Set-object-facing-object: rotation time?
ok, point taken. how about a new "set-object-facing-(for-real-this-time)" sexp?
take me out to the black,
tell 'em i ain't coming back,
i don't care, i'm still free,
you can't take the sky from me

 

Offline Sushi

  • Art Critic
  • 211
Re: Set-object-facing-object: rotation time?
ok, point taken. how about a new "set-object-facing-(for-real-this-time)" sexp?

I suspect what you really want is a "turn-towards-object" SEXP that actually does hook into the AI for making one object face another...

  

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Set-object-facing-object: rotation time?
Do keep in mind that overhauling this sexp to work 'like it should' could potentially break already released campaigns that use the sexp in the way it works currently.

Could always add an extra argument that controls whether to use it the "right" way, or the "old" way, and defaults to the old way...
(´・ω・`)
=============================================================