wandering creeps

Lord Kass

Active Member
Reaction score
2
Can anyone help me with this? I need a creep that wanders around. I tried the wander ability but the problem with it is that when you attack that creep, the creep runs away from you and i don't want that. I can't use too the easy way which is

Code:
Wander
    Events
        Time - Every 15.00 seconds of game time
    Conditions
    Actions
        Unit - Order Ghoul 001 <gen> to Move To (Random point in Wander 001 <gen>)

cause when that creep dies and after it had revived or spawned again or something, trigger won't work obviously. Map is like an rpg or something when creeps die they are respawned after some few seconds. I also wanted them not to roam around too far.
 
S

Sylvanas299

Guest
Giving the unit the wander ability will make them move, but if they run away, you can use triggers to do unit gets attacked, tell attacked unit to attack attacking unit. And you can also create regions to were if they leave, it will put them back in random point in regions. I'll give code if you haven't figured it out or if no one else responds to this when I get home.
 

Exide

I am amazingly focused right now!
Reaction score
448
You can also remove Abilities for Units with Triggers.

*Unit Type of Unit* is attacked
Remove Wander from *Unit_Type*

-Something like that :p
Dont know if that will work, though.
 
S

Sylvanas299

Guest
You can also remove Abilities for Units with Triggers.

*Unit Type of Unit* is attacked
Remove Wander from *Unit_Type*

-Something like that :p
Dont know if that will work, though.

It would, set the unit thats attacked to a variable, then remove wander from the variable.

Code:
Event
Unit [COLOR="Red"]is attacked[/COLOR]
Condtion
[COLOR="Red"]Attacked unit[/COLOR] equal to [COLOR="red"]Gnoll Poacher [/COLOR](maybe player comparison too) and Owner of [COLOR="red"]attacked unit[/COLOR] equal to [COLOR="red"]Neutral Hostile [/COLOR](or who ever)
Action
Set [COLOR="red"]attacked unit [/COLOR]= [COLOR="red"]Attacked_Creep[/COLOR]
Remove [COLOR="red"]Wander[/COLOR] from [COLOR="red"]Attacked_Creep[/COLOR]

You could also do a trigger to give wander back incase the creep wins.Things can be done various ways, just pick which ever you feel is easiest.
 

Lord Kass

Active Member
Reaction score
2
Ok thx guys. Will this work?

Code:
Creep Attacked
    Events
        Unit - A unit Is attacked
    Conditions
        (Owner of (Attacked unit)) Equal to Neutral Hostile
    Actions
        Unit - Remove Wander (Neutral) from (Attacked unit)
        Wait 15.00 game-time seconds
        Unit - Add Wander (Neutral) to (Attacked unit)
 

Exide

I am amazingly focused right now!
Reaction score
448
Looks like it would work.
But note that when the unit is attacked. The trigger will fire again. And again. For each attack. If you know what I mean.
So if the creep has a lot of hp, the trigger will run again and again. I'm not sure how it will work with the:

Wait 15.00 game-time seconds
Unit - Add Wander (Neutral) to (Attacked unit)

-part..
But I don't think it will be a problem, though. Because I can't see any Memory leaks in your trigger.
Maybe I missed something, though. But it looks good to me :p
 
Reaction score
65
If you really don't want to remove it every time add a
IF unit has ability
THEN remove ability & wait 10 seconds and add ability
ELSE do nothing
 
B

Blue_Hand

Guest
A good way of making random moving creeps is to add them to unit group at initialization and then
Code:
Random Move
    Events
        Time - Every 3.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in Random_moving_group and do (Actions)
            Loop - Actions
                Unit - Order (Picked unit) to Attack-Move To (Random point in Region 001 <gen>)
because you order them to attack-move they will stop moving random when they see enemy and attack it, and after that they will come back to moving random. Units in unit group are in that group even if dead, so there isn't problem with respawning them.
 

Romek

Super Moderator
Reaction score
964
A good way of making random moving creeps is to add them to unit group at initialization and then
Code:
Random Move
    Events
        Time - Every 3.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in Random_moving_group and do (Actions)
            Loop - Actions
                Unit - Order (Picked unit) to Attack-Move To (Random point in Region 001 <gen>)
because you order them to attack-move they will stop moving random when they see enemy and attack it, and after that they will come back to moving random. Units in unit group are in that group even if dead, so there isn't problem with respawning them.

i think you should keep it as move. and do another trigger which makes them attack if attacked. this way, the creeps won't engage battle with you as much as a player (I think you've noticed hat neutral hostile doesnt attack air)
 
W

WoW01

Guest
Rather than useing the wander ability, triggers may get the job done more effectively IF you know the wandering unit is going to die on its first engagement.
Wander
Events
Time - Every 15.00 seconds of game time
Conditions
Actions
Unit - Order Ghoul 0000 <gen> to Move To (Random point in Wander <gen>)
And then in another trigger
Wander Turn off
Events
Unit - Ghoul 0000 <gen> Is attacked
Conditions
Actions
Trigger - Turn off Wander <gen>
However if you are not planning on the unit dying during its first engagement yuo may want to try someone else's idea...:)
 

Tom Jones

N/A
Reaction score
437
That would require you to make a trigger for every unit you wish to wander... You SHOULD use the wander ability, the reason they are running off when attacked is that they are assigned to player neutral, passive, or extra. Try changing it to Player Hostile.
 
B

Blue_Hand

Guest
this is not right
the reason they are running off when attacked is that they are assigned to player neutral, passive, or extra. Try changing it to Player Hostile.
Hostile Player units with wander will attack enemies but they will sometimes run away. This can happen randomly.
=> romek
I don't understand you exactly. And Neutral hostile units attack air.
 

Tom Jones

N/A
Reaction score
437
If you take 'em to far away from their respective creep camps, yea they will run back. If a hostile creep is provoked, and if it aint disabled, it will attack the provoker.
 
B

Blue_Hand

Guest
I tried this. Even if they are in their respective creep camps, sometimes they run away, when you try to attack them. When in combat they rather don't do this.
 

Flying Hipo

New Member
Reaction score
4
give unit wander, and make a trigger that checks whether the unit is in the region or not, if not, then warp unit to center of region ______
 

Exide

I am amazingly focused right now!
Reaction score
448
How about giving them wander ability and then turning off 'canFlee' (set to 0)?
 
A

Aasimir

Guest
blue hand was closest

his trigger before where you pick every unit was just about right, only instead of attack move you merely use patrol.
 

Exide

I am amazingly focused right now!
Reaction score
448
I, still, don't see why you need a trigger, though..
Just add one or two simply settings to the few Units you want to Wander around, and you're done :p
 

Weyrling

New Member
Reaction score
25
I think that the people on this forum need to use more simple ways of doing things, you guys can make up amazing triggering for simple things, such as turning the Can Flee setting to False.
 
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