Back to home

⚙️ Module: Placing Effects

G6AGP
click to copy
This game is archived.
If you with to unarchive it, click the "restore" button in the options menu.
This code can also be found at workshop.codes/G6AGP

Category:
Other

Author:
Kleator

Rating:
0

Version:
1.0.0

Posted:
22 days ago

Last updated:
22 days ago

Tags:
module creation effect placing

Share this workshop!

Options

This module is about creating and finding the right position for your effects. You can place the effect with your cursor and can change position and size live in the progress.

Everything you can adjust while in the map:

  • Position
  • Clipping against surface
  • Distance between you and the effect
  • Size of the effect
  • Save the last effect

Everything you can adjust in the mode settings:

  • Effect-type and color
  • You can toggle into Play-Effects

Used Variables:

  • Global: X, Y, Z
  • Player: R, S, T, U, V, W, Y, Z

You can also view the first 15 saved effects in your inspector recordings.

settings
{
	main
	{
		Description: "This module allows you to place effects precisely in the world, so you can record the coords and size. Settings are shown on the left top corner. - v.1.0.0 - Made by Kleator"
	}

	modes
	{
		Assault
		{
			Limit Roles: 2 Of Each Role Per Team

			enabled maps
			{
				Horizon Lunar Colony
			}
		}

		Control
		{
			Limit Roles: 2 Of Each Role Per Team

			enabled maps
			{
			}
		}

		Escort
		{
			Limit Roles: 2 Of Each Role Per Team

			enabled maps
			{
			}
		}

		Hybrid
		{
			Limit Roles: 2 Of Each Role Per Team

			enabled maps
			{
			}
		}
	}
}

variables
{
	global:
		23: PosSaveTrigger
		24: PosSaveScale
		25: EffectPosArray

	player:
		17: SizeAdjust
		18: Size
		19: SizeLock
		20: ScaleAdjust
		21: PlacingLock
		22: Scale
		24: EffectPos
		25: PlacingEffect
}

rule("EFFECTS --------------------------------------====== SETTINGS BELOW ======---------------------------------------")
{
	event
	{
		Ongoing - Global;
	}
}

rule("EFFECTS - Moving-Effect")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		"If you want to activate play effect, also activate: wait, loop  -  deactivate: create effect"
		disabled Play Effect(Event Player, Bad Pickup Effect, Blue, Event Player.EffectPos, Event Player.Size);
		disabled Wait(0.400, Ignore Condition);
		disabled Loop;
		"Please only change: Effect Type and Color"
		Create Effect(Filtered Array(All Players(All Teams), Event Player.PlacingEffect == True), Sphere, Sky Blue, Event Player.EffectPos,
			Event Player.Size, Visible To Position and Radius);
	}
}

rule("EFFECTS - Save Effect")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global.PosSaveTrigger == True;
	}

	actions
	{
		"Please only edit: Effect Type and Color"
		Create Effect(All Players(All Teams), Sphere, Blue, Global.EffectPosArray[Global.PosSaveScale - 2],
			Global.EffectPosArray[Global.PosSaveScale - 1], Visible To Position and Radius);
		Global.PosSaveTrigger = False;
	}
}

rule("EFFECTS --------------------------------------====== CODE BELOW ======---------------------------------------")
{
	event
	{
		Ongoing - Global;
	}
}

rule("EFFECTS - Init")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Create HUD Text(All Players(All Teams), Null, Null, String("{0}: {1}", Custom String("Turn on/off effect"), Button(Ultimate)),
			Left, 20, Purple, Purple, Red, Visible To and String, Default Visibility);
		Global.PosSaveScale = 0;
		Create HUD Text(Filtered Array(All Players(All Teams), Global.PosSaveScale >= 2), String("{0}:", Custom String("Last")), String(
			"{0}: {1}", Custom String("Size"), Global.EffectPosArray[Global.PosSaveScale - 1]), String("{0}: {1}", Custom String(
			"Position"), Global.EffectPosArray[Global.PosSaveScale - 2]), Left, 25, Purple, Blue, Blue, Visible To and String,
			Default Visibility);
	}
}

