• 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.

Can you detect terrain type at a point?

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I would like my cars to drive faster when on a road, and slower when on rough terrain. They move by triggers, so I just need to detect what terrain is at a point.

I looked over the functions and I can't seem to find any way of detecting a terrain type. I suppose I could use regions over every street and every terrain type, but that would be really annoying.

Is there another option that I'm not aware of?
 
No, you may not have realized but starcraft 2 terrain is a mix of different textures.

You couldn't check if there's a specific texture.

Awww damn it. :sad:

Anyway I can use the grass models without them appearing black ingame? I script the replacement of the actor model using this line
JASS:
libNtve_gf_UnitSetVariation(lv_u, "DynamicGrassAgria", lv_i, "");
and it replaces the model but there's no texture; it's black. I want to create a grass system in my map that covers the entire map in grass.
 
Level 5
Joined
Aug 27, 2008
Messages
127
Another thing you can try is by making dummy invisible in-game turrets on every road. By trigger
Event - An unit is attacked
Cond - Attacking unit equal to Slow Road Turret
Action - Set movement speed to:
I can try to explain it better to you if you want.
 
Awww damn it. :sad:

Anyway I can use the grass models without them appearing black ingame? I script the replacement of the actor model using this line
JASS:
libNtve_gf_UnitSetVariation(lv_u, "DynamicGrassAgria", lv_i, "");
and it replaces the model but there's no texture; it's black. I want to create a grass system in my map that covers the entire map in grass.

This isn't your thread, make your own if you want to ask questions.
 
No, you may not have realized but starcraft 2 terrain is a mix of different textures.

You couldn't check if there's a specific texture.

This isn't your thread, make your own if you want to ask questions.

So I should make a duplicate thread about the exact same thing when one already exists? I was going to ask about terrain than I saw this thread...

Another thing you can try is by making dummy invisible in-game turrets on every road. By trigger
Event - An unit is attacked
Cond - Attacking unit equal to Slow Road Turret
Action - Set movement speed to:
I can try to explain it better to you if you want.

It's better to use destructibles otherwise you'll exceed the unit count and not be able to spawn anymore units on your map...
 
Last edited:
Level 14
Joined
Aug 30, 2004
Messages
909
Thanks for the suggestions, all. (+rep incoming)

I have a custom movement system that moves my cars every .0625 seconds... so checking for a buff or seeing if they've been attacked and such would really add to the lag I suspect. I'd be happy if I could just check for roads or not...

I don't plan on using creep at all. Is there some way I could make creep invisible? That way I could put creep all over the roads. There is a condition to check if a point is creeped or not.
 
Level 5
Joined
Aug 27, 2008
Messages
127
Maybe changing the texture of the creep would help lol. Making it to road or something. But still, I dont think that checking the car for buff would make it lag. And really, just need a new trigger for the "if a car is attacked than change variable for movement speed", which wont make it lag too. I can make it for you if you want, just to show you. Because I have a similar system.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Maybe changing the texture of the creep would help lol. Making it to road or something. But still, I dont think that checking the car for buff would make it lag. And really, just need a new trigger for the "if a car is attacked than change variable for movement speed", which wont make it lag too. I can make it for you if you want, just to show you. Because I have a similar system.

I appreciate the offer, but I can take a crack at it myself. I'll probably be working on this map for about a year, so maybe the expansion will come out and offer up some new options. I'm still in the very early stages so I have no trouble putting it off while I code other aspects of the map.
 
Level 1
Joined
Sep 11, 2011
Messages
2
If your roads are all rectangular (or at least all following angles you could put rects on) you could maybe do a region-based system for road detection? Shouldn't be hard if they're all at 90 degree angles. Alternatively see Dr Super Good's above suggestion.
 
Level 14
Joined
Aug 30, 2004
Messages
909
How about if you use pathing (h) and you check for that pathing on your roads?

So far that is working well, thanks!

EDIT:

One snag, there doesn't appear to be a function to detect buildable pathing at a point. All I found was a boolean function for whether a point is passable to ground units.

Am I missing another function? Or is this something I need to use the data editor for?
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Damn... does not appear to be a way.

Well I guess you will just have to check if a unit is in a region then.

Actually there probably is a way to detect pathing. It probably involves eithor placing a unit which is not able to use a certain pathing type or ordering a building to be produced.
 
Status
Not open for further replies.
Top