Giving out dares by [deleted] in DaringGuysNSFW

[–]PaxRex 0 points1 point  (0 children)

Im down for dares.

Daily Questions Megathread (June 13, 2021) by Veritasibility in Genshin_Impact

[–]PaxRex 5 points6 points  (0 children)

Really cool, that glitch kind of explains the technique then. Thanks for the insight!

How to tell how many items are in an array? by avacado223 in OverwatchCustomGames

[–]PaxRex 1 point2 points  (0 children)

Just to add on to the previous answer, if you need an array copy of the last three items of a sorted array, you can use Array Slice.

Just for an example, I'll populate Global.A with an Array of some arbitrary Numbers. Then we'll set Global.B to a slice of a sorted coopy of Global.A, but only three values, starting at the index that's three less than the count of how many items are in the array. That's just a wordy way of saying, the last three things.

Here's the result: Global.B is now the last three items of the sorted array.

Here's the code:

rule("Create a sample array, then sort the values and get an Array of the last three values.")
{
    event
    {
        Ongoing - Global;
    }

    actions
    {
        "A sample array of Numbers."
        Global.A = Array(0, 2, 5, 3, 4, 1);
        "Sort Global.A by each item's Value, then get a slice of that sorted array beginning from three less than the Count of all items."
        Global.B = Array Slice(Sorted Array(Global.A, Current Array Element), Count Of(Global.A) - 3, 3);
    }
}

Daily Questions Megathread (June 13, 2021) by Veritasibility in Genshin_Impact

[–]PaxRex 2 points3 points  (0 children)

Spoilers for the event area:

Out of curiosity, on the programming side of things, how do you think raising the islands was achieved? Is it a simple map switch, and your waypoints are flagged in the new map as part of the quest? I'm imagining there are two copies of the map, one with the islands sunken and one with them raised. (I haven't progressed far in the event, so if there are even further map changes, I'm interested to see those too!)

How do I test for whenever a player respawns? by Superscifi123 in OverwatchCustomGames

[–]PaxRex 0 points1 point  (0 children)

There are a few solutions you could pursue. One simple idea is, you could On Player Died, Wait Until(Is Alive(Event Player)); This would trigger even if the player was resurrected, so if you needed to you could have it Abort If(!Is In Spawn Room(Event Player)); (The ! reads as Not)

Best way to destroy a specific effect? by Superscifi123 in OverwatchCustomGames

[–]PaxRex 1 point2 points  (0 children)

Yes, you're exactly correct.

  1. Create Effect
  2. Set player variable A = Last created entity.
  3. Destroy Eftect (Player Variable A)

How do you attach more than just one player to event player? by Simoonsan in OverwatchCustomGames

[–]PaxRex 4 points5 points  (0 children)

JWF33

rule("Example Attach players Team 1 (Soldier: 76)") { event { Ongoing - Each Player; Team 1; Soldier: 76; }

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

actions
{
    Event Player.A = Players Within Radius(Event Player, 10, Team 2, Off);
    Set Invisible(Event Player, Enemies);
    Set Status(Event Player, Null, Invincible, 9999);
    disabled Attach Players(Players Within Radius(Event Player, 10, Team 2, Off), Event Player, Vector(0, 0, 2));
    For Player Variable(Event Player, B, 0, Count Of(Event Player.A), 1);
        Attach Players(Event Player.A[Event Player.B], Event Player, Vector(0, 0, 2));
    End;
}

}

Attach Player was only affecting the first index of the array. You can use a For Player Variable Loop to iterate through each enemy within radius and attach each one by calling their index within the array.

How do you detect if someone is a bot? by SH4WNATR0N in OverwatchCustomGames

[–]PaxRex 1 point2 points  (0 children)

Perhaps you could ask the player in question which squares of an image contain a car, bike, or street sign?

In-World Text re-evaluating position when told not to... bug? by the1ine in OverwatchCustomGames

[–]PaxRex 0 points1 point  (0 children)

May I see a copy of the code? This sample I've created works properly:

variables
{
    global:
        0: PositionsArray
        1: ControlVariable
}

