Create
Return to post

Comparing difference between and

View raw
  • settings
  • {
  • main
  • {
  • Description: "Ashe and McCree saddle up. (by nobody#1774)"
  • }
  • lobby
  • {
  • Allow Players Who Are In Queue: Yes
  • Map Rotation: After A Game
  • Match Voice Chat: Enabled
  • Max Spectators: 12
  • Max Team 1 Players: 5
  • Max Team 2 Players: 5
  • Return To Lobby: Never
  • }
  • modes
  • {
  • Skirmish
  • {
  • enabled maps
  • {
  • Blizzard World
  • Dorado
  • Eichenwalde
  • Hollywood
  • Junkertown
  • Route 66
  • }
  • }
  • Team Deathmatch
  • {
  • Game Length In Minutes: 15
  • Mercy Resurrect Counteracts Kills: Off
  • enabled maps
  • {
  • }
  • }
  • General
  • {
  • Enemy Health Bars: Off
  • Game Mode Start: Immediately
  • Hero Limit: Off
  • Spawn Health Packs: Enabled
  • }
  • }
  • heroes
  • {
  • General
  • {
  • Damage Dealt: 25%
  • Movement Speed: 50%
  • D.Va
  • {
  • Spawn Without Mech: On
  • Ultimate Ability Self-Destruct: Off
  • }
  • Doomfist
  • {
  • Rising Uppercut: Off
  • Rocket Punch: Off
  • Seismic Slam: Off
  • Ultimate Ability Meteor Strike: Off
  • }
  • Orisa
  • {
  • Damage Received: 10%
  • Movement Gravity: 75%
  • Ultimate Ability Supercharger: Off
  • }
  • Roadhog
  • {
  • Take a Breather: Off
  • }
  • Sombra
  • {
  • Hack: Off
  • }
  • Torbjörn
  • {
  • Deploy Turret: Off
  • }
  • enabled heroes
  • {
  • Ana
  • Ashe
  • D.Va
  • Doomfist
  • Hanzo
  • McCree
  • Mercy
  • Roadhog
  • Sombra
  • Torbjörn
  • }
  • }
  • }
  • extensions
  • {
  • Spawn More Dummy Bots
  • }
  • }
  • variables
  • {
  • global:
  • 0: INT_Loop_Control
  • 1: VECTORS_Map_Bounds
  • 2: VECTORS_Gold
  • 3: EFFECTS_Gold
  • 4: INTS_Team_Scores
  • 5: STRINGS_Tips
  • 6: STRINGS_Gold_Collected_Self
  • 7: STRINGS_Gold_Spawned
  • 8: STRINGS_Horse_Names
  • 9: ARRAY_VECTORS_Gold_and_EFFECTS
  • 10: LOCAL_VECTOR_Gold
  • 11: LOCAL_EFFECT_Gold
  • player:
  • 0: PLAYER_Horse
  • 1: INT_Riding_Throttle_Magnitude
  • 2: BOOL_Horse_Spawned_For
  • 3: PLAYER_Rider
  • 4: REAL_Stamina
  • 5: BOOL_Galloping
  • 7: PLAYER_Passenger
  • 8: INT_Gold
  • 9: EFFECT_Gold
  • 10: LOCAL_Gold
  • 11: INT_Slot
  • 12: REAL_Last_Speed
  • 13: INT_Name_Index
  • 14: LOCAL_Index
  • }
  • rule("INIT: Variables")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Global.STRINGS_Tips = Array(Custom String("Hop on a horse to ride it."), Custom String("Two can ride."), Custom String(
  • "Ride over gold to pick it up."), Custom String("Return a horse with gold to your spawn to capture it."), Custom String(
  • "Be a bandit: Steal their horse and their gold!"), Custom String("The more gold a horse carries, the slower it is."),
  • Custom String("Work together to find horses and give your teammates rides to them."));
  • Global.ARRAY_VECTORS_Gold_and_EFFECTS = Empty Array;
  • Global.VECTORS_Gold = Empty Array;
  • Global.EFFECTS_Gold = Empty Array;
  • Set Objective Description(All Players(All Teams), Custom String("Collect gold with a horse and return it to your base"),
  • Visible To and String);
  • "HUD"
  • Create HUD Text(All Players(All Teams), Custom String("SHARE CODE"), Custom String("https://workshop.codes/cowboy-wars"),
  • Custom String("YSPHN"), Left, 0, Color(White), Color(Turquoise), Color(White), Visible To and String, Default Visibility);
  • Create HUD Text(Local Player, Custom String("Score"), Custom String("Them: {0}", Global.INTS_Team_Scores[Team Of(Local Player)
  • == Team 1 ? 2 : 1]), Custom String("Us: {0}", Global.INTS_Team_Scores[Team Of(Local Player) == Team 1 ? 1 : 2]), Top, 0, Color(
  • Turquoise), Color(Red), Color(Blue), Visible To and String, Default Visibility);
  • Create Progress Bar HUD Text(Local Player, Local Player.PLAYER_Horse.REAL_Stamina, Custom String("Horse stamina ({0} to gallop)",
  • Input Binding String(Button(Interact))), Right, 99, Color(White), Color(White), Visible To Values and Color,
  • Default Visibility);
  • disabled Create Progress Bar HUD Text(Local Player, Local Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude * 100, Custom String(
  • "Horse throttle"), Right, 98, Color(White), Color(White), Visible To Values and Color, Default Visibility);
  • Create Progress Bar HUD Text(Local Player, (
  • Local Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude - Local Player.PLAYER_Horse.INT_Gold * 5 / 100) * 100, Custom String(
  • "Horse throttle"), Right, 98, Color(White), Color(White), Visible To Values and Color, Default Visibility);
  • Create HUD Text(Local Player, Custom String("GOLD"), Custom String("On horse"), Local Player.PLAYER_Horse.INT_Gold, Right, 10,
  • Color(Yellow), Color(Yellow), Color(White), Visible To and String, Default Visibility);
  • Global.STRINGS_Gold_Collected_Self = Array(Custom String("That'll do fine..."), Custom String("Let's get that back home..."),
  • Custom String("Ooh, shiny..."), Custom String("Cool, calm, and collected..."), Custom String("We're gonna be rich!"),
  • Custom String("Not too shabby..."), Custom String("Easy now, gotta get it back to base first..."), Custom String(
  • "Don't mind if I do..."));
  • Global.STRINGS_Gold_Spawned = Array(Custom String("Smells like gold 'round these parts..."), Custom String(
  • "Is that a jingle I hear..."), Custom String("Hmm, somethin' seems shiny somewhere..."));
  • Global.STRINGS_Horse_Names = Array(Custom String("Ladybug"), Custom String("Sugar"), Custom String("Spirit"), Custom String(
  • "Silver"), Custom String("Lily"), Custom String("Ransom"), Custom String("Treasure"), Custom String("Domino"), Custom String(
  • "Scout"), Custom String("Pirate"), Custom String("Bolt"), Custom String("Victory"), Custom String("Champ"), Custom String(
  • "Trigger"), Custom String("Cash"), Custom String("Buttons"), Custom String("Boots"), Custom String("Whiskers"), Custom String(
  • "Flopsy"), Custom String("Buster"));
  • }
  • }
  • rule("INIT: Find map bounds (maybe this will sort-of work)")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Global.VECTORS_Map_Bounds = Array(Nearest Walkable Position(Vector(1000, 0, 1000)), Nearest Walkable Position(Vector(1000, 0,
  • -1000)), Nearest Walkable Position(Vector(-1000, 0, -1000)), Nearest Walkable Position(Vector(-1000, 0, 1000)));
  • }
  • }
  • rule("SETUP: Shorten wait")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Assembling Heroes == True;
  • }
  • actions
  • {
  • Set Match Time(3);
  • }
  • }
  • rule("GAME: Spawn horses")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Game In Progress == True;
  • Count Of(Filtered Array(All Players(All Teams), Is Dummy Bot(Current Array Element))) == 0;
  • }
  • actions
  • {
  • Small Message(All Players(All Teams), Custom String("Respawning horses..."));
  • For Global Variable(INT_Loop_Control, 11, 24, 1);
  • Create Dummy Bot(Hero(Orisa), Global.INT_Loop_Control < 18 ? Team 1 : Team 2, 0 + Global.INT_Loop_Control,
  • Nearest Walkable Position(Vector(Random Real(Min(X Component Of(Global.VECTORS_Map_Bounds[2]), X Component Of(
  • Global.VECTORS_Map_Bounds[3])), Max(X Component Of(Global.VECTORS_Map_Bounds[0]), X Component Of(
  • Global.VECTORS_Map_Bounds[1]))), Random Real(-30, 30), Random Real(Min(Z Component Of(Global.VECTORS_Map_Bounds[1]),
  • Z Component Of(Global.VECTORS_Map_Bounds[2])), Max(Z Component Of(Global.VECTORS_Map_Bounds[0]), Z Component Of(
  • Global.VECTORS_Map_Bounds[3]))))), Vector(0, 0, 0));
  • Last Created Entity.INT_Name_Index = Global.INT_Loop_Control - 11;
  • disabled Start Scaling Player(Last Created Entity, 0.500, False);
  • disabled Disable Nameplates(Last Created Entity, All Players(All Teams));
  • disabled Set Status(Last Created Entity, Null, Phased Out, 9999);
  • End;
  • }
  • }
  • rule("HORSE: Joins")
  • {
  • event
  • {
  • Player Joined Match;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.REAL_Stamina = 100;
  • Set Move Speed(Event Player, 200);
  • Start Scaling Player(Event Player, 0.500, False);
  • Set Status(Event Player, Null, Phased Out, 9999);
  • Start Forcing Dummy Bot Name(Event Player, Global.STRINGS_Horse_Names[Event Player.INT_Name_Index]);
  • Enable Nameplates(Event Player, All Players(All Teams));
  • Create Effect(Event Player.INT_Gold > 0 ? All Players(All Teams) : Null, Sparkles, Color(Yellow), Event Player,
  • Event Player.INT_Gold * 0.500, Visible To Position and Radius);
  • }
  • }
  • rule("HORSE: Dies")
  • {
  • event
  • {
  • Player Died;
  • All;
  • Orisa;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • }
  • actions
  • {
  • Detach Players(Event Player.PLAYER_Rider);
  • Detach Players(Event Player.PLAYER_Passenger);
  • Stop Throttle In Direction(Event Player);
  • Stop Facing(Event Player);
  • Event Player.INT_Riding_Throttle_Magnitude = 0;
  • Event Player.PLAYER_Rider.PLAYER_Horse = Null;
  • Event Player.PLAYER_Rider = Null;
  • Event Player.PLAYER_Passenger = Null;
  • Event Player.INT_Gold = 0;
  • }
  • }
  • rule("PLAYER: Joins")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) != True;
  • Event Player.BOOL_Horse_Spawned_For != True;
  • Is Alive(Event Player) == True;
  • Has Spawned(Event Player) == True;
  • }
  • actions
  • {
  • Create Progress Bar HUD Text(Event Player, Event Player.PLAYER_Horse.REAL_Stamina, Custom String("Horse stamina ({0} to gallop)",
  • disabled Create Progress Bar HUD Text(Event Player, Event Player.PLAYER_Horse.REAL_Stamina, Custom String("Horse stamina ({0} to gallop)",
  • Input Binding String(Button(Interact))), Right, 99, Color(White), Color(White), Visible To Values and Color,
  • Default Visibility);
  • Create Progress Bar HUD Text(Event Player, Health(Event Player.PLAYER_Horse) / Max Health(Event Player.PLAYER_Horse) * 100,
  • disabled Create Progress Bar HUD Text(Event Player, Health(Event Player.PLAYER_Horse) / Max Health(Event Player.PLAYER_Horse) * 100,
  • Custom String("Horse health"), Right, 98, Color(White), Color(White), Visible To Values and Color, Default Visibility);
  • Start Scaling Player(Event Player, 0.500, False);
  • Start Forcing Player Outlines(Filtered Array(All Players(All Teams), Is Dummy Bot(Current Array Element)), Event Player, False,
  • Color(White), Default);
  • Disable Nameplates(Filtered Array(All Players(All Teams), Is Dummy Bot(Current Array Element)), Event Player);
  • Event Player.BOOL_Horse_Spawned_For = True;
  • Event Player.PLAYER_Horse = Null;
  • Event Player.BOOL_Horse_Spawned_For = True;
  • Wait(2, Ignore Condition);
  • Small Message(Event Player, Custom String("Thanks to these players for their help testing:"));
  • Wait(2, Ignore Condition);
  • Small Message(Event Player, Custom String("MedensNox, Adam, Belle, Zombie, Nemmow, LuckyGhost"));
  • Small Message(Event Player, Custom String("MedensNox, Adam, Belle, Zombie, Nemmow, LuckyGhost, Pops"));
  • }
  • }
  • rule("PLAYER: Spawns")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Is Alive(Event Player) == True;
  • Is Game In Progress == True;
  • Has Spawned(Event Player) == True;
  • Event Player.PLAYER_Horse == Null;
  • }
  • actions
  • {
  • Wait(8, Abort When False);
  • Small Message(Event Player, Custom String("Hmm...better find a horse..."));
  • Wait(8, Abort When False);
  • Small Message(Event Player, Random Value In Array(Global.STRINGS_Tips));
  • }
  • }
  • rule("PLAYER: Dies")
  • {
  • event
  • {
  • Player Died;
  • All;
  • All;
  • }
  • conditions
  • {
  • disabled Event Player.PLAYER_Horse != Null;
  • Is Dummy Bot(Event Player) != True;
  • }
  • actions
  • {
  • Detach Players(Event Player);
  • "Player was rider, not passenger."
  • If(Event Player.PLAYER_Horse.PLAYER_Passenger != Event Player);
  • Stop Forcing Throttle(Event Player.PLAYER_Horse);
  • Stop Facing(Event Player.PLAYER_Horse);
  • Event Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude = 0;
  • Event Player.PLAYER_Horse.PLAYER_Rider = Null;
  • End;
  • Event Player.PLAYER_Horse = Null;
  • }
  • }
  • rule("PLAYER: Mounts horse")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Is Alive(Event Player) == True;
  • Has Spawned(Event Player) == True;
  • Event Player.PLAYER_Horse == Null;
  • Distance Between(Event Player, First Of(Sorted Array(Filtered Array(All Players(All Teams), Hero Of(Current Array Element) == Hero(
  • Orisa)), Distance Between(Current Array Element, Event Player)))) < 2;
  • Is Button Held(Event Player, Button(Jump)) == True;
  • }
  • actions
  • {
  • Event Player.PLAYER_Horse = First Of(Sorted Array(Filtered Array(All Players(All Teams), Hero Of(Current Array Element) == Hero(
  • Orisa)), Distance Between(Current Array Element, Event Player)));
  • "Horse already has rider."
  • If(Event Player.PLAYER_Horse.PLAYER_Rider != Null);
  • "Rider on other team."
  • If(Team Of(Event Player) != Team Of(Event Player.PLAYER_Horse.PLAYER_Rider));
  • Event Player.PLAYER_Horse = Null;
  • Small Message(Event Player, Custom String("Rider is not on your team"));
  • Else;
  • disabled Small Message(Event Player, Custom String("Rider is not on your team"));
  • "Rider on same team and no passenger: ride shotgun."
  • Else If(!Event Player.PLAYER_Horse.PLAYER_Passenger);
  • "FIXME: Sometimes when two players are jumping near a ridden horse, they'll both become passengers, and somehow one of them also becomes the rider and gets control of the horse. Race conditions in Workshop, man..."
  • Event Player.PLAYER_Horse.PLAYER_Passenger = Event Player;
  • Attach Players(Event Player, Event Player.PLAYER_Horse, Vector(0, 0.350, -0.450));
  • Small Message(Event Player, Custom String("Mounted as passenger"));
  • Small Message(Event Player.PLAYER_Horse.PLAYER_Rider, Custom String("{0}'s ridin' shotgun", Event Player));
  • Small Message(Event Player, Custom String("Hitchin' a ride with {0}", Event Player.PLAYER_Horse.PLAYER_Rider));
  • End;
  • "Horse has no rider."
  • Else;
  • "Horse is on other team: destroy dummy bot and respawn it on rider's team."
  • If(Team Of(Event Player) != Team Of(Event Player.PLAYER_Horse));
  • Event Player.INT_Slot = Slot Of(Event Player.PLAYER_Horse);
  • Event Player.INT_Name_Index = Event Player.PLAYER_Horse.INT_Name_Index;
  • Event Player.INT_Gold = Event Player.PLAYER_Horse.INT_Gold;
  • Destroy Dummy Bot(Team Of(Event Player.PLAYER_Horse), Slot Of(Event Player.PLAYER_Horse));
  • Create Dummy Bot(Hero(Orisa), Team Of(Event Player), -1, Position Of(Event Player), Vector(0, 0, 0));
  • "FIXME: Is it necessary to WAIT UNTIL() after this? Is this a race condition sometimes?"
  • Create Dummy Bot(Hero(Orisa), Team Of(Event Player), Event Player.INT_Slot, Position Of(Event Player), Vector(0, 0, 0));
  • Event Player.PLAYER_Horse = Last Created Entity;
  • Event Player.PLAYER_Horse.INT_Gold = Event Player.INT_Gold;
  • Event Player.PLAYER_Horse.INT_Name_Index = Event Player.INT_Name_Index;
  • End;
  • "FIXME: Sometimes this does not seem to set PLAYER_Rider. I have no idea why. There are no waits around here, so there shouldn't be any race conditions."
  • Event Player.PLAYER_Horse.PLAYER_Rider = Event Player;
  • Attach Players(Event Player, Event Player.PLAYER_Horse, Vector(0, 0.500, -0.125));
  • Start Throttle In Direction(Event Player.PLAYER_Horse, Facing Direction Of(Event Player.PLAYER_Horse) * (
  • Event Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude < 0 ? -1 : 1), Absolute Value(
  • Event Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude), To World, Replace existing throttle, Direction and Magnitude);
  • Event Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude) - Event Player.PLAYER_Horse.INT_Gold * 5 / 100, To World,
  • Replace existing throttle, Direction and Magnitude);
  • Start Facing(Event Player.PLAYER_Horse, Direction From Angles(X Component Of(Throttle Of(Event Player)) * (
  • 1.100 - Event Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude) * 10 + Horizontal Angle From Direction(Facing Direction Of(
  • Event Player.PLAYER_Horse)), 0), 100, To World, Direction and Turn Rate);
  • End;
  • Small Message(Host Player, Custom String("DEBUG: {0} mounted {1} (rider: {2})", Event Player, Event Player.PLAYER_Horse,
  • Event Player.PLAYER_Horse.PLAYER_Rider));
  • }
  • }
  • rule("PLAYER: Dismounts horse")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Is Alive(Event Player) == True;
  • Has Spawned(Event Player) == True;
  • Event Player.PLAYER_Horse != Null;
  • Is Button Held(Event Player, Button(Crouch)) == True;
  • }
  • actions
  • {
  • Detach Players(Event Player);
  • "Rider dismounts."
  • If(Event Player != Event Player.PLAYER_Horse.PLAYER_Passenger);
  • Stop Throttle In Direction(Event Player.PLAYER_Horse);
  • Stop Facing(Event Player.PLAYER_Horse);
  • Event Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude = 0;
  • Event Player.PLAYER_Horse.PLAYER_Rider = Null;
  • "Passenger dismounts."
  • Else;
  • Small Message(Event Player.PLAYER_Horse.PLAYER_Rider, Custom String("{0} hopped off", Event Player));
  • Event Player.PLAYER_Horse.PLAYER_Passenger = Null;
  • End;
  • Event Player.PLAYER_Horse = Null;
  • }
  • }
  • rule("PLAYER: Riding (accelerating/decelerating)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Is Alive(Event Player) == True;
  • Has Spawned(Event Player) == True;
  • Event Player.PLAYER_Horse != Null;
  • Z Component Of(Throttle Of(Event Player)) != 0;
  • Event Player != Event Player.PLAYER_Horse.PLAYER_Passenger;
  • Z Component Of(Throttle Of(Event Player)) != 0;
  • }
  • actions
  • {
  • Event Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude = Max(Min(Z Component Of(Throttle Of(Event Player))
  • * 0.050 + Event Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude, 1), -1);
  • Wait(0.100, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule("PLAYER: Riding (jumps)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Is Alive(Event Player) == True;
  • Has Spawned(Event Player) == True;
  • Event Player.PLAYER_Horse != Null;
  • Is Button Held(Event Player, Button(Jump)) == True;
  • Event Player != Event Player.PLAYER_Horse.PLAYER_Passenger;
  • Is Button Held(Event Player, Button(Jump)) == True;
  • }
  • actions
  • {
  • Press Button(Event Player.PLAYER_Horse, Button(Jump));
  • }
  • }
  • rule("HORSE: Joins")
  • {
  • event
  • {
  • Player Joined Match;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • }
  • actions
  • {
  • Set Move Speed(Event Player, 200);
  • Event Player.REAL_Stamina = 100;
  • Create Effect(Event Player.INT_Gold > 0 ? All Players(All Teams) : Null, Sparkles, Color(Yellow), Event Player,
  • Event Player.INT_Gold * 0.500, Visible To Position and Radius);
  • Start Scaling Player(Event Player, 0.500, False);
  • Disable Nameplates(Event Player, All Players(All Teams));
  • Set Status(Event Player, Null, Phased Out, 9999);
  • }
  • }
  • rule("PLAYER: Dies")
  • {
  • event
  • {
  • Player Died;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.PLAYER_Horse != Null;
  • Is Dummy Bot(Event Player) != True;
  • }
  • actions
  • {
  • Detach Players(Event Player);
  • Stop Forcing Throttle(Event Player.PLAYER_Horse);
  • Stop Facing(Event Player.PLAYER_Horse);
  • Event Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude = 0;
  • Event Player.PLAYER_Horse.PLAYER_Rider = Null;
  • Event Player.PLAYER_Horse = Null;
  • }
  • }
  • rule("HORSE: Dies")
  • {
  • event
  • {
  • Player Died;
  • All;
  • Orisa;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • }
  • actions
  • {
  • Detach Players(Event Player.PLAYER_Rider);
  • Stop Throttle In Direction(Event Player);
  • Stop Facing(Event Player);
  • Event Player.INT_Riding_Throttle_Magnitude = 0;
  • Event Player.PLAYER_Rider.PLAYER_Horse = Null;
  • Event Player.PLAYER_Rider = Null;
  • Event Player.INT_Gold = 0;
  • }
  • }
  • disabled rule("DEBUG: HUDs")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Create HUD Text(Host Player, Custom String("POSITION"), Null, Position Of(Host Player), Right, 0, Color(White), Color(White),
  • Color(White), Visible To and String, Default Visibility);
  • Create HUD Text(Host Player, Custom String("THROTTLE"), Null, Throttle Of(Host Player), Right, 0, Color(White), Color(White),
  • Color(White), Visible To and String, Default Visibility);
  • Create HUD Text(Host Player, Custom String("HORSE SPEED"), Null, Horizontal Speed Of(Host Player.PLAYER_Horse), Right, 0, Color(
  • White), Color(White), Color(White), Visible To and String, Default Visibility);
  • Create HUD Text(Host Player, Custom String("EFFECTS"), Null, Entity Count, Right, 0, Color(White), Color(White), Color(White),
  • Visible To and String, Default Visibility);
  • }
  • }
  • rule("PLAYER: Riding (not galloping)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Is Alive(Event Player) == True;
  • Has Spawned(Event Player) == True;
  • Event Player.PLAYER_Horse != Null;
  • Is Button Held(Event Player, Button(Interact)) == False;
  • Event Player != Event Player.PLAYER_Horse.PLAYER_Passenger;
  • Is Button Held(Event Player, Button(Interact)) == False;
  • }
  • actions
  • {
  • Event Player.PLAYER_Horse.BOOL_Galloping = False;
  • }
  • }
  • rule("PLAYER: Riding (galloping)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Is Alive(Event Player) == True;
  • Has Spawned(Event Player) == True;
  • Event Player.PLAYER_Horse != Null;
  • Event Player != Event Player.PLAYER_Horse.PLAYER_Passenger;
  • Is Button Held(Event Player, Button(Interact)) == True;
  • Event Player.PLAYER_Horse.REAL_Stamina > 50;
  • Event Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude == 1;
  • Event Player != Event Player.PLAYER_Horse.PLAYER_Passenger;
  • }
  • actions
  • {
  • Event Player.PLAYER_Horse.BOOL_Galloping = True;
  • }
  • }
  • rule("HORSE: Galloping")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • Event Player.BOOL_Galloping == True;
  • Event Player.REAL_Stamina > 0;
  • }
  • actions
  • {
  • Set Move Speed(Event Player, 300);
  • Event Player.REAL_Stamina -= 2;
  • If(Event Player.REAL_Stamina <= 0);
  • Event Player.BOOL_Galloping = False;
  • Else;
  • Wait(0.050, Ignore Condition);
  • Loop If Condition Is True;
  • End;
  • }
  • }
  • rule("HORSE: Not Galloping")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • Event Player.BOOL_Galloping != True;
  • }
  • actions
  • {
  • Set Move Speed(Event Player, 200);
  • If(Event Player.REAL_Stamina < 100);
  • Event Player.REAL_Stamina += 0.500;
  • Else If(Event Player.REAL_Stamina > 100);
  • Event Player.REAL_Stamina = 100;
  • End;
  • Wait(0.050, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • disabled rule("PLAYER: Leaves")
  • rule("HORSE: Track speed")
  • {
  • event
  • {
  • Player Left Match;
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) != True;
  • Event Player.PLAYER_Horse != Null;
  • Is Dummy Bot(Event Player) == True;
  • Event Player.PLAYER_Rider != Null;
  • }
  • actions
  • {
  • Detach Players(Event Player);
  • Stop Throttle In Direction(Event Player.PLAYER_Horse);
  • Stop Facing(Event Player.PLAYER_Horse);
  • Event Player.PLAYER_Horse.INT_Riding_Throttle_Magnitude = 0;
  • Event Player.PLAYER_Horse.PLAYER_Rider = Null;
  • Event Player.PLAYER_Horse = Null;
  • Event Player.REAL_Last_Speed = Horizontal Speed Of(Event Player);
  • Wait(0.250, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule("HORSE: Reduce throttle when running into things (makes it easier to turn)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • Event Player.INT_Riding_Throttle_Magnitude != 0;
  • Event Player.REAL_Last_Speed > 0.500;
  • Horizontal Speed Of(Event Player) <= 0.500;
  • }
  • actions
  • {
  • Event Player.INT_Riding_Throttle_Magnitude = 0;
  • }
  • }
  • rule("HORSE: Failsafe if rider leaves (since PLAYER LEFT MATCH never seems to work)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • Event Player.PLAYER_Rider != Null;
  • (!Entity Exists(Event Player.PLAYER_Rider) || !Is Alive(Event Player.PLAYER_Rider)) == True;
  • }
  • actions
  • {
  • Stop Throttle In Direction(Event Player);
  • Stop Facing(Event Player);
  • Event Player.INT_Riding_Throttle_Magnitude = 0;
  • Event Player.PLAYER_Rider = Null;
  • }
  • }
  • rule("GOLD: Spawn")
  • rule("HORSE: Failsafe if passenger leaves (since PLAYER LEFT MATCH never seems to work)")
  • {
  • event
  • {
  • Ongoing - Global;
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Game In Progress == True;
  • Count Of(Global.VECTORS_Gold) < 32;
  • Is Dummy Bot(Event Player) == True;
  • Event Player.PLAYER_Passenger != Null;
  • (!Entity Exists(Event Player.PLAYER_Passenger) || !Is Alive(Event Player.PLAYER_Passenger)) == True;
  • }
  • actions
  • {
  • Wait(30, Ignore Condition);
  • Modify Global Variable(VECTORS_Gold, Append To Array, Nearest Walkable Position(Vector(Random Real(Min(X Component Of(
  • Global.VECTORS_Map_Bounds[2]), X Component Of(Global.VECTORS_Map_Bounds[3])), Max(X Component Of(Global.VECTORS_Map_Bounds[0]),
  • X Component Of(Global.VECTORS_Map_Bounds[1]))), Random Real(-30, 30), Random Real(Min(Z Component Of(
  • Global.VECTORS_Map_Bounds[1]), Z Component Of(Global.VECTORS_Map_Bounds[2])), Max(Z Component Of(Global.VECTORS_Map_Bounds[0]),
  • Z Component Of(Global.VECTORS_Map_Bounds[3]))))));
  • Create Effect(All Players(All Teams), Orb, Color(Yellow), Last Of(Global.VECTORS_Gold), 0.500, Visible To);
  • Modify Global Variable(EFFECTS_Gold, Append To Array, Last Created Entity);
  • Small Message(All Players(All Teams), Custom String("I smell gold 'round these parts..."));
  • Loop If Condition Is True;
  • Event Player.PLAYER_Passenger = Null;
  • }
  • }
  • rule("PLAYER: Spawns")
  • rule("GOLD: Spawn")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Alive(Event Player) == True;
  • Is Game In Progress == True;
  • Has Spawned(Event Player) == True;
  • Event Player.PLAYER_Horse == Null;
  • Is Dummy Bot(Event Player) == False;
  • Count Of(Global.ARRAY_VECTORS_Gold_and_EFFECTS) < 16;
  • }
  • actions
  • {
  • Wait(8, Abort When False);
  • Small Message(Event Player, Custom String("Hmm...better find a horse..."));
  • Wait(30, Ignore Condition);
  • "Try to adjust for statistical bias by randomly selecting from a smaller portion of the map."
  • If(Random Integer(0, 1) == 0);
  • Global.LOCAL_VECTOR_Gold = Nearest Walkable Position(Vector(Random Real(Min(X Component Of(Global.VECTORS_Map_Bounds[2]) / 2,
  • X Component Of(Global.VECTORS_Map_Bounds[3]) / 2), Max(X Component Of(Global.VECTORS_Map_Bounds[0]) / 2, X Component Of(
  • Global.VECTORS_Map_Bounds[1]) / 2)), Random Real(-30, 30), Random Real(Min(Z Component Of(Global.VECTORS_Map_Bounds[1]) / 2,
  • Z Component Of(Global.VECTORS_Map_Bounds[2]) / 2), Max(Z Component Of(Global.VECTORS_Map_Bounds[0]) / 2, Z Component Of(
  • Global.VECTORS_Map_Bounds[3]) / 2))));
  • Else;
  • Global.LOCAL_VECTOR_Gold = Nearest Walkable Position(Vector(Random Real(Min(X Component Of(Global.VECTORS_Map_Bounds[2]),
  • X Component Of(Global.VECTORS_Map_Bounds[3])), Max(X Component Of(Global.VECTORS_Map_Bounds[0]), X Component Of(
  • Global.VECTORS_Map_Bounds[1]))), Random Real(-30, 30), Random Real(Min(Z Component Of(Global.VECTORS_Map_Bounds[1]),
  • Z Component Of(Global.VECTORS_Map_Bounds[2])), Max(Z Component Of(Global.VECTORS_Map_Bounds[0]), Z Component Of(
  • Global.VECTORS_Map_Bounds[3])))));
  • End;
  • "If vector already exists in array, don't make another one there."
  • If(Array Contains(Mapped Array(Global.ARRAY_VECTORS_Gold_and_EFFECTS, First Of(Current Array Element)), Global.LOCAL_VECTOR_Gold));
  • Small Message(Host Player, Custom String("DEBUG: New gold vector already in array. Skipping..."));
  • "New vector: create effect and add to array."
  • Else;
  • Create Effect(All Players(All Teams), Orb, Color(Yellow), Global.LOCAL_VECTOR_Gold, 0.250, Visible To);
  • Global.LOCAL_EFFECT_Gold = Last Created Entity;
  • Global.ARRAY_VECTORS_Gold_and_EFFECTS[Count Of(Global.ARRAY_VECTORS_Gold_and_EFFECTS)] = Array(Global.LOCAL_VECTOR_Gold,
  • Global.LOCAL_EFFECT_Gold);
  • Small Message(All Players(All Teams), Random Value In Array(Global.STRINGS_Gold_Spawned));
  • End;
  • Loop If Condition Is True;
  • }
  • }
  • rule("HORSE: Picks up gold")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • Distance Between(Event Player, First Of(Sorted Array(Global.VECTORS_Gold, Distance Between(Event Player, Current Array Element))))
  • < 1;
  • Is Alive(Event Player) == True;
  • Count Of(Global.VECTORS_Gold) > 0;
  • Has Spawned(Event Player) == True;
  • Event Player.PLAYER_Rider != Null;
  • Is Alive(Event Player.PLAYER_Rider) == True;
  • Has Spawned(Event Player.PLAYER_Rider) == True;
  • Count Of(Global.ARRAY_VECTORS_Gold_and_EFFECTS) > 0;
  • Distance Between(Event Player, First Of(First Of(Sorted Array(Global.ARRAY_VECTORS_Gold_and_EFFECTS, Distance Between(Event Player,
  • First Of(Current Array Element)))))) < 1;
  • }
  • actions
  • {
  • Event Player.LOCAL_Gold = First Of(Sorted Array(Global.VECTORS_Gold, Distance Between(Event Player, Current Array Element)));
  • Destroy Effect(Global.EFFECTS_Gold[Index Of Array Value(Global.VECTORS_Gold, Event Player.LOCAL_Gold)]);
  • Modify Global Variable(EFFECTS_Gold, Remove From Array By Index, Index Of Array Value(Global.VECTORS_Gold,
  • Event Player.LOCAL_Gold));
  • Modify Global Variable(VECTORS_Gold, Remove From Array By Value, Event Player.EFFECT_Gold);
  • Event Player.LOCAL_Gold = First Of(Sorted Array(Global.ARRAY_VECTORS_Gold_and_EFFECTS, Distance Between(Event Player, First Of(
  • Current Array Element))));
  • If(Event Player.LOCAL_Gold == Null);
  • Small Message(Host Player, Custom String("DEBUG: LOCAL_Gold is null"));
  • Else;
  • Small Message(Host Player, Custom String("DEBUG: LOCAL_Gold is {0}", Event Player.LOCAL_Gold));
  • End;
  • Event Player.LOCAL_Index = Index Of Array Value(Global.ARRAY_VECTORS_Gold_and_EFFECTS, Event Player.LOCAL_Gold);
  • If(!Entity Exists(Last Of(Event Player.LOCAL_Gold)));
  • Small Message(Host Player, Custom String("DEBUG: Trying to delete non-existent gold effect"));
  • End;
  • Destroy Effect(Last Of(Event Player.LOCAL_Gold));
  • Modify Global Variable(ARRAY_VECTORS_Gold_and_EFFECTS, Remove From Array By Index, Event Player.LOCAL_Index);
  • Event Player.INT_Gold += 1;
  • Small Message(All Players(All Teams), Custom String("Sounds like someone picked up gold 'round here..."));
  • Small Message(Filtered Array(All Players(All Teams), Current Array Element != Event Player.PLAYER_Rider), Custom String(
  • "Sounds like someone picked up gold 'round here..."));
  • Small Message(Event Player.PLAYER_Rider, Random Value In Array(Global.STRINGS_Gold_Collected_Self));
  • }
  • }
  • rule("HORSE: Drops off gold")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • Event Player.INT_Gold > 0;
  • Is In Spawn Room(Event Player.PLAYER_Rider) == True;
  • }
  • actions
  • {
  • Big Message(All Players(All Teams), Custom String("{0} captured {1} gold!", Event Player.PLAYER_Rider, Event Player.INT_Gold));
  • Modify Team Score(Team Of(Event Player.PLAYER_Rider), Event Player.INT_Gold);
  • Global.INTS_Team_Scores[Team Of(Event Player.PLAYER_Rider) == Team 1 ? 1 : 2] += Event Player.INT_Gold;
  • "Necessary or the message always says 0 gold. :("
  • Wait(0.016, Ignore Condition);
  • Event Player.INT_Gold = 0;
  • }
  • }
  • rule("HORSES: Roam")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • Event Player.PLAYER_Rider == Null;
  • }
  • actions
  • {
  • Wait(Random Real(1, 5), Abort When False);
  • If(Is True For Any(Filtered Array(All Players(All Teams), Is Dummy Bot(Current Array Element)), Is In Line of Sight(Event Player,
  • Current Array Element, Barriers Do Not Block LOS)) && Random Integer(0, 1) == 0);
  • Start Facing(Event Player, Direction Towards(Event Player, Random Value In Array(Filtered Array(All Players(All Teams),
  • Is Dummy Bot(Current Array Element) && Is In Line of Sight(Event Player, Current Array Element, Barriers Do Not Block LOS)))),
  • 30, To World, None);
  • Else;
  • Start Facing(Event Player, Direction From Angles(Random Real(-180, 180), 0), 30, To World, None);
  • End;
  • Start Throttle In Direction(Event Player, Vector(0, 0, 1), Random Real(-1, 1), To Player, Replace existing throttle,
  • Direction and Magnitude);
  • Loop;
  • }
  • }
Join the Workshop.codes Discord