• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[Spell] Magic Wall Template

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
Hi all.

I was wondering if anyone knew a system or template for a magic wall.
The wall can be walked through but when a unit does, he gains a specific effect.

The wall can either be straight or in a circle(/part of a circle).

I know about making many units and line them up and checking for collision but there should be a better way than that.

Does anyone know if something like that already exists?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
I m not sure if the following is possible, it is definitely not possible to do in pure GUI but I believe JASS/vJASS can, not sure, correct me if wrong:

Define a custom region (MagicWallSpan) which is the AoE of the magic wall
Every X seconds pick units in the region and buff them.

Hmm... it will probably not be in this order but you get the concept.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Regions can have a circle as shape can't they? (almost a circle)
For straight detection... the problem is that the wall is very thin. A unit that passes through can also be done with custom movement (SetUnitX(), SetUnitY())
So will a region of 0.000001 size be helpfull?
(I know it will not be 0.000001 but rather 10 or 15... but still, a fast unit can get through it without being inside that 10 or 15 width.

The phoenix fire or immolation or stuff is kinda... not working because that would have a delay.
For the circle I got the idea of making a trigger with dynamic events for "A unit comes in (range) of (unit)" However that doesn't include the leave part.
For a line... I got no clue.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
JASS Regions can have any shape the user makes them (99.9% sure)
Pure GUI regions can be only rects.

Oh, well if the units move with setting their possitions (Teleporting around) there is no way to check if unit with step of 4 has passed through Box(X1;Y1)(X2;Y2) when moving from X0;Y1 to X4;Y1. It instantly teleports through the region.

One thing you can do (NOT RECOMENDED) in the case is to make "artificial" steps so the unit does not skip small regions. Unit step = 4.

Unit moves from X1 to X5:
Loop
For New_X from X1 to X5
Set unit X to New_X
Check if unit is in region
Do buff stuff

Or if you can make a trigger with custom event, so it is ran imediately after it gets inside the region.
Unit enters CustomSpellRegion
Do buff stuff

This will increase units movement tremendously and will probably lagg a bit... or more... probably...
It is a solution but I do not think it is a good one.

Another thing (higly recomended), do not use smaller regions than units step...
Another thing (higly recomended), do not use bigger steps than you regions...
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
The point is that some walls could for example... stop enemy missiles.
But then ALL missile systems have to be rewritten and they will lagg hard because 2 or 3 people will use a magic wall that blocks missiles.

I think I will use multiple dummies then... they work pretty good... until you want to move/rotate them.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
the missiles have to have bigger detection range than their step
That is required for every missile, unless the system provides a better solution.

the dummies should be valid targets for the missiles
That is something that depends on the system.
Normal Missile Systems that I have seen create target restriction when the missile is created.
I use a system with an On-Collide event so I can choose if that specific unit is a valid target :D
 
Status
Not open for further replies.
Top