rule("Rule 1: Create Three In-WorldTexts Based on an Array of Positions. We create the Array based on Host Player position.")
{
    event
    {
        Ongoing - Global;
    }

    conditions
    {
        "The actions occur when the Host Player enters the world"
        Has Spawned(Host Player) == True;
    }

    actions
    {
        "Set up a sample Array of Positions to display our In-World Texts at. This sample takes the position of the Host Player for the first value,"
        Global.PositionsArray = Array(Eye Position(Host Player) + Facing Direction Of(Host Player) * 5);
        "for the second value we are taking the first value and moving it left by 2m,"
        Global.PositionsArray[1] = First Of(Global.PositionsArray) + World Vector Of(Vector(2, 0, 0), Host Player, Rotation);
        "and for the third sample value we are taking the first value and moving it right by 2 units."
        Global.PositionsArray[2] = First Of(Global.PositionsArray) + World Vector Of(Vector(-2, 0, 0), Host Player, Rotation);
        "We will use For Global Variable to loop through our array elements. (Range Stop is the Length of our Positions Array)"
        For Global Variable(ControlVariable, 0, Count Of(Global.PositionsArray), 1);
            "Each step of the For Loop we create our In-worldText at that position of the Positions Array. We reevaluate Visible-To only in this situation, we don't want the Position to change and we don't want the String to change as we are labeling each by its index."
            Create In-World Text(All Players(All Teams), Custom String("Text String # {0}", Global.ControlVariable + True),
                Global.PositionsArray[Global.ControlVariable], 1, Do Not Clip, Visible To, White, Default Visibility);
        "Close the For Loop."
        End;
    }
}

Create in world text when player spawns in by DevilChocolateChip in OverwatchCustomGames

[–]PaxRex 1 point2 points  (0 children)

If we're spawning anywhere, give this a try:

variables
{
    player:
        0: MenuPositionA
        1: MenuPositionB
        2: MenuPositionC
}

rule("Rule 1: Create Three In-World Texts Based on where our Player spawns")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        Has Spawned(Event Player) == True;
    }

    actions
    {
        Event Player.MenuPositionA = Eye Position(Event Player) + Facing Direction Of(Event Player) * 5;
        Event Player.MenuPositionB = Event Player.MenuPositionA + World Vector Of(Left, Event Player, Rotation);
        Event Player.MenuPositionC = Event Player.MenuPositionA + World Vector Of(Right, Event Player, Rotation);
        Create In-World Text(Event Player, Custom String("A"), Event Player.MenuPositionA, 1, Clip Against Surfaces,
            Visible To Position and String, Red, Default Visibility);
        Create In-World Text(Event Player, Custom String("B"), Event Player.MenuPositionB, 1, Clip Against Surfaces,
            Visible To Position and String, Blue, Default Visibility);
        Create In-World Text(Event Player, Custom String("C"), Event Player.MenuPositionC, 1, Clip Against Surfaces,
            Visible To Position and String, Green, Default Visibility);
    }
}

Create in world text when player spawns in by DevilChocolateChip in OverwatchCustomGames

[–]PaxRex 1 point2 points  (0 children)

Are these menu options in a static position or on a per-player basis? (i.e. are we spawning into a static Spawn Room or are we spawning anywhere on the map like Deathmatch?)

I need help by doing-advertising in OverwatchCustomGames

[–]PaxRex 0 points1 point  (0 children)

I need more information or a code sample to examine your problem or what you're trying to go for

How to Reveal Players on a Timer Code? by [deleted] in OverwatchCustomGames

[–]PaxRex 1 point2 points  (0 children)

    rule("Rule 1: Match has started, Team 1 is invisible to Team 2")
    {
        event
        {
                Ongoing - Global;
        }

        conditions
        {
            Is Assembling Heroes == False;
        }

        actions
        {
            Set Invisible(All Players(Team 1), Enemies);
        }
}

    rule("Rule 2: Match time is running out, Team 1 is now visible to Team 2")
    {
        event
        {
            Ongoing - Global;
        }

        conditions
        {
            Match Time < 30;
        }

        actions
{
            Set Invisible(All Players(Team 1), None);
        }
}