rule("EFFECTS - Init player")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		Event Player.PlacingEffect = False;
		"Startrange of the effect - Attention! Do not adjust, until you know, what you do! (Possible for example: 121; 11; 3.316; 1.821; 1.349; 1.161; 1.077; 1.038; 1.019)"
		Event Player.Scale = 11;
		"Startsize of the effect"
		Event Player.Size = 1;
		Event Player.PlacingLock = False;
		Event Player.SizeLock = False;
		"Range Scale multiplier - Attention! Do not edit, as long as you know, what you do!"
		Event Player.ScaleAdjust = 1.019;
		"Size Multiplier - Scales how fast effect size increase/decrease"
		Event Player.SizeAdjust = 1.001;
		Create HUD Text(Filtered Array(Event Player, Event Player.PlacingEffect == True), Null, Null, String("{0}: {1}", Custom String(
			"Turn on/off survace colission"), Button(Interact)), Left, 21, Turquoise, Turquoise, Turquoise, Visible To and String,
			Default Visibility);
		Create HUD Text(Filtered Array(Event Player, (Event Player.PlacingEffect && !Event Player.SizeLock) == True), Null, Null, String(
			"{0}: {1}", String("{0} {1}", Icon String(Arrow: Up), Custom String("Increase Range")), Button(Primary Fire)), Left, 22, Blue,
			Blue, Blue, Visible To and String, Default Visibility);
		Create HUD Text(Filtered Array(Event Player, Event Player.PlacingEffect == True), Null, Null, String("{0}: {1}", Custom String(
			"Toggle Range & Size"), Button(Crouch)), Left, 21.500, Turquoise, Turquoise, Turquoise, Visible To and String,
			Default Visibility);
		Create HUD Text(Filtered Array(Event Player, (Event Player.PlacingEffect && !Event Player.SizeLock) == True), Null, Null, String(
			"{0}: {1}", String("{0} {1}", Icon String(Arrow: Down), Custom String("Decrease Range")), Button(Secondary Fire)), Left,
			22.500, Blue, Blue, Blue, Visible To and String, Default Visibility);
		Create HUD Text(Filtered Array(Event Player, Event Player.PlacingEffect == True), Null, Null, String("{0}: {1}", String("{0} {1}",
			Icon String(Plus), Custom String("Save position")), Button(Reload)), Left, 23, Blue, Blue, Green, Visible To and String,
			Default Visibility);
		Create HUD Text(Filtered Array(Event Player, (Event Player.PlacingEffect && Event Player.SizeLock) == True), Null, Null, String(
			"{0}: {1}", String("{0} {1}", Icon String(Arrow: Up), Custom String("Increase Size")), Button(Primary Fire)), Left, 22, Blue,
			Blue, Aqua, Visible To and String, Default Visibility);
		Create HUD Text(Filtered Array(Event Player, (Event Player.PlacingEffect && Event Player.SizeLock) == True), Null, Null, String(
			"{0}: {1}", String("{0} {1}", Icon String(Arrow: Down), Custom String("Decrease Size")), Button(Secondary Fire)), Left, 22.500,
			Blue, Blue, Aqua, Visible To and String, Default Visibility);
		Create HUD Text(Filtered Array(Event Player, Event Player.PlacingEffect == True), String("{0}:", Custom String("Current")), String(
			"{0}: {1}", Custom String("Size"), Event Player.Size), String("{0}: {1}", Custom String("Position"), Event Player.EffectPos),
			Left, 24, Orange, Green, Green, Visible To and String, Default Visibility);
		Disallow Button(Event Player, Secondary Fire);
		Disallow Button(Event Player, Primary Fire);
		Disallow Button(Event Player, Crouch);
	}
}

rule("EFFECTS - Toggle placing")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Ultimate) == True;
	}

	actions
	{
		Skip If(Event Player.PlacingEffect == True, 3);
		Event Player.PlacingEffect = True;
		Skip(2);
		Skip If(Event Player.PlacingEffect == False, 1);
		Event Player.PlacingEffect = False;
	}
}

rule("EFFECTS - Position of Effect - free")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Event Player.PlacingEffect == True;
	}

	actions
	{
		If(Event Player.PlacingLock == True);
			Event Player.EffectPos = Eye Position(Event Player)   Facing Direction Of(Event Player) * Event Player.Scale;
			Wait(0.016, Ignore Condition);
			Loop If Condition Is True;
		Else;
			Event Player.EffectPos = Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player)   Facing Direction Of(
				Event Player) * Event Player.Scale, All Players(All Teams), Event Player, True);
			Wait(0.016, Ignore Condition);
			Loop If Condition Is True;
	}
}

rule("EFFECTS - Position of Effect - Adjust Scale  ")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Event Player.PlacingEffect == True;
		Event Player.SizeLock == False;
		Is Button Held(Event Player, Primary Fire) == True;
	}

	actions
	{
		Wait(0.125, Ignore Condition);
		Event Player.Scale  = Min(Event Player.ScaleAdjust - 1, 3.316);
		Small Message(Event Player, String("{0} {1} {2}", Icon String(Arrow: Up), Event Player.ScaleAdjust - 1, Custom String(
			"Range-Speed")));
		Event Player.ScaleAdjust *= Event Player.ScaleAdjust;
		Wait(0.125, Ignore Condition);
		Loop If Condition Is True;
	}
}

