Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "zcommon.acs"
- //-----------------------------------------------------------------------------------------
- Script 2 (void)
- {
- if(Thingcount(T_ROCKETLAUNCHER, 22)==0)
- Thing_Spawn(21, T_ROCKETLAUNCHER, 0, 22);
- delay(5);
- if(Thingcount(T_ROCKETAMMO, 23)==0)
- ACS_Execute(3, 0, 22, 0, 0);
- }
- Script 3 (int tag)
- {
- int basex = GetActorX (tag);
- int basey = GetActorY (tag);
- int basez = GetActorZ (tag);
- int angle;
- int cos_rockets = random (25, 35); // For Cosinusoid
- int cos_amplitide = random (16, 48);; //For Cosinusoid
- //----------------------------------* Cosinusoid *----------------------------------
- for (int si = 0; si < cos_rockets; si++)
- {
- angle = 1.0 * si / 12;
- Spawn("RocketAmmo", basex + 5.0*si - 66.0,
- basey + cos_amplitide*cos(angle) - 10.0,
- basez, 23);
- delay(5);
- }
- }
- /*
- Cosinusoid on the OX axis:
- Y^
- |
- |~ ~~ ~~
- | \ / \ / \
- | \ / \ /
- | \ / \ /
- | \ / \ /
- ____O|_____\___________ /__________\____________/______> X
- | \ / \ /
- | \ / \ /
- | \ / \ /
- | \ / \ /
- | \ / \ /
- | ~~ ~~
- Function: f(x)= D + A*cos(angle); D - Distance from axis start point (0,0)
- A - Amplitude of the swing
- angle - Method of how angle is changing
- Cosinusoid graph shows the swing of Y coordinates while X coordinate is increasing.
- It is possible to get various shapes of the cosinusoid graph. It depends on some arguments:
- Amplitude - the higher the value the taller waves of the cosinusoid. Also bigger graph.
- OX drift - is described under X coordinates as a linear function (f(x)=k*x). The bigger
- coefficient k the higher speed of the OX drift. As a result we can see that items
- in the coisinusoid are placed much further from each other.
- Angle - 1.0*I/J Shows a method how angle is changing. In the cosinusoid it sets how
- quickly the deployment of items is changing. This is the main argument that makes
- your cosinusoid look respectable. The higher the value the bigger swing frequency
- and the closer waves of the cosinusoid to each other. So to make your cosinusoid
- more clear try to keep bigger J value comparing it to I. It is very important to
- multiply this ratio by 1.0 - full fluctuation (swing) cycle. We use dot because
- it's a fixed point value and not an integer. We need a fixed point value because
- the result of the ratio (I/J) is also fixed point. When I becomes equal to J (I=J)
- cosinusoid does 1 full period (from top to top).
- For example I'm placing rocket ammos near a rocket launcher 66.0 pixels to the left from the
- launchers' X coordinate.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement