Raised This Month: $ Target: $400
 0% 

EST_Effect Stocks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zeroibis
Veteran Member
Join Date: Jun 2007
Old 07-20-2012 , 13:22   EST_Effect Stocks
Reply With Quote #1

Based off [Port] wcs_effects by joshtrav here: https://forums.alliedmods.net/showthread.php?p=1316309

These are part of my ZERO STOCKS package. These stocks will allow you to easily translate est effects into methods that will run in SM. I have created stock functions with the same names as the est effect ones to make things easy. These functions also have the same order of parameters so that converting from es to sm will be as fast and easy as possible. Currently many es scripts have some cool effects that are hard to come by in SM yet they are using the SM plugin above to achieve them. These stocks are intended to make the use of those effects simple and easy to implement into any SM program.

Here is a lit of the stocks available:
PHP Code:
/*
 * ZERO STOCKS EFFECTS v1.0.0
 * AWSOME STOCKS THAT DO SHIT RIGHT!
 * www.IBISGaming.com
 */

#if defined _zerostocks_est_effects_included
  #endinput
#endif
#define _zerostocks_est_effects_included

#include <sourcemod>
#include <W3SIncs/War3Source_Interface>
#include <sdkhooks>
#include <sdktools>
#include <sdktools_functions>
#include <sdktools_tempents>
#include <sdktools_tempents_stocks>
#include <cstrike>
#include <smlib>


