Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- variables
- {
- global:
- 0: _extendedGlobalCollection
- 1: _arrayBuilder
- 7: cellStates
- 10: generateStep
- 11: buildMazeAt
- 14: navigator
- 15: navigateTo
- 16: walkPath
- 17: chosenPathEffects
- 75: aStarCheck
- 76: visited
- 77: i
- 78: DestroyEffectArray_index
- }
- rule("Maze: A* Nav")
- {
- event
- {
- Ongoing - Global;
- }
- conditions
- {
- Global Variable(generateStep) == 6;
- Is Button Held(Host Player, Interact) == True;
- }
- actions
- {
- Wait(0.016, Ignore Condition);
- Skip If(Compare(Value In Array(Global Variable(_extendedGlobalCollection), 39), ==, 0), 3);
- Set Global Variable At Index(_extendedGlobalCollection, 40, Value In Array(Global Variable(_extendedGlobalCollection), 39));
- Set Global Variable At Index(_extendedGlobalCollection, 39, 0);
- Skip(Value In Array(Global Variable(_extendedGlobalCollection), 40));
- Set Global Variable(navigateTo, Divide(Subtract(Position Of(Host Player), Global Variable(buildMazeAt)), 7));
- Small Message(All Players(All Teams), Custom String("Navigating to {0}", Global Variable(navigateTo), Null, Null));
- Set Global Variable At Index(_extendedGlobalCollection, 1, True);
- Set Global Variable At Index(_extendedGlobalCollection, 34, Round To Integer(X Component Of(Global Variable(navigateTo)),
- To Nearest));
- Set Global Variable At Index(_extendedGlobalCollection, 35, Round To Integer(Z Component Of(Global Variable(navigateTo)),
- To Nearest));
- Set Global Variable At Index(_extendedGlobalCollection, 36, Round To Integer(X Component Of(Divide(Subtract(Position Of(
- Global Variable(navigator)), Global Variable(buildMazeAt)), 7)), To Nearest));
- Set Global Variable At Index(_extendedGlobalCollection, 37, Round To Integer(Z Component Of(Divide(Subtract(Position Of(
- Global Variable(navigator)), Global Variable(buildMazeAt)), 7)), To Nearest));
- Set Global Variable(aStarCheck, Empty Array);
- Modify Global Variable(aStarCheck, Append To Array, Vector(Value In Array(Global Variable(_extendedGlobalCollection), 36), -1.000,
- Value In Array(Global Variable(_extendedGlobalCollection), 37)));
- Set Global Variable At Index(_extendedGlobalCollection, 38, -1.000);
- Set Global Variable(visited, Empty Array);
- Small Message(All Players(All Teams), Custom String("Initialized, starting in 5 seconds...", Null, Null, Null));
- Wait(5, Ignore Condition);
- Set Global Variable(i, 0);
- Skip If(Not(And(Compare(Global Variable(i), <, Count Of(Global Variable(aStarCheck))), Compare(Value In Array(Global Variable(
- _extendedGlobalCollection), 38), ==, -1.000))), 39);
- Small Message(All Players(All Teams), Custom String("Starting loop {0}", Global Variable(i), Null, Null));
- Wait(3, Ignore Condition);
- Set Global Variable At Index(_extendedGlobalCollection, 41, X Component Of(Value In Array(Global Variable(aStarCheck),
- Global Variable(i))));
- Set Global Variable At Index(_extendedGlobalCollection, 42, Z Component Of(Value In Array(Global Variable(aStarCheck),
- Global Variable(i))));
- Set Global Variable At Index(_extendedGlobalCollection, 43, Subtract(Value In Array(Value In Array(Global Variable(cellStates),
- Value In Array(Global Variable(_extendedGlobalCollection), 41)), Value In Array(Global Variable(_extendedGlobalCollection),
- 42)), 16));
- Set Global Variable(_arrayBuilder, Value In Array(Global Variable(visited), Value In Array(Global Variable(
- _extendedGlobalCollection), 41)));
- Set Global Variable At Index(_arrayBuilder, Value In Array(Global Variable(_extendedGlobalCollection), 42), True);
- Set Global Variable At Index(visited, Value In Array(Global Variable(_extendedGlobalCollection), 41), Global Variable(
- _arrayBuilder));
- Small Message(All Players(All Teams), Custom String("Initialized loop {0}", Global Variable(i), Null, Null));
- Wait(3, Ignore Condition);
- Skip If(Not(And(Compare(Value In Array(Global Variable(_extendedGlobalCollection), 41), ==, Value In Array(Global Variable(
- _extendedGlobalCollection), 34)), Compare(Value In Array(Global Variable(_extendedGlobalCollection), 42), ==, Value In Array(
- Global Variable(_extendedGlobalCollection), 35)))), 2);
- Set Global Variable At Index(_extendedGlobalCollection, 38, Global Variable(i));
- Skip(22);
- Skip If(Not(Compare(Value In Array(Global Variable(_extendedGlobalCollection), 43), >=, 8)), 2);
- Modify Global Variable At Index(_extendedGlobalCollection, 43, Subtract, 8);
- Skip(2);
- Skip If(Not(And(Compare(Value In Array(Global Variable(_extendedGlobalCollection), 41), >, 0), Not(Value In Array(Value In Array(
- Global Variable(visited), Subtract(Value In Array(Global Variable(_extendedGlobalCollection), 41), 1)), Value In Array(
- Global Variable(_extendedGlobalCollection), 42))))), 1);
- Modify Global Variable(aStarCheck, Append To Array, Vector(Subtract(Value In Array(Global Variable(_extendedGlobalCollection), 41),
- 1), Global Variable(i), Value In Array(Global Variable(_extendedGlobalCollection), 42)));
- Skip If(Not(Compare(Value In Array(Global Variable(_extendedGlobalCollection), 43), >=, 4)), 2);
- Modify Global Variable At Index(_extendedGlobalCollection, 43, Subtract, 4);
- Skip(2);
- Skip If(Not(And(Compare(Value In Array(Global Variable(_extendedGlobalCollection), 42), >, 0), Not(Value In Array(Value In Array(
- Global Variable(visited), Value In Array(Global Variable(_extendedGlobalCollection), 41)), Subtract(Value In Array(
- Global Variable(_extendedGlobalCollection), 42), 1))))), 1);
- Modify Global Variable(aStarCheck, Append To Array, Vector(Value In Array(Global Variable(_extendedGlobalCollection), 41),
- Global Variable(i), Subtract(Value In Array(Global Variable(_extendedGlobalCollection), 42), 1)));
- Skip If(Not(Compare(Value In Array(Global Variable(_extendedGlobalCollection), 43), >=, 2)), 2);
- Modify Global Variable At Index(_extendedGlobalCollection, 43, Subtract, 2);
- Skip(2);
- Skip If(Not(And(Compare(Value In Array(Global Variable(_extendedGlobalCollection), 41), <, Subtract(15, 1)), Not(Value In Array(
- Value In Array(Global Variable(visited), Add(Value In Array(Global Variable(_extendedGlobalCollection), 41), 1)),
- Value In Array(Global Variable(_extendedGlobalCollection), 42))))), 1);
- Modify Global Variable(aStarCheck, Append To Array, Vector(Add(Value In Array(Global Variable(_extendedGlobalCollection), 41), 1),
- Global Variable(i), Value In Array(Global Variable(_extendedGlobalCollection), 42)));
- Skip If(Not(Compare(Value In Array(Global Variable(_extendedGlobalCollection), 43), >=, 1)), 2);
- Modify Global Variable At Index(_extendedGlobalCollection, 43, Subtract, 1);
- Skip(2);
- Skip If(Not(And(Compare(Value In Array(Global Variable(_extendedGlobalCollection), 42), <, Subtract(10, 1)), Not(Value In Array(
- Value In Array(Global Variable(visited), Value In Array(Global Variable(_extendedGlobalCollection), 41)), Add(Value In Array(
- Global Variable(_extendedGlobalCollection), 42), 1))))), 1);
- Modify Global Variable(aStarCheck, Append To Array, Vector(Value In Array(Global Variable(_extendedGlobalCollection), 41),
- Global Variable(i), Add(Value In Array(Global Variable(_extendedGlobalCollection), 42), 1)));
- Small Message(All Players(All Teams), Custom String("Finished wall check", Null, Null, Null));
- Wait(1, Ignore Condition);
- Small Message(All Players(All Teams), Custom String("Looping!", Null, Null, Null));
- Modify Global Variable(i, Add, 1);
- Set Global Variable At Index(_extendedGlobalCollection, 39, 14);
- Loop;
- Set Global Variable At Index(_extendedGlobalCollection, 39, 0);
- Wait(2, Ignore Condition);
- Small Message(All Players(All Teams), Custom String("found ya", Null, Null, Null));
- Set Global Variable(DestroyEffectArray_index, 0);
- Skip If(Not(Compare(Global Variable(DestroyEffectArray_index), <, Count Of(Global Variable(chosenPathEffects)))), 4);
- Destroy Effect(Value In Array(Global Variable(chosenPathEffects), Global Variable(DestroyEffectArray_index)));
- Set Global Variable(DestroyEffectArray_index, Add(Global Variable(DestroyEffectArray_index), 1));
- Set Global Variable At Index(_extendedGlobalCollection, 39, 58);
- Loop;
- Set Global Variable At Index(_extendedGlobalCollection, 39, 0);
- Set Global Variable(chosenPathEffects, Empty Array);
- Set Global Variable(walkPath, Empty Array);
- Skip If(Not(Compare(Value In Array(Global Variable(_extendedGlobalCollection), 38), !=, -1.000)), 6);
- Set Global Variable(walkPath, Append To Array(Append To Array(Empty Array, Vector(Add(X Component Of(Global Variable(buildMazeAt)),
- Multiply(X Component Of(Value In Array(Global Variable(aStarCheck), Value In Array(Global Variable(_extendedGlobalCollection),
- 38))), 7)), Y Component Of(Global Variable(buildMazeAt)), Add(Z Component Of(Global Variable(buildMazeAt)), Multiply(
- Z Component Of(Value In Array(Global Variable(aStarCheck), Value In Array(Global Variable(_extendedGlobalCollection), 38))),
- 7)))), Global Variable(walkPath)));
- Create Effect(All Players(All Teams), Sphere, Purple, First Of(Global Variable(walkPath)), 0.250, Visible To);
- Set Global Variable(chosenPathEffects, Append To Array(Global Variable(chosenPathEffects), Last Created Entity));
- Set Global Variable At Index(_extendedGlobalCollection, 38, Y Component Of(Value In Array(Global Variable(aStarCheck),
- Value In Array(Global Variable(_extendedGlobalCollection), 38))));
- Set Global Variable At Index(_extendedGlobalCollection, 39, 66);
- Loop;
- Set Global Variable At Index(_extendedGlobalCollection, 39, 0);
- Set Global Variable(aStarCheck, Empty Array);
- Set Global Variable At Index(_extendedGlobalCollection, 1, False);
- Small Message(All Players(All Teams), Custom String("Found path!", Null, Null, Null));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement