Jump to content
The Dark Mod Forums

Move/slide entitys through scripting


DeTeEff

Recommended Posts

Probably really easy but I need an object to move/slide to set origins via scripting.

 

"Press button 1 and the entity moves to position 1"

 

"Press button 2 and the entity moves from position 1 to position 2"

 

"Press button 1 and the entity moves to position 1 again"

 

"Press button 3 and the entity moves to position 3"

 

The idea is that the thing shouldn't care about its former origin. Just slide to the new one...

 

I have the script but can only use setOrigin and of course it snaps. I want it to slide...

 

How do I do that through scripting?

Link to comment
Share on other sites

Use a func_mover and the scriptfunction void moveToPosition(vector position). If the positions are fixed, you can use the origin of some non-solid func_statics or so. Or you just use the elevator setup.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

From doom3_events.script (tdm_base01.pk4)

 

/***********************************************************************
func_movers
***********************************************************************/
// Stops any translational movement.
scriptEvent void  stopMoving();
// Stops any rotational movement.
scriptEvent void  stopRotating();
// Sets the movement speed. Set this speed before initiating a new move.
scriptEvent void  speed( float speed );
// Sets the movement time. Set this time before initiating a new move.
scriptEvent void  time( float time );
// Sets the deceleration time. Set this deceleration time before initiating a new move.
scriptEvent void  decelTime( float time );
// Sets the acceleration time. Set this acceleration time before initiating a new move.
scriptEvent void  accelTime( float time );
// Initiates a translation to the position of an entity.
// Uses the current speed/time and acceleration and deceleration settings.
scriptEvent void  moveTo( entity targetEntity );
// Initiates a translation to an absolute position.
// Uses the current speed/time and acceleration and deceleration settings.
scriptEvent void  moveToPos( vector pos );
// Initiates a translation with the given distance in the given yaw direction.
// Uses the current speed/time and acceleration and deceleration settings.
scriptEvent void  move( float angle, float distance );
// Initiates an acceleration to the given speed over the given time in seconds.
scriptEvent void  accelTo( float speed, float time );
// Initiates a deceleration to the given speed over the given time in seconds.
scriptEvent void  decelTo( float speed, float time );
// Initiates a rotation about the given axis by decreasing the current angle towards the given angle.
// Uses the current speed/time and acceleration and deceleration settings.
scriptEvent void  rotateDownTo( float axis, float angle );
// Initiates a rotation about the given axis by increasing the current angle towards the given angle.
// Uses the current speed/time and acceleration and deceleration settings.
scriptEvent void  rotateUpTo( float axis, float angle );
// Initiates a rotation towards the given Euler angles.
// Uses the current speed/time and acceleration and deceleration settings.
scriptEvent void  rotateTo( vector angles );
// Initiates a rotation with the given angular speed.
// Uses the current speed/time and acceleration and deceleration settings.
scriptEvent void  rotate( vector angleSpeed );
// Initiates a rotation towards the current angles plus the given Euler angles.
// Uses the current speed/time and acceleration and deceleration settings.
scriptEvent void  rotateOnce( vector angles );
// Initiates a translation back and forth along the given vector with the given speed and phase.
scriptEvent void  bob( float speed, float phase, vector distance );
// Initiates a rotation back and forth along the given angles with the given speed and phase.
scriptEvent void  sway( float speed, float phase, vector angles );
// Opens the renderer portal associated with this mover.
scriptEvent void  openPortal();
// Closes the renderer portal associated with this mover.
scriptEvent void  closePortal();
// Sets the sound to be played when the mover accelerates.
scriptEvent void  accelSound( string sound );
// Sets the sound to be played when the mover decelerates.
scriptEvent void  decelSound( string sound );
// Sets the sound to be played when the moving.
scriptEvent void  moveSound( string sound );
// Enables aligning the mover with the spline direction.
scriptEvent void enableSplineAngles();
// Disables aligning the mover with the spline direction.
scriptEvent void disableSplineAngles();
// Subtracts the initial spline angles to maintain the initial orientation of the mover.
scriptEvent void removeInitialSplineAngles();
// Starts moving along a spline stored on the given entity.
scriptEvent void startSpline( entity spline );
// Stops moving along a spline.
scriptEvent void stopSpline();
// Returns true if a mover is moving
scriptEvent float isMoving();
// Returns true if a mover is rotating
scriptEvent float isRotating();
// Enables the mover/trigger
scriptEvent void  enable();
// Disables the mover/trigger
scriptEvent void  disable();

 

MoveToPos and moveTo are probably interesting for your cause. Maybe the others will help you too. Later when you want to figure out how to do things in scripting, examine doom_events.script and tdm_events.script. These live in tdm_base01.pk4.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...