/*
 * est_Effect_01 <player Filter> <delay> <position 'X,Y,Z'> <direction 'X,Y,Z'>
 * 
 * @param position        Location of Effect XYZ.
 * @param direction        Direction of Effect XYZ.
 * 
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_01(Float:position[3], Float:direction[3])
{
    
TE_SetupArmorRicochet(positiondirection);
}

/* 
 * SAME AS ABOVE
 * est_Effect 1 <player Filter> <delay> <position 'X,Y,Z'> <direction 'X,Y,Z'>
 * 
 * @param position        Location of Effect XYZ.
 * @param direction        Direction of Effect XYZ.
 * 
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect1(Float:position[3], Float:direction[3])
{
    
TE_SetupArmorRicochet(positiondirection);
}

/* 
 * est_Effect_02 <player Filter> <delay> <model> <start ent> <start position 'X,Y,Z'> <end ent> <end position 'X,Y,Z'> <framerate> <life> <start width> <end width> <fade distance> <amplitude> <R> <G> <B> <A> <speed>
 * 
 * @param modelIndex                    index of model.
 * @param startEntity                    Ent to start effect at.
 * @param Float:startposition[3]        Reletive position to ENT.
 * @param endEntity                        Ent to end effect at.
 * @param Float:endposition[3]            Reletive position to ENT.
 * @param frameRate                        fps.
 * @param Float:lifeF                    length of effect duration.
 * @param Float:widthF                    Starting width.
 * @param Float:endWidthF                Ending width.
 * @param fadeLength                    fade distance of effect.
 * @param Float:amplitudeF                amplitude of beam.
 * @param colorArray[4]                    colors of effect RGBA.
 * @param speed                            speed of effect.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_02(modelIndexstartEntityFloat:startposition[3], endEntityFloat:endposition[3], frameRateFloat:lifeFFloat:widthFFloat:endWidthFfadeLengthFloat:amplitudeFcolorArray[4], speed)
{
    
BeamEntPoint(0modelIndexstartEntitystartpositionendEntityendpositionframeRatelifeFwidthFendWidthFfadeLengthamplitudeFcolorArrayspeed);
}

/* 
 * est_Effect_03 <player Filter> <delay> <model> <start ent> <end ent> <framerate> <life> <start width> <end width> <fade distance> <amplitude> <R> <G> <B> <A> <speed>
 * 
 * @param modelIndex                    index of model.
 * @param startEntity                    Ent to start effect at.
 * @param endEntity                        Ent to end effect at.
 * @param frameRate                        fps.
 * @param Float:lifeF                    length of effect duration.
 * @param Float:widthF                    Starting width.
 * @param Float:endWidthF                Ending width.
 * @param fadeLength                    fade distance of effect.
 * @param Float:amplitudeF                amplitude of beam.
 * @param colorArray[4]                    colors of effect RGBA.
 * @param speed                            speed of effect.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_03(modelIndexstartEntityendEntityframeRateFloat:lifeFFloat:widthFFloat:endWidthFfadeLengthFloat:amplitudeFcolorArray[4], speed)
{
    
BeamEnts(0modelIndexstartEntityendEntityframeRatelifeFwidthFendWidthFfadeLengthamplitudeFcolorArrayspeed);
}

/*
 * est_Effect 3 <player Filter> <delay> <model> (start <X> <Y> <Z>) (end <X> <Y> <Z>) <life> <width> <end width> <Red> <Green> <Blue> <Alpha>
 * 
 * @param modelIndex                    Precached model index.
 * @param Float:startposition[3]        Start position of the beam.
 * @param Float:endposition[3]            End position of the beam.
 * @param Float:lifeF                    Time duration of the beam.
 * @param Float:widthF                    Initial beam width.
 * @param Float:endWidthF                Final beam width.
 * @param colorArray[4]                    Color array (r, g, b, a).
 * 
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect3(modelIndexstartpositionendpositionFloat:lifeFFloat:widthFFloat:endWidthFcolorArray[4])
{
    
TE_SetupBeamPoints(startpositionendpositionmodelIndex000lifeFwidthFendWidthF00.0colorArray0);
}

/*
 * est_Effect_04 <player Filter> <delay> <model> <Follow ent> <life> <start width> <end width> <fade distance> <R> <G> <B> <A>
 * 
 * @param modelIndex            Precached model index.
 * @param entity                Entity index from where the beam starts (or follows).
 * @param Float:lifeF            Time duration of the beam.
 * @param Float:widthF            Initial beam width.
 * @param Float:endWidthF        Final beam width.
 * @param fadeLength            Fade distance of effect.
 * @param colorArray[4]            Color array (r, g, b, a).
 * 
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_04(modelIndexentityFloat:lifeFFloat:widthFFloat:endWidthFfadeLengthcolorArray[4])
{
    
TE_SetupBeamFollow(entitymodelIndex0lifeFwidthFendWidthFfadeLengthcolorArray);
}

/*
 * est_Effect 4 <player Filter> <delay> <model> <userid> <life> <width> <end width> <time to fade> <Red> <Green> <Blue> <Alpha>
 * 
 * @param modelIndex            Precached model index.
 * @param entity                Entity index from where the beam starts (or follows).
 * @param Float:lifeF            Time duration of the beam.
 * @param Float:widthF            Initial beam width.
 * @param Float:endWidthF        Final beam width.
 * @param fadeLength            Fade distance of effect.
 * @param colorArray[4]            Color array (r, g, b, a).
 * 
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect4(modelIndexentityFloat:lifeFFloat:widthFFloat:endWidthFfadeLengthcolorArray[4])
{
    
TE_SetupBeamFollow(entitymodelIndex0lifeFwidthFendWidthFfadeLengthcolorArray);
}

/*
 * est_effect_05 <player Filter> <delay> <model> <start ent> <end ent> <framerate> <life> <start width> <end width> <fade distance> <amplitude> <R> <G> <B> <A> <speed>
 * 
 * @param modelIndex            Precached model index.
 * @param startEntity            Entity index from where the beam starts.
 * @param endEntity                Entity index from where the beam ends.
 * @param frameRate                FPS.
 * @param Float:lifeF            Time duration of the beam.
 * @param Float:widthF            Initial beam width.
 * @param Float:endWidthF        Final beam width.
 * @param fadeLength            Fade distance of effect.
 * @param colorArray[4]            Color array (r, g, b, a).
 * @param speed                    speed of effect.
 * 
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_05(modelIndexstartEntityendEntityframeRateFloat:lifeFFloat:widthFFloat:endWidthFFadeLengthFloat:amplitudeFcolorArray[4], speed)
{
    
TE_SetupBeamLaser(startEntityendEntitymodelIndex00frameRatelifeFwidthFendWidthFfadeLengthamplitudeFcolorArrayspeed);
}

/*
 * est_Effect_06 <player Filter> <delay> <model> <start position 'X,Y,Z'> <end position 'X,Y,Z'> <framerate> <life> <start width> <end width> <fade distance> <amplitude> <R> <G> <B> <A> <speed>
 * 
 * @param modelIndex                    Precached model index.
 * @param Float:startposition[3]        Start position of the beam.
 * @param Float:endposition[3]            End position of the beam.
 * @param frameRate                        FPS.
 * @param Float:lifeF                    Time duration of the beam.
 * @param Float:widthF                    Initial beam width.
 * @param Float:endWidthF                Final beam width.
 * @param fadeLength                    Fade distance of effect.
 * @param Float:amplitudeF                Amplitude of effect.
 * @param colorArray[4]                    Color array (r, g, b, a).
 * @param speed                            speed of effect.
 * 
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_06(modelIndexstartpositionendpositionframeRateFloat:lifeFFloat:widthFFloat:endWidthFFadeLengthFloat:amplitudeFcolorArray[4], speed)
{
    
TE_SetupBeamPoints(startpositionendpositionmodelIndex00frameRatelifeFwidthFendWidthFfadeLengthamplitudeFcolorArrayspeed);
}

/* 
 * est_Effect_07 <player Filter> <delay> <model> <start ent> <end ent> <framerate> <life> <width> <spread> <amplitude> <R> <G> <B> <A> <speed>
 * 
 * NOTE THAT SPREAD IS IGNORED
 *
 * @param modelIndex                    index of model.
 * @param startEntity                    Ent to start effect at.
 * @param endEntity                        Ent to end effect at.
 * @param frameRate                        fps.
 * @param Float:lifeF                    length of effect duration.
 * @param Float:widthF                    Starting width.
 * @param fadeLength                    fade distance of effect.
 * @param Float:amplitudeF                amplitude of beam.
 * @param colorArray[4]                    colors of effect RGBA.
 * @param speed                            speed of effect.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_07(modelIndexstartEntityendEntityframeRateFloat:lifeFFloat:widthFfadeLengthFloat:amplitudeFcolorArray[4], speed)
{
    
BeamRing(0modelIndexstartEntityendEntityframeRatelifeFwidthFwidthFfadeLengthamplitudeFcolorArrayspeed);
}

/* 
 * est_Effect 7 <player Filter> <delay> <model> <x> <y> <z> <scale> <framerate>
 * 
 * NOTE THAT MODEL IS IGNORED
 *
 * @param modelIndex            index of model.
 * @param Float:origin[3]        Origin of effect XYZ.
 * @param Float:scaleF            Size of effect.
 * @param frameRate                FPS of effect.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect7(modelIndexFloat:origin[3], Float:scaleFframeRate)
{
    
TE_SetupSmoke(originmodelIndexscaleFframeRate);
}

/* 
 * est_Effect_08 <player Filter> <delay> <model> <center 'X,Y,Z'> <Start Radius> <End Radius> <framerate> <life> <width> <spread> <amplitude> <R> <G> <B> <A> <speed> <flags>
 * 
 * NOTE THAT SPREAD IS IGNORED
 *
 * @param modelIndex                    index of model.
 * @param Float:center[3]                Center of Ring.
 * @param startRadius                    Radius to start effect at.
 * @param endRadius                        Radius to end effect at.
 * @param frameRate                        fps.
 * @param Float:lifeF                    length of effect duration.
 * @param Float:widthF                    Width.
 * @param fadeLength                    fade distance of effect.
 * @param Float:amplitudeF                amplitude of beam.
 * @param colorArray[4]                    colors of effect RGBA.
 * @param speed                            speed of effect.
 * @param flags                            Effect Flags.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_08(modelIndexFloat:center[3], startRadiusendRadiusframeRateFloat:lifeFFloat:widthFfadeLengthFloat:amplitudeFcolorArray[4], speedflags)
{
    
BeamRingPoint(0modelIndexcenterstartRadiusendRadiusframeRatelifeFwidthFwidthFfadeLengthamplitudeFcolorArrayspeedflags);
}

/* 
 * est_Effect_09 <player Filter> <delay> <model> <points> <rgPoints 'X,Y,Z'>
 * 
 * NOTE THAT MODEL IS IGNORED
 *
 * @param points                        Number of points.
 * @param Float:effectVector1[3]        rgPoints (X,Y,Z).
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_09(pointsFloat:effectVector1[3])
{
    
BeamSpline(pointseffectVector1);
}

/*
 * est_Effect_10 <player Filter> <delay> <origin 'X,Y,Z'> <direction 'X,Y,Z'> <R> <G> <B> <A> <Size>
 * 
 * @param position                Location of Effect XYZ.
 * @param direction                Direction of Effect XYZ.
 * @param colorArray[4]            colors of effect RGBA.
 * @param size                    size of effect.
 * 
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_10(Float:position[3], Float:direction[3], colorArray[4], speed)
{
    
TE_SetupBloodSprite(positiondirectioncolorArraysize00);
}

/* 
 * est_Effect 10 <player Filter> <delay> <model> <x> <y> <z> <start radius> <end radius> <life> <width> <spread> <amplitude> <Red> <Green> <Blue> <Alpha> <speed>
 * 
 * NOTE THAT SPREAD IS IGNORED
 *
 * @param modelIndex                    index of model.
 * @param Float:center[3]                Center of Ring.
 * @param startRadius                    Radius to start effect at.
 * @param endRadius                        Radius to end effect at.
 * @param Float:lifeF                    length of effect duration.
 * @param Float:widthF                    Width.
 * @param fadeLength                    fade distance of effect.
 * @param Float:amplitudeF                amplitude of beam.
 * @param colorArray[4]                    colors of effect RGBA.
 * @param speed                            speed of effect.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect10(modelIndexFloat:center[3], startRadiusendRadiusFloat:lifeFFloat:widthFfadeLengthFloat:amplitudeFcolorArray[4], speed)
{
    
BeamRingPoint(0modelIndexcenterstartRadiusendRadius0lifeFwidthFwidthFfadeLengthamplitudeFcolorArrayspeed0);
}

/*
 * est_Effect_11 <player Filter> <delay> <origin 'X,Y,Z'> <direction 'X,Y,Z'> <R> <G> <B> <A> <Amount>
 * 
 * @param Float:origin[3]            Origin of effect.
 * @param Float:direction[3]        Direction of effect.
 * @param colorArray[4]                Color of effect RBGA.
 * @param amount                    Amount of streams.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_11(Float:origin[3], Float:direction[3], colorArray[4], amount)
{
    
BloodStream(origindirectioncolorArrayamount);
}

/*
 * est_Effect 11 <player Filter> <delay> <model> <x> <y> <z> <life> <size> <brightness>
 * 
 * @param modelIndex                index of model.
 * @param Float:origin[3]            Origin of effect.
 * @param Float:lifeF                Length of effect duration.
 * @param Float:sizeF                Size of effect.
 * @param brightness                Brightness of effect.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect11(modelIndexFloat:origin[3], Float:lifeFFloat:sizeFbrightness)
{
    
TE_SetupGlowSprite(originmodelIndexlifeFsizeFbrightness);
}

/*
 * est_Effect_12 <player Filter> <delay> <model> <origin 'X,Y,Z'> <angle 'Pitch,Yaw,Roll'> <Size 'X,Y,Z'> <Velocity 'X,Y,Z'> <Randomization> <count> <time> <flags>
 * 
 * @param modelIndex                index of model.
 * @param Float:origin[3]            Origin of effect XYZ.
 * @param Float:angle[3]            angle of effect PYR.
 * @param Float:size[3]                size of effect XYZ.
 * @param Float:velocity[3]            Velocity of effect XYZ.
 * @param ran                        Randomization.
 * @param count                        Amount of streams.
 * @param Float:time                Length of effect.
 * @param flags                        Effect Flags.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_12(modelIndexFloat:origin[3], Float:angle[3], Float:size[3], Float:velocity[3], rancountFloat:timeflags)
{
    
BreakModel(modelIndexorigin[3], angle[3], size[3], velocityrancounttimeflags);
}

/*
 * est_Effect_13 <player Filter> <delay> <decal> <origin 'X,Y,Z'> <target entity index>
 * 
 * @param modelIndex            Decal to use.
 * @param Float:origin[3]        Origin of effect.
 * @param target                Target ent. 0 for world
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_13(modelIndexFloat:origin[3], target)
{
    
Decal(modelIndexorigintarget);
}

/*
 * est_Effect_14 <player Filter> <delay> <model> <Min 'X,Y,Z'> <Max 'X,Y,Z'> <heigth> <count> <speed>
 * 
 * @param modelIndex            index of model.
 * @param Float:min[3]            Min bubbles XYZ.
 * @param Float:max[3]            Max bubbles XYZ.
 * @param Float:heightF            Height of effect.
 * @param count                    Amount of bubbles.
 * @param Float:speedF            Speed of bubbles.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_14(modelIndexFloat:min[3], Float:max[3], Float:heightFcountFloat:speedF)
{
    
Bubbles(modelIndexmin[3], max[3], heightFcountspeedF);
}

/*
 * est_Effect_18 <player Filter> <delay> <Position 'X,Y,Z'> <R> <G> <B> <exponent> <radius> <time> <decay>
 * 
 * @param Float:origin[3]        Origin of effect XYZ.
 * @param colorArray[3]            Color of effect RGB.
 * @param exponent                exponent.
 * @param Float:fRadius            Radius of Effect.
 * @param Float:fTime            Length of Effect.
 * @param Float:fDecay            Rate of Decay.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_18(Float:origin[3], colorArray[3], exponentFloat:fRadiusFloat:fTimeFloat:fDecay)
{
    
DynamicLight(origincolorArrayexponentfRadiusfTimefDecay);
}

/*
 * est_Effect_24 <player Filter> <delay> <model> <Position 'X,Y,Z'> <reversed>
 * 
 * @param modelIndex            index of model.
 * @param Float:origin[3]        Origin of effect XYZ.
 * @param nReversed                Reversed?
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_24(modelIndexFloat:origin[3], nReversed)
{
    
DynamicLight(originmodelIndexnReversed);
}

/*
 * est_Effect_32 <Player Filter> <Delay> <Position "X Y Z"> <Magnitude> <Trail Length> <Direction "X Y Z">
 * 
 * @param Float:origin[3]        Origin of effect XYZ.
 * @param Magnitude                Sparks size.
 * @param TrailLength            Trail lenght of the sparks.
 * @param Float:dir[3]            Direction of the sparks.
 *
 * Requires TE_SendToAll() or TE_Send() or TE_SendToClient() to render
 */