rule("EFFECTS - Position of Effect - Adjust Scale -")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Event Player.PlacingEffect == True;
		Event Player.SizeLock == False;
		Is Button Held(Event Player, Secondary Fire) == True;
	}

	actions
	{
		Skip If(Event Player.Scale == 0, 5);
		Wait(0.125, Ignore Condition);
		Event Player.Scale -= Min(Event Player.ScaleAdjust - 1, 3.316);
		Small Message(Event Player, String("{0} {1} {2}", Icon String(Arrow: Down), Event Player.ScaleAdjust - 1, Custom String(
			"Range-Speed")));
		Event Player.ScaleAdjust *= Event Player.ScaleAdjust;
		Wait(0.125, Ignore Condition);
		Event Player.Scale = Max(Event Player.Scale, 0);
		Loop If Condition Is True;
	}
}

rule("EFFECTS - Adjust Scale Reset")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		(Is Button Held(Event Player, Primary Fire) || Is Button Held(Event Player, Secondary Fire)) == True;
		Event Player.SizeLock == False;
	}

	actions
	{
		Event Player.ScaleAdjust = 1.019;
		Event Player.Scale = Max(Event Player.Scale, 0);
	}
}

rule("EFFECTS - Toggle survace clip")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Interact) == True;
		Event Player.PlacingEffect == True;
	}

	actions
	{
		Play Effect(Event Player, Explosion Sound, White, Event Player, 50);
		Skip If(Event Player.PlacingLock == True, 4);
		Small Message(All Players(All Teams), Custom String("Survace clip: OFF"));
		Event Player.PlacingLock = True;
		Skip(3);
		Skip If(Event Player.PlacingLock == False, 1);
		Small Message(All Players(All Teams), Custom String("Survace clip: ON"));
		Event Player.PlacingLock = False;
	}
}

rule("EFFECTS - Toggle Size")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Crouch) == True;
		Event Player.PlacingEffect == True;
	}

	actions
	{
		Play Effect(Event Player, Debuff Impact Sound, White, Event Player, 50);
		Skip If(Event Player.SizeLock == True, 4);
		Small Message(All Players(All Teams), Custom String("Size Mode"));
		Event Player.SizeLock = True;
		Skip(3);
		Skip If(Event Player.SizeLock == False, 2);
		Small Message(All Players(All Teams), Custom String("Range Mode"));
		Event Player.SizeLock = False;
	}
}

rule("EFFECTS - Adjust Size  ")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Event Player.PlacingEffect == True;
		Is Button Held(Event Player, Primary Fire) == True;
		Event Player.SizeLock == True;
	}

	actions
	{
		Wait(0.125, Ignore Condition);
		Event Player.Size  = Min(Event Player.SizeAdjust - 1, 10);
		Small Message(Event Player, String("{0} {1} {2}", Icon String(Arrow: Up), Event Player.SizeAdjust - 1, Custom String(
			"Size-Speed")));
		Event Player.SizeAdjust *= Event Player.SizeAdjust;
		Wait(0.125, Ignore Condition);
		Loop If Condition Is True;
	}
}

rule("EFFECTS - Adjust Size -")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Event Player.PlacingEffect == True;
		Is Button Held(Event Player, Secondary Fire) == True;
		Event Player.SizeLock == True;
	}

	actions
	{
		Skip If(Event Player.Size == 0, 6);
		Wait(0.125, Ignore Condition);
		Event Player.Size -= Min(Event Player.SizeAdjust - 1, 10);
		Small Message(Event Player, String("{0} {1} {2}", Icon String(Arrow: Down), Event Player.SizeAdjust - 1, Custom String(
			"Size-Speed")));
		Event Player.SizeAdjust *= Event Player.SizeAdjust;
		Wait(0.125, Ignore Condition);
		Event Player.Size = Max(Event Player.Size, 0);
		Loop If Condition Is True;
	}
}

rule("EFFECTS - Adjust Size reset")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		(Is Button Held(Event Player, Primary Fire) || Is Button Held(Event Player, Secondary Fire)) == True;
		Event Player.SizeLock == True;
	}

	actions
	{
		Event Player.SizeAdjust = 1.010;
		Event Player.Size = Max(Event Player.Size, 0);
	}
}

rule("EFFECTS - Save Effect - Preperation")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Event Player.PlacingEffect == True;
		Is Button Held(Event Player, Reload) == True;
	}

	actions
	{
		Global.EffectPosArray[Global.PosSaveScale] = Event Player.EffectPos;
		Global.PosSaveScale  = 1;
		Global.EffectPosArray[Global.PosSaveScale] = Event Player.Size;
		Global.PosSaveScale  = 1;
		Global.PosSaveTrigger = True;
		Play Effect(All Players(All Teams), Buff Impact Sound, White, Event Player, 50);
	}
}