1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Effects and Trailers positioning

Discussion in 'Programming' started by **Monarch**, Feb 11, 2002.

  1. **Monarch**

    **Monarch** New Member

    Joined:
    Nov 29, 2001
    Messages:
    14
    Likes Received:
    0
    Hi All!

    Problem, I'm creating a fighter and trying to add a flare to the engine area so it moves with the jet as a trailer but the trailer spawns at the center of jet or pawn. I need it to go in back and to the left. code looks like ef=spawn(class'engineflare',Self);

    Ive tried adding a location by adding self.location*x+98);

    and a bunch of other things along those lines which didn't work
    or had no effect.
    Is there a way to change it in that part of the script?
    thanks in advance

    Monarch
     
  2. mr.s-d

    mr.s-d CHiMERiC Moderator

    Joined:
    Aug 30, 2001
    Messages:
    65
    Likes Received:
    0
    Are you using the Trails tute from CHiMERiC or just something with PHYS_Trailer?
     
  3. jb

    jb New Member

    Joined:
    May 22, 2000
    Messages:
    278
    Likes Received:
    0
    I should probably not say this as I dont have all the answers in front of me (at work) but take a closer look at the spawn function. It has 5 or 6 paramters you can give to it. One of them is the postion where you want the spawn object to apear. However I can not remember all of the details but I am sure someone here can post code that explains what each does. I know its in one of the "core" files of UT but can not remember.. I believe once you have the sytanx you can spawn the flare in the right spot.
     
  4. **Monarch**

    **Monarch** New Member

    Joined:
    Nov 29, 2001
    Messages:
    14
    Likes Received:
    0
    no, I saw the tute but didn't want to go that route unless I have too.

    I thought there should be (or hoped there would be) a way to do it from the spawn command.

    I don't know what all the parameters are for the command if any one out there can help with the 5 or 6 parameters are and there meaning I would really appeciate it. and how to use them .

    Thanks:)
     
  5. Captain Kewl

    Captain Kewl I know kewl.

    Joined:
    Feb 13, 2001
    Messages:
    794
    Likes Received:
    0
    It's usually a good idea to try digging through the sources if you've a question about a function.

    Code:
    //
    // Spawn an actor. Returns an actor of the specified class, not
    // of class Actor (this is hardcoded in the compiler). Returns None
    // if the actor could not be spawned (either the actor wouldn't fit in
    // the specified location, or the actor list is full).
    // Defaults to spawning at the spawner's location.
    //
    native(278) final function actor Spawn
    (
    	class<actor>      SpawnClass,
    	optional actor	  SpawnOwner,
    	optional name     SpawnTag,
    	optional vector   SpawnLocation,
    	optional rotator  SpawnRotation
    );
    
    Though if you want it to move with the jet as a trailer it's probably easier to just spawn it, set it to PHYS_Trailer, and adjust the prepivot...
     
  6. **Monarch**

    **Monarch** New Member

    Joined:
    Nov 29, 2001
    Messages:
    14
    Likes Received:
    0
    Thanks Captain Kewl


    So i guess it would go like this?

    eh=spawn(class'engineeffect',self,,0,48,28.rot(0,0,0));
    X Y Z
    or

    eh=spawn(class'engineeffect',self,,Location(0,48,28).rot(0,0,0)));
    X Y Z

    ?


    P.S The phys is already set to trailer
     
  7. Captain Kewl

    Captain Kewl I know kewl.

    Joined:
    Feb 13, 2001
    Messages:
    794
    Likes Received:
    0
    Shouldn't have to bother with the spawn location then, since PHYS_Trailer will automatically recenter the actor on its owner. Try setting bTrailerPrePivot and bTrailerSameRotation to true and then give it a PrePivot vector, something like (X=2.000000).
     
  8. **Monarch**

    **Monarch** New Member

    Joined:
    Nov 29, 2001
    Messages:
    14
    Likes Received:
    0
    Would that be in the EngineFlare Effect script its self or in the script thats calling the spawn?
     
  9. phx

    phx New Member

    Joined:
    Feb 9, 2002
    Messages:
    5
    Likes Received:
    0
    is it fair to say that using phys_trailer is the equivalent of setting actor.base?
     
  10. **Monarch**

    **Monarch** New Member

    Joined:
    Nov 29, 2001
    Messages:
    14
    Likes Received:
    0
    Thanks Captain Kewl,

    that worked, BUT a new problem creeped up,

    I did the BePrePivot=true

    and PrePivot=(x=10,y=15)

    and BTrailerSameRotation=True

    That Moved it to the right Location but when the plane is flying and I turn the trailer dosent stay were its supposed to.
    It trails the plane but if I turn the trailer dosent rotate with it.

    Its not rotating with the plane or the player anymore it just follows it.

    Any other Ideas? :(
     
  11. Captain Kewl

    Captain Kewl I know kewl.

    Joined:
    Feb 13, 2001
    Messages:
    794
    Likes Received:
    0
    Actor.Base is literally the base that the actor is resting on, no? (I'm not sure.) PHYS_Trailer makes an actor follow its owner.

    I dunno about the trailer. :( Maybe you need to update prepivot?
     
  12. phx

    phx New Member

    Joined:
    Feb 9, 2002
    Messages:
    5
    Likes Received:
    0
    hmmm i thought it was possible to use actor.base for effects... i use it atm to attach a 'this player has been flashbanged' invisible actor to... to affect aim etc.... and i find that when i give it a mesh it follows them around. from looking at some code it seems that the location is relative to its base (same with rotation etc)... i might look into this tonight
     
  13. navboy

    navboy New Member

    Joined:
    Jan 5, 2001
    Messages:
    340
    Likes Received:
    0
    On a similar note, i've been wondering what the difference is between use PHYS_trailer (which i've never worked with) and setting an actor's AttachTag to be that of the actor you want it to move with (which i have done successfully in several cases, but only by attaching to movers) ...
     
  14. **Monarch**

    **Monarch** New Member

    Joined:
    Nov 29, 2001
    Messages:
    14
    Likes Received:
    0
    I couldn't get the trailer to rotate properly to its owner, so I Cheated.....

    I made a small Particle mesh and set its mesh orgin to the location I needed then put it all in the effect script I made with the properties to Phys_Trailer and bSameRotation to true and used the flare texture.

    That did the trick had to make 2 scripts and meshes one for each
    engine but it worked.

    Thanks All!!! :)
     

Share This Page