Author Topic: Generating something in front of player.  (Read 3980 times)

0 Members and 1 Guest are viewing this topic.

Offline Skullar

  • 29
Re: Generating something in front of player.
It is possible. If you have any idea of maths and if the player is flying in one direction without steering around too much.


create 3 variables : X_old, y_old and z_old

Then :

event STORE PLAYER COORDS
     when
            has time elapsed
                   12345
            modify-variable
                   x_old
                   getobject_x
                           Alpha 1
            modify-variable
                   y_old
                   getobject_y
                           Alpha 1
            modify-variable
                   z_old
                   getobject_z
                           Alpha 1

event CREATE JUMP VORTEX
      when
             is event true delay
                    STORE PLAYER COORDS
                    1
             warp_effect                       ( only first 6 entries stated here .... )
(1)                +
                             getobject_x
                                     Alpha 1
                             *
                                      -
                                             getobject_x
                                                   Alpha 1
                                              x_old
                                      8
(2)                +
                             getobject_y
                                     Alpha 1
                             *
                                      -
                                             getobject_y
                                                   Alpha 1
                                              y_old
                                      8
(3)                +
                             getobject_z
                                     Alpha 1
                             *
                                      -
                                             getobject_z
                                                   Alpha 1
                                              z_old
                                      8
(4)               getobject_x
                           Alpha 1
(5)               getobject_y
                           Alpha 1
(6)               getobject_z
                           Alpha 1


So, this means : if players continues with present speed and course , he will be at the center of the hyperspace vortex in 8 seconds. You can play around with this number , as well as with size of vortex ( other entries of warp-effect SEXP )

Entries (4),(5) and (6) mean that vortex points in players direction.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Generating something in front of player.
Well It's a good try but I can shoot a couple of holes in that theory right now.  First one you already did you don't know if the player will be flying in a straight line.  Then there is always the possibility the player is in glide mode so the ship is traveling in a different direction then the ship is pointing. 

BTW you can do the same thing using the position of 2 subsystems on the ship if you know what ship the player will be flying.  Been there tried that. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Generating something in front of player.
I haven't read this thread too thoroughly, but my suggestion would be to first create a very small model with invisible textures and a no-collide flag in its table entry.  Then using the arrival cues in FRED, tell it to arrive in front of the player ship without any warp effect.  Then use the get-coordinates sexps to acquire the dummy-model's position and use them to place the warp vortex.  You may also be able to use a second set of get-coordinates sexps to acquire the player's position at that time, and ensure that the warp-effect trigger is pointing at the player's position.
The Trivial Psychic Strikes Again!

  

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: Generating something in front of player.
You're all overthinking it.

Have an invisible object with no-collide on warp in in front of the player. There's a setting in the ship editor to do just that (They pull down menu from "hyperspace, same one you set the arrival from docking bays from). Or, if you want some other animation than the standard warp, do the same thing with no-warp-effect checked, and then use the explosion sexp and get-object-x/y/z to define the location.

[EDIT]Doh, should have read the whole thread :p

[EDIT2] For slightly different scenarios than seem to be the case here, there's also the "Facing" sexp in the training menu, though as I said, that's less applicable here because it limits the dynamic part quite a bit.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp