RotateX/Y/Z and move forward

Post your scripting questions / solutions here

Moderator: Moderators

Runt
First Lieutenant
Posts: 188
Joined: Wed Feb 11, 2004 5:03 pm
Location: The Netherlands
Contact:

RotateX/Y/Z and move forward

Post by Runt »

Hey,

I want an object moving forward and rotateX/Y/Z at the same time.
Maybe with a while loop ?
Thanks
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

well i would mess with angles myself.

but you can use movexup etc like so

Code: Select all



$object moveup 32
$object move
$object movexup 77
$object waitmove

iprintln "finished mooving both"

User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

i've seen this used -


$object moveEast 800
$object rotateYdownto 180
$object waitmove


What sets the speed to move object?
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

You can issue a few move commands at a time and activate them with one waitmove, I mean like this:

Code: Select all

self moveNorth 16
self moveWest 16
self moveDown 16
self waitmove
Self will start moving diagonally north-west-down at the moment when the waitmove command is issued.

@Viper:

Code: Select all

local.object speed 150
Will set local.object's speed to 150 units per second.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Runt
First Lieutenant
Posts: 188
Joined: Wed Feb 11, 2004 5:03 pm
Location: The Netherlands
Contact:

Post by Runt »

Thankyou all

Code: Select all

$object moveto $waypoint1 
$object rotateYdownto 180 
$object waitmove 
or

Code: Select all

self moveto $waypoint1 
self moveWest 16 
self moveDown 16 
self waitmove
This is also possible ?
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

I would use

$object moveto $waypoint1
$object rotateYdownto 180
$object waitmove
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

Another ? on this.

Is there a way to set the speed of rotation seperate from speed of movement?
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

It's a parameter of the rotate command. Look in g_allclasses.html, it's all there.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

using yaw and rotation is also great for making a truck like leaning over a cliff and on fire or something like that. I used it once for a truck on its side halfway on a slightly elevated terrain and half on a lower terrain whie one fire. Turned out nice :)
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

You can set time I think on rotation . $object rotateYdownto 180 is absolute it rotates down to 180 but if you just did $object rotatey ? the ? would be degrees per second I belive . $object rotatey 360 would rotate y once per second to stop it you would have to do $object rotatey 0
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

$object time 3
$object moveto $waypoint1
$object rotateYdownto 180
$object waitmove

$object time 3 is how long itll take to move, so they lesser the number the faster :wink:
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

My rule of thumb is speed for movement time for rotation .
Image
Runt
First Lieutenant
Posts: 188
Joined: Wed Feb 11, 2004 5:03 pm
Location: The Netherlands
Contact:

Post by Runt »

When I use this:

Code: Select all

test:
$test moveto $waypoint1 
$test rotateYdownto 180 
$test waitmove 
I get this in console:

Code: Select all

Error, no script should be loaded before loadout.scr
:? :?

And when I apply this script to an object :

Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

your $bathallied entity isn't being read correctly. does it exist? spell the targetname right?

the loadout.scr thing, you can't exec stuff before main.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Runt
First Lieutenant
Posts: 188
Joined: Wed Feb 11, 2004 5:03 pm
Location: The Netherlands
Contact:

Post by Runt »

does it exist? spell the targetname right?
Yes, Yes.

If I make a brush into a script object and give it a targetname "test" it does work. But when I give an object a targetname of "test" I get the NULL listener error :? :(
Post Reply