"repel"
Jul 6 2009, 8:45 pm
By: crutex  

Jul 6 2009, 8:45 pm crutex Post #1



woo man ok.
This sounded like a pretty simple spell to create "repel" whereby foes would be pushed away if they get in range of your hero. I was imagning it would be easy to do with junkyard dog but I am having some unexpected problems. I couldn't give the units to CPU and run junkyard dog when they get in range because there wouldn't be a way of tracking how to give the unit back and also I'm generally not a fan of interrupting play like that. The only other way I could think was using a mobile grid and the "order" command but I can't imagine how to make sure that the character moves "away" and isn't trying to move to some retarded location (if there's a hill maybe the shortest path is through the field that should be repulling). Ehhh junkyard dog does only work on CPU right?
Well I'm pretty stumped for now, have any of you implemented this spell or have some ideas for how to achieve this action?

Thanks as always :cheers:



None.

Jul 6 2009, 9:04 pm JaFF Post #2



You can check whether a location is walkable or not by trying to move a unit there - if the unit is moved accurately, it is walkable; if it is not moved, the location is unwalkable. So using mobile grids is fine.



None.

Jul 6 2009, 9:11 pm Ashamed Post #3

Hear me Raor!!

It depends on which units you are going to have, if not its not that hard just have a location for each unit, unless you can make a grid but it kinda seems like this is going to be like an arena, and to use grids you can't use flying units/ground units. depending on the grid type.



None.

Jul 6 2009, 10:31 pm Vrael Post #4



You could place destination locations at the edges of the map on tiles that you are sure will be walkable.



None.

Jul 6 2009, 11:32 pm crutex Post #5



Quote from Ashamed
It depends on which units you are going to have, if not its not that hard just have a location for each unit, unless you can make a grid but it kinda seems like this is going to be like an arena, and to use grids you can't use flying units/ground units. depending on the grid type.
They will be all ground units.
Quote from Vrael
You could place destination locations at the edges of the map on tiles that you are sure will be walkable.
I'm not exactly sure what you meant but it sounds less than ideal.
Quote from JaFF
You can check whether a location is walkable or not by trying to move a unit there - if the unit is moved accurately, it is walkable; if it is not moved, the location is unwalkable. So using mobile grids is fine.
Yeah I understand that, but if you're on low ground and the location its ordered to move to ends up being on top of a hill, perhaps the entrance to the ramp is on the other side of the repelling unit (ie the path will intersect the "repel" area). O_O
How can you determine if the location to move is "away" from the repelling unit?



None.

Jul 7 2009, 2:58 am ShredderIV Post #6



The only possible solution i could think of, and this is a far stretch, since im not much of a trigger-knowledgable person, would be to create two locations, one bigger than the other, and have them both center on the unit that pushes the others away. then, have it so when a unit is in the smaller location, it moves it to the bigger location? idk, otherwise a grid system seems like the way to go, with maybe an extended grid that allow the unit to move to an area closer to the unit pushing away, stopping this effect maybe...

actually, you might wanna check this out
http://www.staredit.net/topic/7859/



None.

Jul 7 2009, 3:03 am LokiArexon Post #7



Some solutions would be dependent on your terrain and what you want the repel to do. Like, if the "repelling zone" is static, then it's much easier. If the repelling zone moves around then you will have to be more creative.



None.

Jul 7 2009, 4:38 am Commanda_Panda Post #8



How about:
Have a location centered on the unit that will repel you (lets call it loc 1)
Have a location that centers (loc 2) on your unit as long as you are not in loc 1

If you bring your unit into loc 1, it orders your unit to move to loc 2

I tried it out in, your ling will be repelled from the medic, I'm not sure how reliable this can be once you add movement for the medic, but maybe this is something you can try to base your triggers off of.

Attachments:
Repel.scx
Hits: 2 Size: 34.92kb



None.

Jul 7 2009, 5:54 am crutex Post #9



Quote from Commanda_Panda
How about:
Have a location centered on the unit that will repel you (lets call it loc 1)
Have a location that centers (loc 2) on your unit as long as you are not in loc 1

If you bring your unit into loc 1, it orders your unit to move to loc 2

I tried it out in, your ling will be repelled from the medic, I'm not sure how reliable this can be once you add movement for the medic, but maybe this is something you can try to base your triggers off of.
The repelling zone would be following a unit ya. I'll take a look at your sample map thank you.

edit just tried it out and had the medic location follow the medic with junkyard dog. The effect is really nice as long as the ling is moving into the repel zone and not the other way (repeller getting near unit).



None.

Jul 7 2009, 9:46 am JaFF Post #10



Quote from crutex
Quote from Vrael
You could place destination locations at the edges of the map on tiles that you are sure will be walkable.
I'm not exactly sure what you meant but it sounds less than ideal.
It's not a bad solution at all. Center a mobile grid with 8 locations around your unit. The locations are 'up', 'upper-right', 'right' etc. Have a set of 8 locations in the corresponding points in the map: 'map_up', 'map_upper-right', etc. (so 'map_upper-right' is in the upper right corner of the map, 'map_up' is in the middle of the upper dorder of the map, etc.)

As long as the units can get to the 'map_[direction]' locations, all you have to do is order the enemy units that are in 'up' to move to 'map_up', etc.

Quote from crutex
Quote from JaFF
You can check whether a location is walkable or not by trying to move a unit there - if the unit is moved accurately, it is walkable; if it is not moved, the location is unwalkable. So using mobile grids is fine.
Yeah I understand that, but if you're on low ground and the location its ordered to move to ends up being on top of a hill, perhaps the entrance to the ramp is on the other side of the repelling unit (ie the path will intersect the "repel" area). O_O
Good question. You can always check whether the location the units move from and the location units move to are on the same height by manipulating several locations applied to all the possible ground heights. You'll have one locatoin applied to 'low ground', one to 'mid ground' and one to 'high ground'. This will allow you to check whether or not the units elevation will change, hence repel only those units that will not change their height.

This method as it is wdoes not include the possibility of an enemy unit being right in front of a ramp and being repelled over it. To account for this case, you can check whether the terrain between the location where the enemy moves from and the location the unit moves to is walkable by using a smaller mobile grid. Say you're using a 1.5x1.5 grid to select the start and finish locations for the repelled units, then you can use a 1x1 grid to check whether the terran between start and finis is walkable. Though the accuracy of this is doubtable in my mind, it's worth a try. Maybe if I get some free time, I make a test map for this.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: Roy