//Main coder Richard Bush //Additional code and maintainance Ingmar //Strat that expose all possible effects parameters in editor #include "n:\code\strats\include\stddefs.inc" #define RFX_FACE_CAMERA_X 1 #define RFX_FACE_CAMERA_Y 2 #define RFX_TRACK_PARENT 4 trigger MsgRemove remove endtrigger strat VFXcosiner(model fx_model, int x_offset, float x_min, float x_max, float x_time, int y_offset, float y_min, float y_max, float y_time, int z_offset, float z_min, float z_max, float z_time, int f_offset, float f_min, float f_max, float f_time, float xrot_add, float yrot_add, float zrot_add, int s_offset, float s_min, float s_max, float s_time, int flags, int m_count, float m_delay, int m_decay, float time_0, float time_1, float time_2, float time_3) #info fx_model "Model File (amf)" = null x_offset "X-Move Offset (degrees):0 degrees (Sin)=0,90 degrees (Cos)=1,180 degrees (-ve Sin)=2,270 degrees (-ve Cos)=3" = 0 x_min "X-Move Miniumum (meters)" = -1.0 x_max "X-Move Maximum (meters)" = 1.0 x_time "X-Move Time (seconds)" = 1.0 y_offset "Y-Move Offset (degrees):0 degrees (Sin)=0,90 degrees (Cos)=1,180 degrees (-ve Sin)=2,270 degrees (-ve Cos)=3" = 1 y_min "Y-Move Miniumum (meters)" = -1.0 y_max "Y-Move Maximum (meters)" = 1.0 y_time "Y-Move Time (seconds)" = 1.0 z_offset "Z-Move Offset (degrees):0 degrees (Sin)=0,90 degrees (Cos)=1,180 degrees (-ve Sin)=2,270 degrees (-ve Cos)=3" = 2 z_min "Z-Move Miniumum (meters)" = -1.0 z_max "Z-Move Maximum (meters)" = 1.0 z_time "Z-Move Time (seconds)" = 1.0 f_offset "Fade Offset (degrees):0 degrees (Sin)=0,90 degrees (Cos)=1,180 degrees (-ve Sin)=2,270 degrees (-ve Cos)=3" = 0 f_min "Fade Miniumum (0-1)" = 0.0 f_max "Fade Maximum (0-1)" = 1.0 f_time "Fade Time (seconds)" = 2.0 xrot_add "X-Rot Add (degrees per second)" = 0.0 yrot_add "Y-Rot Add (degrees per second)" = 0.0 zrot_add "Z-Rot Add (degrees per second)" = 0.0 s_offset "Scale Offset (degrees):0 degrees (Sin)=0,90 degrees (Cos)=1,180 degrees (-ve Sin)=2,270 degrees (-ve Cos)=3" = 0 s_min "Scale Miniumum" = 1.0 s_max "Scale Maximum" = 1.0 s_time "Scale Time (seconds)" = 1.0 flags "Face Camera:None=0,X-Rot Face Camera=1,Y-Rot Face Camera=2,XY-Rot Face Camera=3" = 0 m_count "Motion Trail Count" = 4.0 m_delay "Motion Trail Delay (seconds)" = 0.1 m_decay "Motion Fade and Scale Decay:None=0,Fade=1,Scale=2,Fade and Scale=3" = 1 time_0 "Delay Time (seconds)" = 0.0 time_1 "Appear Time (seconds)" = 0.0 time_2 "Life Time (seconds)" = 0.0 time_3 "Disappear Time (seconds)" = 0.0 editormodel = "\VFX\222cube.AMF" group = "Effects" #endinfo createtrigger message MSG_REMOVE MsgRemove // the print is used for copying parameters from igmar's level into strat code... if m_count != -1 //print "spawnafter FXTestSinWaves(, "; x_offset; ", "; x_min; ", "; x_max; ", "; x_time; ", "; y_offset; ", "; y_min; ", "; y_max; ", "; y_time; ", "; z_offset; ", "; z_min; ", "; z_max; ", "; z_time; ", "; f_offset; ", "; f_min; ", "; f_max; ", "; f_time; ", "; xrot_add; ", "; yrot_add; ", "; zrot_add; ", "; s_offset; ", "; s_min; ", "; s_max; ", "; s_time; ", "; flags; ", "; m_count; ", "; m_delay; ", "; m_decay; ")" endif if (m_count > 0) and (m_delay > 0.0) float i = 0.0 float j = tofloat(m_count) float f_min_dec = f_min / (j + 1.0) float f_max_dec = f_max / (j + 1.0) float s_min_dec = s_min / (j + 1.0) float s_max_dec = s_max / (j + 1.0) float x_min_dec = x_min / (j + 1.0) float x_max_dec = x_max / (j + 1.0) float y_min_dec = y_min / (j + 1.0) float y_max_dec = y_max / (j + 1.0) float z_min_dec = z_min / (j + 1.0) float z_max_dec = z_max / (j + 1.0) while j > 0 spawnafter VFXcosiner(fx_model, x_offset, x_min, x_max, x_time, y_offset, y_min, y_max, y_time, z_offset, z_min, z_max, z_time, f_offset, f_min, f_max, f_time, xrot_add, yrot_add, zrot_add, s_offset, s_min, s_max, s_time, flags, -1, i, 0, time_0, time_1, time_2, time_3) i += m_delay if m_decay & 1 f_min -= f_min_dec f_max -= f_max_dec endif if m_decay & 2 s_min -= s_min_dec s_max -= s_max_dec endif j -= 1 endwhile immediate //remove m_delay = 0.0 endif m_delay *= FPS float global_scale int time_state time_state = 0 global_scale = 0.0 vec3 start_pos = object_pos vec3 start_rot = object_rot float x_pos = tofloat(x_offset) * 1024.0 float y_pos = tofloat(y_offset) * 1024.0 float z_pos = tofloat(z_offset) * 1024.0 float f_pos = tofloat(f_offset) * 1024.0 float s_pos = tofloat(s_offset) * 1024.0 vec3 rot_pos m_delay = 0 - m_delay if x_time = 0 x_time = 1 endif if y_time = 0 y_time = 1 endif if z_time = 0 z_time = 1 endif if f_time = 0 f_time = 1 endif if s_time = 0 s_time = 1 endif x_pos += (4096.0 / (x_time * FPS)) * m_delay y_pos += (4096.0 / (y_time * FPS)) * m_delay z_pos += (4096.0 / (z_time * FPS)) * m_delay rot_pos.x = xrot_add * ((4096.0 / 360.0) / FPS) * m_delay rot_pos.y = yrot_add * ((4096.0 / 360.0) / FPS) * m_delay rot_pos.z = zrot_add * ((4096.0 / 360.0) / FPS) * m_delay f_pos += (4096.0 / (f_time * FPS)) * m_delay s_pos += (4096.0 / (s_time * FPS)) * m_delay loop if object_visible setmodel fx_model if time_state = 0 global_scale = 0.0 if time_0 > 0.0 time_0 -= (world_speed_60() / FPS) if time_0 <= 0.0 time_state = 1 endif else time_state = 1 endif elseif time_state = 1 if time_1 > 0.0 global_scale = min(global_scale + (world_speed_60() / (time_1 * FPS)), 1.0) if global_scale = 1.0 time_state = 2 endif else global_scale = 1.0 time_state = 2 endif elseif time_state = 2 if time_2 > 0.0 time_2 -= (world_speed_60() / FPS) if time_2 <= 0.0 time_state = 3 endif endif elseif time_state = 3 if time_3 > 0.0 global_scale = max(global_scale - (world_speed_60() / (time_3 * FPS)), 0.0) if global_scale = 0.0 remove endif else remove endif endif object_pos = start_pos object_rot = start_rot if flags & RFX_FACE_CAMERA_X object_rot.x = xangle_to(camera) endif if flags & RFX_FACE_CAMERA_Y object_rot.y = angle_to(camera) endif if flags & RFX_TRACK_PARENT if parent object_pos = parent.object_pos else remove endif endif object_pos.x += (x_min + (((sin(x_pos) + 1.0) * 0.5) * (x_max - x_min))) * global_scale object_pos.y += (y_min + (((sin(y_pos) + 1.0) * 0.5) * (y_max - y_min))) * global_scale object_pos.z += (z_min + (((sin(z_pos) + 1.0) * 0.5) * (z_max - z_min))) * global_scale object_rot.x += (rot_pos.x) * global_scale object_rot.y += (rot_pos.y) * global_scale object_rot.z += (rot_pos.z) * global_scale object_fade = (f_min + (((sin(f_pos) + 1.0) * 0.5) * (f_max - f_min))) * global_scale if time_state = 1 // big hack! scale (s_min + (((sin(s_pos) + 1.0) * 0.5) * (s_max - s_min))) * global_scale else scale (s_min + (((sin(s_pos) + 1.0) * 0.5) * (s_max - s_min))) //* global_scale endif endif x_pos += (4096.0 / (x_time * FPS)) * world_speed_60() y_pos += (4096.0 / (y_time * FPS)) * world_speed_60() z_pos += (4096.0 / (z_time * FPS)) * world_speed_60() rot_pos.x += xrot_add * ((4096.0 / 360.0) / FPS) * world_speed_60() rot_pos.y += yrot_add * ((4096.0 / 360.0) / FPS) * world_speed_60() rot_pos.z += zrot_add * ((4096.0 / 360.0) / FPS) * world_speed_60() f_pos += (4096.0 / (f_time * FPS)) * world_speed_60() s_pos += (4096.0 / (s_time * FPS)) * world_speed_60() endloop endstrat