stock est_Effect_32(Float:origin[3], MagnitudeTrailLengthFloat:dir[3])
{
    
TE_SetupSparks(origindirMagnitudeTrailLength);

Example lets say you wanted to copy an effect like:
Code:
es_delayed .1 es est_effect 10 #a 0 sprites/orangelight1.vmt server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2) 99 50 1 3 11 2 255 255 0 255 9
You would need to handle any timers and location data yourself but you then would place your final method call like this:
orangelight1 would be: your cahced model index
targetLocation: would be the location you want the effect to appear
Your color array would be: 255, 255, 0, 255
Code:
est_Effect10(orangelight1, targetLocation, 99, 50, 1.0, 3.0, 11, 2.0, colorArray, 9)
As you see simple easy line by line effect translation!

To get the latest version of these stocks please download from the tracking thread here: http://www.ibisgaming.com/forums/sho...821#post140821

There are many other stocks in there besides effects as well so feel free to use them. I will always update that thread linked to patch any bugs and to add more stocks. If your just using the effects you can remove the required includes for War3Source_Interface and smlib.

Most of these are untested so if you have a bug let me know. I will keep the thread on the IBIS Gaming site updated whenever I release a new version.

Enjoy
__________________

Last edited by zeroibis; 07-23-2012 at 18:56.
zeroibis is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 07-21-2012 , 00:45   Re: EST_Effect Stocks
Reply With Quote #2

Thanks a lot for sharing. Will be a big help if looking forward to add TE effects !

I feel like it's a good thing to have a stock .7z giving a lot of effects (It's pretty much the only one I have, beside the scattered ones of W3S).

<3
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work
RedSword is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 07-22-2012 , 03:15   Re: EST_Effect Stocks
Reply With Quote #3

Hopefully this will also encourage people to share some code for cool effects so we can show those es noobs that SM is where it is at!

I plan to release an update in the next week or so with some more est_effects! That release will also include some other functions as well. These include files are used heavily across my war3source races and so new versions will usually release at similar times to new races on my server.
__________________
zeroibis is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 07-23-2012 , 18:57   Re: EST_Effect Stocks
Reply With Quote #4

Updated, fixed so that est_effects is correctly included.

Added new effect: est_Effect_32

Added some more weapon removal functions.
__________________
zeroibis is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 07-25-2012 , 01:08   Re: EST_Effect Stocks
Reply With Quote #5

Found some bugs will patch in next release.
__________________
zeroibis is offline
al1alu
Senior Member
Join Date: Jun 2011
Old 07-25-2012 , 10:16   Re: EST_Effect Stocks
Reply With Quote #6

Very simple, i have a warcraft:source server and will be nice to use.
I am creating a port for est_commands too, if you have any suggestions.
al1alu is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:32.


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