Jump to content
The Dark Mod Forums

Question: I would like to throw Func_statics around


Bikerdude

Recommended Posts

I'm not entirely certain what you're trying to accomplish. Is this a poltergeist effect you're shooting for (OOoOOoooooOOOoohhh...a floating ChaaAAaaair...) ?

 

A func_shooter might work, but collisions don't work the same for projectiles as they do static models.

 

You could use an invisible func_mover that you control via scripts (moveToPosition) or via NURBS curves. And then bind the model to aforementioned func_mover. But even in that case, collisions with player and with other moveables won't behave the same (though they wouldn't necessarily have to).

 

You could also give the furniture a collision mesh and make it a moveable. You can use forcefields, then, to toss the moveable around.

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

Yeah an angry ghost to through something at the player or just throw to give the play a scare..

 

hmm all sound's complicated, how about a very fast moving func_mover inside a nodraw tube that pushes a projectile (a chair) out the end of the tube like a gun? could the move speed be made fast enought to eject the chair..? - I shall make a test map!

Link to comment
Share on other sites

You could use an invisible func_mover that you control via scripts (moveToPosition) or via NURBS curves. And then bind the model to aforementioned func_mover. But even in that case, collisions with player and with other moveables won't behave the same (though they wouldn't necessarily have to).

IIRC this is a good method. I read somewhere that when the object is at the end of the spline it continues with the same inertia, so you can use it as a launch pod so to speak. Don't know exactly how.

Link to comment
Share on other sites

You could also simply give a movable chair a velocity via a script function:

 

// Sets the current linear velocity of this entity in units per second. The linear velocity of
// a physics object is a vector that defines the translation of the center of mass in units per second.
scriptEvent	 void    setLinearVelocity( vector velocity );

// Sets the current angular velocity of this entity. The angular velocity of
// a physics object is a vector that passes through the center of mass. The
// direction of this vector defines the axis of rotation and the magnitude
// defines the rate of rotation about the axis in radians per second.
scriptEvent	 void    setAngularVelocity( vector velocity );

 

If you make that a small amount and let the script continously add it for say 20 frames, the moveable will speed up and then fly away:

 

float i = 0;
vector velocity = (0,0,0);
while (i < 20)
 {
 i += 1;
 $mychair.SetLinearVelocity( velocity);
 velocity_x += 0.1;
 velocity_y += 0.1;
 velocity_yz+= 0.05;
 }

 

Although it looks like that is difficult to control. (Adding a small impulse instead of setting the vector would definitely be a better script event but we don'thave that yet. Please file a tracker entry so it doesn't get forgotten)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

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