• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Making Force Fields that only let certain units pass through

Status
Not open for further replies.
Level 4
Joined
May 16, 2009
Messages
61
I am trying to create a force field that will let only heroes pass through however normal units cannot go through the field and am not sure how to go about this
 
Level 9
Joined
Dec 21, 2006
Messages
490
is this field a circle? is it always at the same position?

you could create a trigger that periodicly checks if there is a unit within the radius and then push it back a certain distance at an angle between unit and circle mid.

otherwise you could create dummy unit with a buff that periodicly searches for units and if it is a normal unit a force effect is applied to the unit.

more information and more detailed solution will be offered :d
 
Level 4
Joined
May 16, 2009
Messages
61
I have this perimeter around my map that only Heroes can enter and I don't want any regular units entering it

I know I can use regions however I'm unsure what to do if a unit enters the region
Can I move him back to his previous position so it's as if it never entered? But wouldn't that require lots of ineffiecient trigger work?
If I move units that enter the region to a set point wouldn't work really well since it would introduce bad gameplay into the map

I've decided against using the force field passage way into the area since my map will have stalkers that could blink past the forcefields
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
So that it makes more sense, units that enter these restricted areas should be locked down (they become paused) and then teleport a little bit away. This does not solve the ugly problem of having to teleport units away from the restricted area but it does make it look very professional and I am sure people will not notice it in a negative way.
 
Level 4
Joined
May 16, 2009
Messages
61
What event do I use to get the region when a unit enters a region? I used Any Unit enters (Region(Any Region)) by using a convert preset to region however it does not seem to work with Triggering Region
 
Level 4
Joined
May 16, 2009
Messages
61
  • Bottom Jungler Manager
    • Events
      • Unit - Any Unit Enters (Region(Any Region))
    • Local Variables
      • Int = 0 <Integer>
      • Triggering Region = (Triggering region) <Region>
    • Conditions
    • Actions
      • General - For each integer Int from 0 to 39 with increment 1, do (Actions)
        • Actions
          • General - If (Conditions) then do (Actions) else do (Actions)
            • If
              • Bottom Jungle[Int] == Triggering Region
            • Then
              • Unit - Move (Triggering unit) instantly to Bottom Jungle Copy (No Blend)
            • Else
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
Best would be check the unit type if hero or whatever unit you dont want to enter and if a unit that shouldnt enter - order the unit to leave the region action.

I guess with all the things you can do, there are still lots of missing things you cant do in the editor, I checked other places there doesn't seem to be other ways, unless with Movers but im not sure how they work.
 
Level 9
Joined
Dec 21, 2006
Messages
490
why not using force effects to pull units away from the center? it's not that hard to create. you just need 1 unit at the center of the area. this unit has a buff which periodicly looks for units in range. if a unit is found apply a force effect on that unit .
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You sure that is all nescescary? A region can consist of more than 1 primitive you know.

Anyway you should be able to allow certain units to walk over forcefields, how else do ultralisks/thors/archons break them? As for the blinking stalkers, you just use a global region for any off limit area for units and cancel any blink orders into that region.
 
Level 4
Joined
May 16, 2009
Messages
61
Ive decided I won't bother with forcefields however what do you think is most optimal?

Having a trigger periodically run every 1 second and grabbing units in all 150~ regions that don't match the condition heroic and moving each picked unit to a set point
OR
Having a trigger periodically run every 1 second and grabbing units only in the regions that lead into the jungle(16~) that don't match the condition heroic and moving those units to a set point with another trigger that catches everytime a stalker uses blink in a off limits region and move them to a set point
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Having a trigger periodically run every 1 second and grabbing units in all 150~ regions that don't match the condition heroic and moving each picked unit to a set point
OR
Having a trigger periodically run every 1 second and grabbing units only in the regions that lead into the jungle(16~) that don't match the condition heroic and moving those units to a set point with another trigger that catches everytime a stalker uses blink in a off limits region and move them to a set point

Both of these sound prety inefficient. Are you sure you can not use the unit enters region event in some way?
 
Level 4
Joined
May 16, 2009
Messages
61
Would having an event that checks if a unit enters the entirety of the jungle and then going through a loop of about 150 regions to check exactly which section of the jungle the unit is in to move the unit to the appropriate point be better?
 
Level 9
Joined
Dec 21, 2006
Messages
490
you don't listen. if blink is the only way to come in the jungle without moving through the entrance just cancel the order or use a validator(i can think of different ways to validate the "jungle") for the target.
in case of the entrance use triggers as drsuper said or use a knockback force effect like i said.

(ha! i got 5 rep for asking questins!! lol)
 
Level 4
Joined
May 16, 2009
Messages
61
Well I found out a really nice way to do my trigger from a lil forum post on SC2Mapster
It lets me add events to triggers after the game has loaded and lets me add them in an array making the difficulty of adding 150~ events much easier
I'm just so lazy that I wanted this all encompassing trigger so I don't have to add bits of script each time I add an ability that allows a normal unit to blink

Anyway my issue is solved and I shall +Rep
 
Status
Not open for further replies.
Top