Line Tower Wars: Anti-block trigger malfunctioning

OVRKLL

New Member
Reaction score
3
I know only 2 other programming languages (JASS is scripting language)
but I don't suck at any of them...

Okay. Well I suck at about half of the nine because I never use them...
By the way, there's something I miss. A couple of the languages I know is actually scripting rather than programming... Whups. In Danish (language spoken in Denmark - where I come from) I think you can partially categorise scripting languages as programming. Or perhaps I just misunderstood something completely.
Okay, that's not really important here. I'm just jappering my ass off.
Have you looked at the code?
 

Pender

New Member
Reaction score
32
Working demo

Your general concept is sound, though I couldn't really understand your code.

Here, I rigged up a demonstration that works. Please find it attached. It is very minimal; just a builder, two guide walls for the width of the pipe, and nothing else. I think the code is simpler than your example, although it leaks (didn't feel like plugging leaks for a proof of concept).

This idea of yours really is superior to the method proposed by others (trapping creep orders). The only limitation is that it works only when the player is constrained to building within a single fixed-width pipe and the creeps move straight through.

The method is easily enough generalized to a variable-width pipe, or indeed a pipe that follows an arbitrary path from start to end (such as a pipe that makes several turns and meanders across the map). All one needs to do is create a function that tests whether a given tower is touching one wall, and another that tests whether it is touching the other wall. The functions need not even be terribly efficient, as they will be run only once each per tower in the chain. If a chain has a tower that touches one wall and the chain has a tower that touches the other wall, the pipe has been blocked. You'd use this in lieu of the Max_X - Min_X test, and you'd use two boolean variables in lieu of Max_X and Min_X.

No easy way occurs to me to generalize this solution to cases in which monsters move between demarcated waypoints, as in (for example) Gem TD. I'm curious to hear if you can think of such a way and code it back into the demo, as I might make a simple map around the concept if you can.
 

Attachments

  • Antiblocking Demo.w3x
    16.8 KB · Views: 473

Strilanc

Veteran Scripter
Reaction score
42
Every wall separates two sections of the map. If you crawl around the perimeter of towers and terrain, you will hit the other side of the tower if and only if there is no wall. Unfortunately the crawling is NOT efficient at ALL on large maps (I have actually written and tested this, it hits the op limit).

In power towers I use a different approach. Units drop rects as they walk, and if they re-enter those rects they have been walked (backtracking is really the most reliable sign). It also checks if they are stopped, not moving for a couple seconds, or attacking.
 

OVRKLL

New Member
Reaction score
3
Whoa!
I haven't worked on that map for so long I figured this tread was dead!
Well. I don't really wanna look into the problem again as I'm currently modding for HL2:EP2. Thanks anyway!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top