Unit: Create unit in specific terrain type

Killerphill

New Member
Reaction score
1
Hi guys.

I need to know how to create units at a random point in a specific terrain type around the entire map or else my "creeps" will be spawning everywhere. lol.

is this possible? + rep for solution :)

thanks in advance.
 

TideOfChaos

New Member
Reaction score
25
Nope.
There is no way to check the sort of Terrain in an area. You will just have to create a whole lot of regions my friend.
 

Evoroth

New Member
Reaction score
11
Yes, there's a condition which is something like "Is terrain type at (point) equal to (Lordaeron Dirt or whatever).

You have to options, either make a trigger which somehow picks every location (which some interval) in lordaeron dirt (or whatever), or pick a random point in playable map area (or preferingly smaller), check if it's on lordaeron dirt, and pick a new random point if it isn't.
 

cleeezzz

The Undead Ranger.
Reaction score
268
check if it's on lordaeron dirt, and pick a new random point if it isn't.

even though you can check terrain type, it would be better to use regions, it is possible for the trigger to run maybe 100+ times before a picks the right point (depending how much of this terrain type is around the map)

unless its over 60% of the maps terrain type, then i wouldn't recommend it.
 

wraithseeker

Tired.
Reaction score
122
Code:
Unit - Spawn your unit

If Terrain type at last created unit equal to your terrain
then

else
kill last created unit

This is hand written.
 

Killerphill

New Member
Reaction score
1
i cant have the spawned unit being killed or else eventually theyll all die off. ive also tried doing that "terrain condition" thing but havent gotten any luck with it yet. i dont really want to fall back on regions as i cant "mold" them into a wierd shape and that would cause all units to spawn inside the region and not where the region doesnt cover.

sorry if i explained that wrong.
 

mordocai

New Member
Reaction score
17
try using pathing blockers? and then just turn collision off if unit is at the desired tileset, then turn back on, if not then just dont do that at all? i think this woudl require a region, and unit groups
 

chovynz

We are all noobs! in different states of Noobism!
Reaction score
130
The simplest and most easiest way is to:
(Note: this is not an optimized trigger however it works and removes the leaks.)
Code:
ConditionalTerrainSpawn
    Events
        Player - Player 1 (Red) types a chat message containing !Behold my great glory shall smite thee unto all Eternity! as An exact match
    Conditions
    Actions
        Set CreepType = Footman
        Set CreepSpawnLocation = (Random point in (Playable map area))
        Set VarTerrainType = Lordaeron Summer - Dirt
        Set CreepPlayer = Neutral Hostile
         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Terrain type at [COLOR="Blue"]CreepSpawnLocation[/COLOR]) Equal to (==) [COLOR="Blue"]VarTerrainType[/COLOR]
            Then - Actions
                Unit - Create 1 [COLOR="Blue"]CreepType [/COLOR]for [COLOR="Blue"]CreepPlayer [/COLOR]at [COLOR="Blue"]CreepSpawnLocation [/COLOR]facing Default building facing (270.0) degrees
            Else - Actions
                Custom script:   call RemoveLocation(udg_CreepSpawnLocation)


Always use variables. It makes it easy to change what you want when they are all at the top. All the actions should be independent of the variables. Makes it easy to debug your maps too.

I use names like VarTerrainType to help me distinguish at a glance that I'm using a variable instead of a actual command.
 

Killerphill

New Member
Reaction score
1
Nevermind, i got it working my own way, just changed a whole lot of triggers around that chovynz gave me. thanks for the help man, + rep to you.
 

chovynz

We are all noobs! in different states of Noobism!
Reaction score
130
Aheh. Your welcome. I'm glad you got it working.
You're supposed to change things how you need them.
I cant mind read :D.
Goodluck with the rest of your map.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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