• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How can you make something walkable through by allies, but not by enemys?

Status
Not open for further replies.
Level 3
Joined
Apr 22, 2009
Messages
19
This might work

  • Untitled Trigger 002
    • Events
      • Unit - A unit enters Your Region <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) is an enemy of Player 1 (Red)) Equal to True
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
        • Else - Actions
          • Do nothing
 
Level 8
Joined
Aug 1, 2008
Messages
420
Nah, because its a spell i dont want to move a region every time i cast it. There must be a better and more effiecient way of doing it.
 
Level 2
Joined
Jul 4, 2004
Messages
16
You haven't really given an adequate description of what you actually want from the spell. If the above trigger would work you could probably have a lot of success with some kind of ward with a modified tornado slow aura. Or stasis trap.
 
Level 8
Joined
Aug 1, 2008
Messages
420
Ok: I have a spell where it creates blocks around an area, to trap enemy units in, and keep enemy units out. But i want allies of the spellcaster to just move freely in/out. I dont want to do order them to stop because it will be every 0.04 seconds, meaning they cant cast spells it in which will suck.

Theres a spell similar to this in the map "Naruto shippuden ninpou" its Yamato's first skill. I want it pretty much exactly the same as that, if you would take a look.
 
Ok, I made almost the same spell for the hero contest, although it was not targeting an area. Here is what I did, combined with yours:
  • Spell Initialization
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Trap
  • Actions
    • Set Point1 = (Target Point of Ability being cast)
    • Set Caster1 = (Triggering unit)
    • Unit - Create 1 dummy (timer) for (Owner of (Caster1)) at (Point1 facing default building degrees
    • Set DummyTimer = (Last created unit)
    • Unit - Add ((Level of (Trap) for (Caster1)) * x) Expiration timer to (DummyTimer)
    • Trigger - Turn on Spell Step 2 <gen>
    • Custom script: call RemoveLocation (udg_Point1)
  • Spell Step 2
  • Events
    • Time - Every 0.03 seconds of game-time
  • Conditions
  • Actions
    • Set DummyPoint = (Position of (DummyTimer))
    • Set Temp_Group = (Units within 500.00 of (DummyPoint) matching ((((Matching unit) is alive) Equal to True) and ((Matching unit) is a structure) Equal to False) and ((Matching unit) belongs to an enemy of (Owner of (Caster1))) Equal to True))
    • Unit Group - Pick up every unit in (Temp_Group) and do (Actions)
      • Loop - Actions
        • Set PickedPoint = (Position of (Picked unit))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Distance between DummyPoint and PickedPoint) Greater than 500.00
          • Then - Actions
            • Set PickedPointOffset = (DummyPoint offset by 490.00 towards (Angle from DummyPoint to PickedPoint) degrees)
            • Unit - Move (Picked unit) instantly to DM_TempLoc2[DM_DI]
            • Custom script: call RemoveLocation (udg_PickedPointOffset)
          • Else - Actions
        • Custom script: call RemoveLocation (udg_PickedPoint)
    • Custom script: call RemoveLocation (udg_DummyPoint)
    • Custom script: call DestroyGroup (udg_Temp_Group)
  • Spell Step 3
  • Events
    • Unit - A unit dies
  • Conditions
    • ((Unit-type of (Dying unit)) Equal to Dummy (Timer)
  • Actions
    • Trigger - Turn off Spell Step 2 <gen>
 
Level 8
Joined
Aug 1, 2008
Messages
420
Can you give an explanation of what it does? Because what i see atm is that it moves them towards the center of the trap (i think.) I just want them enemys to get trapped in, but able to move around in it. Is this what it does? xD

Ill draw a pic >.>

Edit: Like this... Black is caster, red is target, blue are the walls that summoned to keep the unit escaping.

9stiex.jpg
 
Level 8
Joined
Aug 1, 2008
Messages
420
Ok Ok i was just making sure, coz it didnt look right to me. btw.. whats this?

  • Unit - Move (Picked unit) instantly to DM_TempLoc2[DM_DI]
Coz DM_DI is undeclared, or i dont know what that is, and whats DM_TempLoc2? another undeclared variable? or am i just stupid
 
Level 8
Joined
Aug 1, 2008
Messages
420
k thx, will try now see how it goes.. +rep

edit: must spread some around still... thats 2 reps i owe you..
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
You can do same trigger for unit
Event unit enter within range of (your Unit)
>>>just change REGION with your unit

and you can add event if your unit is not in map (in WE)

-unit enters playable map area
-add to (your trigger) the event unit comes within range of (entering unit)

im not sure when do you want to use this (to lazy to read all post xD)
but if you want to use it when your unit cast a spell use condition (your unit) has (buff of casting spell)

  • Unit enters Region 000
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Entering unit) Not equal to (Your unit)
    • Actions
      • Set UNIT = (Position of (Entering unit))
      • Set REGION = (Center of Region 000 <gen>)
      • Set POINT = ((Center of Region 000 <gen>) offset by ((Distance between REGION and UNIT) + 20.00) towards (Angle from REGION to UNIT) degrees)
      • Unit - Move (Entering unit) instantly to POINT
      • Custom script:call RemoveLocation(udg_POINT)
      • Custom script:call RemoveLocation(udg_REGION)
      • Custom script:call RemoveLocation(udg_UNIT)
i hope you know how to add conditions that you need .....
 
Status
Not open for further replies.
Top