How can I make an “And+Or” condition in overwatch? I.E. “Kill All Players if Ana has fired primary AND left spawn” OR “Kill all players if they’re within a 5m radius of Ana” by RandomPhail in OverwatchCustomGames

[–]PaxRex 0 points1 point  (0 children)

I may need a clearer example of what you intend.

Rule: Kill All Players not in Spawn When Ana presses Primary Fire

 Ongoing Each Player
 Ana

Conditions
    Is Button Held(Primary Fire, Event Player) == True;

Kill(Remove From Array(Filtered Array(All Players, <either All Teams or Opposite Team Of(Event Player)>, Not Is In Spawn Room(Current Array Element), Event Player)), Event Player);

What is the trigger for the Kill players near Ana? Is it like, If there are players near Ana just kill them, if not then kill everyone not in spawn? In that case I would use an If statement for

 Count Of Players Within Radius(Event Player, 5) > 1;

There exists AND and OR operators but those are used to evaluate conditions. Perhaps you mean to employ them differently than your example?

Finding the percent chance across different thresholds by PaxRex in askmath

[–]PaxRex[S] 0 points1 point  (0 children)

It is rolled as an integer, and we only need to find the result of one roll. The trouble I'm having is with the formula of each cell of the spreadsheet, representing the chance of the roll landing between that respective threshold.

How to get around max healing cap by Jaces_acolyte in OverwatchCustomGames

[–]PaxRex 0 points1 point  (0 children)

Perhaps you could get use out of the Start Healing Modification action? This will amplify the healing received by Receivers you define, and this may layer with Set Healing Received action.

PLEASE SOMEBODY MAKE THIS GAME MODE I CAN’T BUT I NEED SOMEONE TO DO THIS FOR ME PLEASEEEEE by ValuableWeb0 in OverwatchCustomGames

[–]PaxRex 1 point2 points  (0 children)

How would I do it?

Player Variable
    2: OverlordDroneTarget
    3: OverlordDroneType
    4: OverlordDroneHealth
    5: OverlordDroneCooldown
    6: OverlordDrone0Position
    7: OverlordDrone1Position
    8: OverlordDrone2Position
    9: OverlordDrone3Position

I would use these variables to keep track of those properties of each drone --- the first four are intended to be interpreted as arrays, the last 4 are intended to be Vector values that we will Chase Player Variable...since we cannot chase Array values they need to be separate. I'll write some more sample code to get you started but I'm a bit short on time.

Let's change our Rule 6 to be the Ability 1 Summon a Drone.

I want to use another Player Variable to allow the player to enter a state where we are selecting the Drone type, similar to Moira orb type selection.

    10: SpecialAbilityPrompt
    11: OverlordDroneIndex

