Ability that Damages People in a certain Distance

Hi, can someone tell me how to do this with pictures?

The person who clicks on the overlay (who is on Team 1) deals 200 damage to people on Team 2 who are within a certain distance from that person.* Then, they have a 20-second cooldown. I do not care how much memory this takes up.

I also need help with determining the distance that will make the ability not too underpowered or overpowered since I’m not really sure how the Gimkit Creative distance system works.

Thanks!

Note: I will be offline soon since I have to go to bed.

*If you know what Splatoon is, I’m trying to make Splashdown.

3 Likes

This is called Area of Effect, and it is possible to make by storing each player’s position with the Player Coordinates device, then when a Game Overlay is pressed, check each player’s coordinate and use the distance formula on a device with block code; if the distance is less than or equal to a given amount for a player, then use the Damager device on said player. Proceed to create an action that either hides the Game Overlay or prevents its action. I will try to give you a prototype.

5 Likes

Welcome to the Gimkit Creative Forums!

2 Likes

This is a system that would work in this scenario. For the rundown,

The Player Coordinates device’s properties are set to update the Properties named x and y, this tracks where the player is and allows it to be used in block code.

The Properties named x and y are number values scoping to the player, so each player has an individual coordinate value.

The Properties starting with a, which I named to mean attack, such as aname, ax, and ay are also number values. However, these are not connected to the Player Coordinates device, and they scope globally.

Now for the Game Overlay device’s properties, a channel named “Press,” will transmit on the button click, and there’s a block code when receiving on this channel also within the Game Overlay.


This sets the “a” properties as a reference point for later.

The Game Overlay is wired to and triggers the Relay on button press, you could also opt for the “Press” channel rather than the wire. The Relay audience is “All Players.”

The Relay triggers the Trigger, and you can set its properties so that it cannot be tampered with during the game. The main reason for this Trigger is the block code. When the Trigger is triggered, it runs the, “When Triggered” block


Although it may look complicated, the general idea is that it checks the distance which is the math using √(x-ax)²+(y-ay)² and if it is less than a number, or in other words, if a player is within a certain range from another player and they are not the same player, it broadcasts the “Damage” message.

The Damager damages the player when receiving the “Damage” message, and you can change the Damage amount to whatever suits you.

Overall, this system expends about 4,745 memory, but feel free to make it more efficient or add modifications such as swapping the name system for a value unique to each player as the current name system causes it so players with the same name cannot attack each other. You can use your own property and channel names, of course.

5 Likes

game overlay → tag zone (activate tag zone)
set respawn when tagged to no and set the tag distance to how far (in tiles) you want the person to tag other people.

(tag zone) player tagged → deactivate tag zone

(tag zone) player tagged → hide overlay (ps makesure the overlay is player scoped)

(tag zone) player tagged → (wire repeater with a cd of 20s) repeat the wire pulse

(wire repeater) wire pulse → show overlay

I’m not sure, but I’d estimate this costs like 2,000 memory

2 Likes

Welcome to the forums @rigormortis! Make sure to check out the guidelines! I can see you’re a pretty good coder I hope you are able to use your skills to help out the community.

1 Like

The ability KOs everyone :frowning:

How do I fix it?

By the way, I changed the second get property to y and ay.

1 Like

Show me images of the system and block code so I can take a look. Also, try other solutions as they may be more efficient.

1 Like

Devices from left to right

Player Coordinates Device

property x

[/details]

property y

property ax

Property ay

Overlay



Wires


Summary

Trigger





Damager

I will try this

@rigormortis I don’t want to waste your time so don’t look at the screenshots unless I say that Nas-Tea’s solution doesn’t work

2 Likes

Is there a way to make the tag distance bigger than 3 tiles?

Although you said not to, I wanted to note that the Player Coordinates device “Update Properties” should be set to “Yes.” All players were damaged as x, y, ax, and ay would be equal to 0, meaning the distance between each player would be recorded as 0, and since 0 is in that range and practically any realistic range so long the inequality is less than, all players would be damaged. This should be fixed by setting the Player Coordinates properties to “x” and “y” for the respective x and y coordinates, therefore, the locations are accounted for and the proper players are damaged. (For reference, use x and y in the Player Coordinates device and not ax and ay as those are the global variables used to compare each player’s coordinates to the player who clicked the button while x and y are the actual coordinates per player.)

2 Likes

Welcome to the forums @rigormortis

1 Like

welcome to the community (sorry i haven’t been active lately)

1 Like

Thank you so much for your help!

But now it doesn’t attack anyone. I only changed the stuff that you told me to and also changed aname to a text.

1 Like

Make sure you also account for the change from aname to a text in the block code of the Game Overlay and Trigger as well.

2 Likes

Welcome to the Forums You are already waaaaay better then coding than i am BUT i am doing a java and C++ lessons so i can make my own Steam / playstation game

1 Like

also know as AOE for short

what does that mean :sweat_smile:

The block code for both originally uses the aname Property, but since you changed it, make sure you also change the name from “aname” to the new one of the Property you use in the block code for both devices.