AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Create ent between 2 points (https://forums.alliedmods.net/showthread.php?t=134963)

Emp0wer 08-10-2010 16:50

Create ent between 2 points
 
Hello. I need to create a solid line ent between 2 points. But I can't understand what origin it should have and how to find size mins/maxs.
PHP Code:

create_ent(const Float:vStart[3],const Float:vEnd[3]) 


naven 08-11-2010 05:03

Re: Create ent between 2 points
 
Hmm box? Check this: http://forums.alliedmods.net/showpos...64&postcount=2

Seta00 08-11-2010 05:21

Re: Create ent between 2 points
 
Quote:

Originally Posted by Emp0wer (Post 1267555)
between 2 points [...] origin

Code:

origin1 = {10.0, 10.0, 10.0}
origin2 = {20.0, 22.0, 20.0}
middle = {30.0/2, 32.0/2, 30.0/2} = {15.0, 16.0, 15.0}


Emp0wer 08-11-2010 08:21

Re: Create ent between 2 points
 
Quote:

Originally Posted by Seta00 (Post 1267953)
Code:

origin1 = {10.0, 10.0, 10.0}
origin2 = {20.0, 22.0, 20.0}
middle = {30.0/2, 32.0/2, 30.0/2} = {15.0, 16.0, 15.0}


I mean that ent should be like a line that connects 2 points (like a beam). But not in the middle of origins.

joropito 08-11-2010 11:34

Re: Create ent between 2 points
 
Quote:

Originally Posted by Emp0wer (Post 1268034)
I mean that ent should be like a line that connects 2 points (like a beam). But not in the middle of origins.

Can you make a drawing?

Hunter-Digital 08-11-2010 12:17

Re: Create ent between 2 points
 
You can make beams with a message.

For use with origins:
Quote:

#define TE_BEAMPOINTS 0 // Beam effect between two points
// write_byte(TE_BEAMPOINTS)
// write_coord(startposition.x)
// write_coord(startposition.y)
// write_coord(startposition.z)
// write_coord(endposition.x)
// write_coord(endposition.y)
// write_coord(endposition.z)
// write_short(sprite index)
// write_byte(starting frame)
// write_byte(frame rate in 0.1's)
// write_byte(life in 0.1's)
// write_byte(line width in 0.1's)
// write_byte(noise amplitude in 0.01's)
// write_byte(red)
// write_byte(green)
// write_byte(blue)
// write_byte(brightness)
// write_byte(scroll speed in 0.1's)

For use with one origin and the other entity:
Quote:

#define TE_BEAMENTPOINT 1 // Beam effect between point and entity
// write_byte(TE_BEAMENTPOINT)
// write_short(start entity)
// write_coord(endposition.x)
// write_coord(endposition.y)
// write_coord(endposition.z)
// write_short(sprite index)
// write_byte(starting frame)
// write_byte(frame rate in 0.1's)
// write_byte(life in 0.1's)
// write_byte(line width in 0.1's)
// write_byte(noise amplitude in 0.01's)
// write_byte(red)
// write_byte(green)
// write_byte(blue)
// write_byte(brightness)
// write_byte(scroll speed in 0.1's)
For use with two entities:
Quote:

#define TE_BEAMENTS 8
// write_byte(TE_BEAMENTS)
// write_short(start entity)
// write_short(end entity)
// write_short(sprite index)
// write_byte(starting frame)
// write_byte(frame rate in 0.1's)
// write_byte(life in 0.1's)
// write_byte(line width in 0.1's)
// write_byte(noise amplitude in 0.01's)
// write_byte(red)
// write_byte(green)
// write_byte(blue)
// write_byte(brightness)
// write_byte(scroll speed in 0.1's)
I belive you know how to send messages...
These are temporary beams, you need to resend them to 'appear' as they're infinite.

You can also prematurely kill a beam attached to an entity:
Quote:

#define TE_KILLBEAM 99 // Kill all beams attached to entity
// write_byte(TE_KILLBEAM)
// write_short(entity)

Emp0wer 08-11-2010 12:23

Re: Create ent between 2 points
 
Quote:

Originally Posted by Hunter-Digital (Post 1268197)
You can make beams with a message.

For use with origins:



For use with one origin and the other entity:


For use with two entities:


I belive you know how to send messages...
These are temporary beams, you need to resend them to 'appear' as they're infinite.

You can also prematurely kill a beam attached to an entity:

Quote:

Originally Posted by joropito (Post 1268153)
Can you make a drawing?

Thx but, I need to create invisible solid line, that's not what beam is:(

joropito 08-11-2010 16:35

Re: Create ent between 2 points
 
Quote:

Originally Posted by Emp0wer (Post 1268201)
Thx but, I need to create invisible solid line, that's not what beam is:(

I mean to make a drawing to understand what you want to do.

If you need a solid line between two points (origin is not a definition) the you should work with entities sizes. You can put an invisible entity with the size of the line you want and make a visible beam.

Emp0wer 08-11-2010 18:31

Re: Create ent between 2 points
 
SOLVED :) I find the way to do that.

Hunter-Digital 08-11-2010 19:21

Re: Create ent between 2 points
 
What exacly do you need this for ? I can't get what you need with min/max and a beam.

Two points are two origins in a map OR they can be two info_target entities that have no model, therefore they act as pointers and you can hook a beam from one to another OR just from one origin to another using a message in my post above.

If that's not it, learn to explain better in english.


All times are GMT -4. The time now is 21:55.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.