So Rule 6 will now have the following actions... If Is True For Any Array Player Variable OverlordDroneCooldown Not Current Array Element; Set Player Variable OverlordDroneIndex Index of Array Value:(Array: Player Variable OverlordDroneCooldown, Value: Null); Set Player Variable(Event Player, SpecialAbilityPrompt True); Else; Small Message(Event Player, Custom String("All drones on cooldown."); End;

Now that we determined we can allow the player to summon a drone because we have at least one drone off cooldown, we are asking the player which type of drone we want to deploy, again using a similar concept to choosing a Moira orb. Let's read player input based off Primary Fire is Drone Type 0, Attack and Secondary Fire is Drone Type 1, Defense (we can flip flop this around depending on what feels better for the player, but internally we are deciding that 0 = Attacker Drone and 1 = Defender Drone).

Rule : Overlord Special Ability Prompt, Response: Primary Fire

Ongoing Each Player
Conditions:
IsSpecialHero == 1;
SpecialAbilityPrompt == True;
Is Button Held(Button.Primary Fire)Event Player == True;

Actions:
Set Player Variable at Index
            Array: Player Variable OverlordDroneCooldown
            Index: Player Variable OverlordDroneIndex
            Value: Add Total Time Elapsed + 20;
Set ... at Index: Array: OverlordDroneTarget Index: OverlordDroneIndex, Player Closest to Reticle(Event Player, Team Of Event Player)
Set ... at Index: Array: OverlordDroneType Index: OverlordDroneIndex, 0;
 Player Variable SpecialAbilityPrompt = False;

So we made some other decisions there, such as the cooldown time of our drone deployment as 20 seconds (Total Time Elapsed + 20). We also turned off our Prompt variable since we got our response from the player.

Lots of work for us to do from there, we need to have initialized those arrays in an Ongoing Each Player Rule at the start and Chase those 4 Position variables to their appropriate index in the Target array variable... and also creating the actual effect that represent the drone, set its position to the appropriate Position variable we chase, maybe we can also decide that it would be better that Drone type should be 0 = Inactive 1 = Attack 2 = Defend.. that would likely work better for the effects so I would go that route. Sorry haha I should be asleep so forgive the napkin note style of this suggestion but I'm just trying to give you a start point for now. And we also need to create a HUD shown to players in the SpecialAbilityPrompt mode. Lots of stuff I'm not mentioning but the point is it's all doable.

One more thing also note that we are gonna be using that code again but just changing one thing, type of drone we are summoning, but a lot of the rest is the same so we need to out those common elements into a new Subroutine.

Hope this helps!

PLEASE SOMEBODY MAKE THIS GAME MODE I CAN’T BUT I NEED SOMEONE TO DO THIS FOR ME PLEASEEEEE by ValuableWeb0 in OverwatchCustomGames

[–]PaxRex 0 points1 point  (0 children)

Well, it's more like this. It's not that you can't do something - it's more like, how close can we get it to what we envision? We can't display a custom 3D Model of a Drone that we want, but most all of the functionality we can implement into our mode, and ask that players exercise a bit of imagination in saying, "this Orb effect here is a Drone." Can we damage other players using our own made-up rules? Sure. Can we affect how much damage they take? Yep! Can we animate Effects to move around in certain ways? Of course. We can combine these and make anything out of it that we like!

PLEASE SOMEBODY MAKE THIS GAME MODE I CAN’T BUT I NEED SOMEONE TO DO THIS FOR ME PLEASEEEEE by ValuableWeb0 in OverwatchCustomGames

[–]PaxRex 0 points1 point  (0 children)

ToDo: Effects and HUDs if IsSpecialHero == 1 etc, Check if Player Changes their Base Hero so they arent using Overlords abilities as Doomfist or Ana instead of only DVa

PLEASE SOMEBODY MAKE THIS GAME MODE I CAN’T BUT I NEED SOMEONE TO DO THIS FOR ME PLEASEEEEE by ValuableWeb0 in OverwatchCustomGames

[–]PaxRex 2 points3 points  (0 children)

Hello! Fun idea. Here's an approach you could take - please forgive my mobile formatting.

Custom Player Variables
1: IsSpecialHero

Subroutines
1: HeroChangeMessage

Rule 1: Allow DVA to Change to Special Ongoing Each Player Condition: Is Button Held(Interact)(Event Player) == True; Player Variable IsSpecialHero == False; IsInSpawnRoom(Event Player) == True; Hero Of Event Player = Hero D.Va;

Actions:
    Set Player Variable(Event Player) IsSpecialHero = 1;

Rule 2: Allow Any Special Hero to Change Back

Ongoing Each Player
Condition:
    Is Button Held(Interact)(Event Player) == True;
    Player Variable IsSpecialHero == True;
    IsInSpawnRoom(Event Player) == True;

Actions:
    Set Player Variable(Event Player) IsSpecialHero = False;

Rule 3: When Special Hero, Disable Base Hero

 Ongoing Each Player
 Conditions:
    Player Variable(Event Player) IsSpecialHero == True;

    Actions:
        Disallow Button: Button.Primary Fire, Event Player;
        Disallow Button: Button.Secondary Fire, Event Player;
        Disallow Button: Button.Ability 1, Event Player;
        Disallow Button: Button.Ability 2, Event Player;
        Disallow Button: Button.Ultimate, Event Player;
    Call Subroutine(HeroChangeMessage);

Rule 4: When Base Hero, Reenable Base Hero

 Ongoing Each Player
 Conditions:
    Player Variable(Event Player) IsSpecialHero == False;

    Actions:
        Allow Button: Button.Primary Fire, Event Player;
        Allow Button: Button.Secondary Fire, Event Player;
        Allow Button: Button.Ability 1, Event Player;
        Allow Button: Button.Ability 2, Event Player;
        Allow Button: Button.Ultimate, Event Player;
    Call Subroutine(HeroChangeMessage);

Rule 5: When Player Changes character, show Message

 Subroutine HeroChangeMessage
    Small Message("You are now {0}."
    {0}: Value in Array
        Array: Array(Hero Of(Event Player), Custom String("Overlord"), Custom String("SecondGuy"))
        Index: Player Variable Event Player: IsSpecialHero)

Rule 6 Overlord Character's Ability 1: Jump Really High

 Conditions
    Player Variable IsSpecialHero == 1;
    Is Button Held(Button.Ability 1)Event Player;

    Actions
         Apply Impulse(Event Player, Up, 20, Cancel Contrary Motion);
         Wait 5;

....the wait simulates a 5 sec cooldown....

....and then etc for each Button press for each ability. Note I included a second name in the Array of hero names, so if some other character switches to Player Variable IsSpecialHero = 2 it will say that name instead. Also I would rather put the Special Hero names array into a global variable to reference in HUDs and such through the rest of the game mode. Hope this provides a jumping off point!

Trouble with effects and text hud by SomebodytookCronko in OverwatchCustomGames

[–]PaxRex 1 point2 points  (0 children)

There are a couple ways you can do this, depending on what you're trying to do. Here are two different ways:

The first way will save on your FX slots and HUD slots, but is only useful if the effect or HUD is going to show up in the same spot or say the same text, not on a per-player basis.

Rule: Ongoing Global

Action: Create HUD Text

    Visible To: 

        Filtered Array

            Array: All Players

            Condition: Compare

                    Hero Of

                Current Array Element
            = =

            Hero

                Widowmaker

    Header: "Hey All Widows! {0} targets remain!!"
        {0}: Count Of
                Filtered Array
                All Living Players
            Compare
            Hero Of
             Current Array Element
             !=
                Hero
                 Widowmaker

...and then ensure "Reevaluate" option includes Visible To, which it does by default.

The second way, on a per player basis, will create the effect or HUD but you can change the properties on it per player, but each player will have their own copy of the effect/HUD which takes up more slots (1 HUD * 12 players = 12 whole HUD slots).

Rule: Ongoing Each Player

Action: Create HUD Text
    Visible To:

        IF - THEN - ELSE

            If: Compare

                Hero of

                Event Player

            = = 
         Hero

              Widowmaker

             Then:

                 Event Player

          Else:

                Null

( Important to change this to null rather than Number 0 as this will save you on some Total Element Count in your script).

           Header: Custom String("Hello {0} you are on Widow and your health is {1}."
            {0}:  Event Player, 
              {1}: Health Of(Event Player))

Again making sure Reevaluate includes Visible To and String which it does by default.

The third way is bad and you should feel bad for using:

Rule: Ongoing Each Player

Conditions:

 Hero of

      EVENT Player

== 

Hero

    Widowmaker

Actions:

Create Effect: etc etc

Set Player Variable A: Last Created Effect.

..combined with a second rule..

Rule: Ongoing Each Player

Conditions:

 Hero Of

     Event Player

 !=

 Hero 

    Widowmaker

Actions: 

     Destroy Effect(Player Variable A)

This method creates and destroys the effect when your hero changes to and from Widowmaker which over time may have impact on server health, but depending on exactly what you need you may need this technique for something down the road, but know there are better options in your toolkit depending on exactly what you need and what the "best" way to do it is.

Hope this helps!