• 🏆 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!

Pick each unit owned by players --> Check terrain type

Status
Not open for further replies.
Level 1
Joined
Aug 8, 2012
Messages
4
Okay, I tried to search but didn't quite find something to fit exactly my conditions.

So I used to map like hardcore on WarCraft III many years ago.. Now I decided to try mapping for SC2 and recreate an escape type map which I made for WC3.

Now, for WC3 I created pretty good trigger imho. Remember those "Escape from XXXX -city" maps? They had these paths and if you wondered off you'd die. They were typically done with loads of regions and I found it a bad way to do it.
So I created this trigger which checked every 0.1 secs or so, where the spesific unit was standing on the map. If on the wrong terraintype, it would die.

Can this be achieced in Starcraft II? I didn't find it but however I am still quite unfamiliar with this new editor. Also, the textures are a bit of mix of each other, but if I set the brush at 100% and create clear paths, you think it would work?

The trigger in principal goes somewhat like this:

Code:
Event:
Every 0,1 seconds of game time

Action:
Pick every unit (unit type).
IF:
And here comes the terrain part. However I didnt find the matching condition.
THEN:
Kill picked unit matching condition
ELSE:
Do nothing

E: And by "wrong terrain" I mean a spesific terrain type, like Bel'Shir Grass or something. So the trigger would check IF the selected unit is standing on that forbidden type of terrain.
 
Level 1
Joined
Aug 8, 2012
Messages
4
Well I was planning on using a couple of different "safe groundtypes", like light grass and regular grass and using only one "bad" terrain.
But I could reverse it too, making all but one terrain type bad....

Either way works. It would be better to have only one bad terrain type so I can change the path look for different parts of the map. :)

You think this trigger is possible with sc2?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
StarCraft II does not have terrain types. They are instead a painted blend of terrain textures.

What you could do is use the pathing map instead. Make all safe zones unbuildable and all death zones buildable. When a unit walks on a buildable terrain you then kill it. Probably can be done with the data editor alone even.
 
StarCraft II does not have terrain types. They are instead a painted blend of terrain textures.

What you could do is use the pathing map instead. Make all safe zones unbuildable and all death zones buildable. When a unit walks on a buildable terrain you then kill it. Probably can be done with the data editor alone even.

Agreed.

Apply a behaviour to any unit that steps on a buildable terrain. The behaviour sets hp regen to -1000 or something

This would be the most simple way to do it.

Unlike WC3.. Sc2 (as DSG said, but in more detail here) does not use a simple terrain system.

In Wc3 you would assign a certain tile to a specific area on their grid, and that would be displayed. No two terrains could overlap.

However Sc2 terrain is more like taking two buckets of different colored paint and splashing them onto the same area.. except they dont change colour when combined.

It's just a matter of setting the alpha per terrain (thats why some can be somewhat see-through). However there must always be a solid texture underneath.

For this reason having the system monitor what texture a unit is on would be impossible as all textures can overlap one another.
 
Level 1
Joined
Aug 8, 2012
Messages
4
Ah ok. :) I was assuming that it couldnt be done that way, but that pathing map seems like a reasonable idea.
Thanks!
 
Actually, patch 1.5 added a condition to check for the dominating tile texture at a point, making what you had originally planned very much possible.

  • SomeTrig
    • Events
      • Timer - Every 0.1 seconds of Game Time
    • Local Variables
    • Conditions
    • Actions
      • Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
        • Actions
          • General - If (Conditions) then do (Actions) else do (Actions)
            • If
              • (Texture at (Position of (Picked unit))) == Agria Concrete
            • Then
              • Unit - Kill (Picked unit)
            • Else
 
Level 1
Joined
Aug 8, 2012
Messages
4
Actually, patch 1.5 added a condition to check for the dominating tile texture at a point, making what you had originally planned very much possible.

  • SomeTrig
    • Events
      • Timer - Every 0.1 seconds of Game Time
    • Local Variables
    • Conditions
    • Actions
      • Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
        • Actions
          • General - If (Conditions) then do (Actions) else do (Actions)
            • If
              • (Texture at (Position of (Picked unit))) == Agria Concrete
            • Then
              • Unit - Kill (Picked unit)
            • Else
Yeah this one works great! Thanks!

Shame though SC2 doesn't have a good "snap to grid" system for terrain textures but well, I just have to live with it.

Also (complitely irrelevant to the topic);
I seem to have trouble finding a way to use trigger for "all active players excluded one".
One player is CPU and I don't want to add a leaderboard and units to cpu which are supposed to be just for the players. Tried looking through variables quickly with no luck. "Active players" doesn't work either as sc2 counts cpu as one. So how I pick up all players but one / create units for all active players but one?

Errrm. Just as I was typing this I think I figured it out in my mind... Maybe. Heh. But no time to test as got to go. -->

Again, thanks everyone. :) It's been too long away from mapping... Forgot everything. ^_^
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
You filter all active players, adding ones which pass the filter to another player group.
The filter checks if the controler is human.

You can then iterate through all players in the other player group (the one with filter results).

It can be useful to build a library of different player groups you will use regually. This saves recomputation and can allow some less used player groups to be generated using the player group set opperations.
 
Status
Not open for further replies.
Top