AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Dropping an entity(sprite) on a specific origin from the sky ! (https://forums.alliedmods.net/showthread.php?t=185605)

byetovice 05-19-2012 14:20

Dropping an entity(sprite) on a specific origin from the sky !
 
Hi guys,
I'm trying to make a plugin that will drop a sprite falling from the sky to an origin. Like a shower.
Let's say abc.spr, i have the origin and i add 2000 to origin[2] to find the position in the sky.
But i couldn't make a sprite falling to the origin. Can you please help me giving me a code?

Thanks..

usaexelent 05-19-2012 14:24

Re: Dropping an entity(sprite) on a specific origin from the sky !
 
Trace line from the origin, then create ent and set entitys model to your sprite, if theres alot of entitys that you want to create then I think that you can do it with message_begin and particles.

byetovice 05-19-2012 14:31

Re: Dropping an entity(sprite) on a specific origin from the sky !
 
yes i want to create many sprites falling from the sky. can you give me a basic example of using message_begin to do that?

<VeCo> 05-19-2012 14:33

Re: Dropping an entity(sprite) on a specific origin from the sky !
 
That would be really laggy and could crash the server.

byetovice 05-19-2012 14:34

Re: Dropping an entity(sprite) on a specific origin from the sky !
 
does it slow down a lot? just wanna make a shower of a special sprite

usaexelent 05-19-2012 15:54

Re: Dropping an entity(sprite) on a specific origin from the sky !
 
This is not so laggy as you think, because about 10-20 particles don't do a lot of lagg, but if theres 100+ then it can make a bit of lagg

byetovice 05-19-2012 16:34

Re: Dropping an entity(sprite) on a specific origin from the sky !
 
But how ? how can i do that ?

usaexelent 05-19-2012 17:21

Re: Dropping an entity(sprite) on a specific origin from the sky !
 
#define TE_PARTICLEBURST 122 // Very similar to lavasplash
// write_byte(TE_PARTICLEBURST)
// write_coord(origin)
// write_short(radius)
// write_byte(particle color)
// write_byte(duration * 10) (will be randomized a bit)

or

#define TE_BREAKMODEL 108 // Box of models or sprites
// write_byte(TE_BREAKMODEL)
// write_coord(position.x)
// write_coord(position.y)
// write_coord(position.z)
// write_coord(size.x)
// write_coord(size.y)
// write_coord(size.z)
// write_coord(velocity.x)
// write_coord(velocity.y)
// write_coord(velocity.z)
// write_byte(random velocity in 10's)
// write_short(sprite or model index)
// write_byte(count)
// write_byte(life in 0.1 secs)
// write_byte(flags)

I think you could use this

<VeCo> 05-20-2012 06:43

Re: Dropping an entity(sprite) on a specific origin from the sky !
 
I thought he want to make something like a rain effect. But if he want it to do it only in a specific place, then he can use TE_SPRITETRAIL:

PHP Code:

#define TE_SPRITETRAIL              15       // Line of moving glow sprites with gravity, fadeout, and collisions
// write_byte(TE_SPRITETRAIL)
// 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(count)
// write_byte(life in 0.1's) 
// write_byte(scale in 0.1's) 
// write_byte(velocity along vector in 10's)
// write_byte(randomness of velocity in 10's) 


byetovice 05-20-2012 10:01

Re: Dropping an entity(sprite) on a specific origin from the sky !
 
Ok guys. solved. I wanted to make a shower of fire balls , or rockets..
For rocket, it was ok, but for a flame shower, i had to use sprites as the models of the entities falling from the sky.
The problem was that i could see the blackparts that were supposted to be transparent.

Veco is right, it is so laggy. The thing that makes it laggy is that you have to find a origin just under the skybox.
For each entity, it slows down the game and your server.


All times are GMT -4. The time now is 00:30.

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