News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

tossing a debris or an item via script - how ?

Started by motorsep, July 31, 2015, 10:42:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

motorsep

Is there any script event that would toss another entity (either debris or movable item)  ?

solarsplace

Hi

Nothing ready made, but this is the script 'overview' of what I do in the SDK to 'toss' an item.

This should work:

Spawn your moveable item with "nodrop" "1" keyval set.

Set its origin where you want it to be - just in front of player?

Ideally you want to test whether you can spawn a bounding box in front of the player with no collision to make sure you don't spawn into a wall! could be a pain in script! or just do a trace out say 128 units and make sure you don't hit anything before you spawn it.

Then create a vector variable pointing forward of the player.

Then:

// 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 );

Have a look in one of the Doom3 AI scripts like 'ai_monster_flying_lostsoul.script' for an example of how to use this.

Sorry not at a comp where I can create a script right now.

Thanks

motorsep

Aye, thanks for the tip. It makes sense and gives me idea of how to approach it.