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

    • The Black Arrow

      Hey @nbohr1morehow come the zombies in The Dark Mod don't have a "resurrection" mechanic to it, similar to how Thief has it?
      They're quite a weak creature as of right now, it's merely a walking corpse that slashes you, making attacking them to kill them an actual strategy.
      Would be better if they had some cool mechanism to it that truly makes them a danger, such as the resurrection idea itself.
      · 2 replies
    • Ansome

      Query: when was the last time a zombie in a video game was unnerving or scary to you? I'm chipping away at my anniversary submission and I've been trying to gather opinions on the subject. I'm perfectly capable of lighting them well, changing their sfx, and creating effective ambience, but I'm worried that zombies at their core are just too overdone to be an effective payoff to the tension I'm creating.
      · 4 replies
    • nbohr1more

      The Lieutenant 3 is out! Congrats Frost_Salamander! ( raising awareness )
      · 2 replies
    • OrbWeaver

      Has anyone had any luck with textures from Polyhaven? Their OpenEXR normal maps seem too washed out and give incorrect shading in the engine.
      · 5 replies
    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
×
×
  • Create New...