Page 1 of 1

Location and rotation?

PostPosted: Sun Jun 10, 07 4:04 pm
by Cozmo
Yeah, it's me again. :lol:

There's two things I need, if anyone knows about them.

1. ) Location variable - Is there such a thing? I'm sure I've seen it in the .ini file for MultiDX at one point. I need my class to have a location for a place to teleport to and to remember where it spawned.

2.) Change Rotation - I need this for my class too; I know how to change the rotation in UnrealEd. But as it's under another variable, I'm not quite sure how I'd set it.

I need both of these for a helicopter class I'm making. Not just any helicopter, but it lets you do missions. :wink:

I've been coding it most of the morning. 315 lines of code, so I'm gonna go for a nap or play Halo3 or something away from the computer. :smt095

Thanks in advance! :D

PostPosted: Sun Jun 10, 07 6:53 pm
by Dae
Location is above Rotation in "Movement" in UED. It's a vector variable, so if you want to alter it (e.g. add 5 to Y),

Something.Location += vect(0,5,0);

You can set location via SetLocation(vect(x,y,z));

absolutely the same with rotation... function for setting it is SetRotation

PostPosted: Sun Jun 10, 07 9:08 pm
by Cozmo
Ah, I should've worded that better. What I meant was the variable that makes something rotate constantly, like the DXLogo. But I've just thought about how I could do that anyway.

And I know how to SetLocation, I just wanted to know if there's such thing as a variable to store a location on, like on MultiDX you can set the location of the bomb in the .ini through some var.

Thanks for the effort though. :)

PostPosted: Sun Jun 10, 07 9:34 pm
by Dae
how does the variable in ini of multidx look like?

PostPosted: Sun Jun 10, 07 9:44 pm
by Cozmo
Dae[A] wrote:how does the variable in ini of multidx look like?


I would've copied the var type, but he protected it. :(

Here's one combination I see from the ini.

MapName[0]=DXMP_Smuggler
BombLocation[0]=(X=306.587524,Y=33.631599,Z=239.800003)

:?

PostPosted: Sun Jun 10, 07 10:03 pm
by Dae
the var type is "vector", obviously

like
var vector MyRotation config(Mymod);

Self.SetRotation(MyRotation);

PostPosted: Mon Jun 11, 07 3:32 pm
by Cozmo
Dae[A] wrote:the var type is "vector", obviously

like
var vector MyRotation config(Mymod);

Self.SetRotation(MyRotation);


Ok, thanks for that Dae. :D

PostPosted: Mon Jun 11, 07 4:13 pm
by Allan
I thought rotation has it's own type of variable - Rotator.

PostPosted: Mon Jun 11, 07 4:33 pm
by Dae
I checked Unreal Wiki — Allan is right.

PostPosted: Mon Jun 11, 07 4:44 pm
by MainMan
~Cozmo~ wrote:What I meant was the variable that makes something rotate constantly, like the DXLogo.

SetPhysics(PHYS_Rotating);

PostPosted: Tue Jun 12, 07 2:13 am
by Ayleth
~MainMan~ wrote:
~Cozmo~ wrote:What I meant was the variable that makes something rotate constantly, like the DXLogo.

SetPhysics(PHYS_Rotating);

i believe you need another var too, bFixedRotationDir=true. or something like that.

PostPosted: Tue Jun 12, 07 2:42 pm
by ~ô¿ô~Nobody~
Dae[A] wrote:Location is above Rotation in "Movement" in UED. It's a vector variable, so if you want to alter it (e.g. add 5 to Y),

Something.Location += vect(0,5,0);

You can set location via SetLocation(vect(x,y,z));

absolutely the same with rotation... function for setting it is SetRotation

Something.Location += vect(0,5,0);
wouldn't work already.

You needed to do it like
something.Setlocation(vect(something.location.x,something.location.y+5,something.location.z));

PostPosted: Tue Jun 12, 07 2:47 pm
by MainMan
A better way would be:


local vector loc;
loc = Something.location;

loc.Y += 5;

Something.SetLocation(loc);


:)

PostPosted: Tue Jun 12, 07 2:49 pm
by ~ô¿ô~Nobody~
Yes, of course. I just wanted to make it look difficult :P

PostPosted: Tue Jun 12, 07 3:08 pm
by Allan
Wouldn't
Code: Select all
Something.SetLocation(Something.Location+vect(0,0,5));
work too? :P