Effects and Trailers positioning

  • 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.

**Monarch**

New Member
Nov 29, 2001
14
0
0
Visit site
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
 

jb

New Member
May 22, 2000
278
0
0
www.planetunreal.com
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.
 

**Monarch**

New Member
Nov 29, 2001
14
0
0
Visit site
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:)
 

Captain Kewl

I know kewl.
Feb 13, 2001
794
0
0
IN YOUR HOUSE
Visit site
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...
 

**Monarch**

New Member
Nov 29, 2001
14
0
0
Visit site
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
 

Captain Kewl

I know kewl.
Feb 13, 2001
794
0
0
IN YOUR HOUSE
Visit site
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).
 

**Monarch**

New Member
Nov 29, 2001
14
0
0
Visit site
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? :(
 

Captain Kewl

I know kewl.
Feb 13, 2001
794
0
0
IN YOUR HOUSE
Visit site
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?
 

phx

New Member
Feb 9, 2002
5
0
0
australia
Visit site
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
 

**Monarch**

New Member
Nov 29, 2001
14
0
0
Visit site
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!!! :)