Simple creep problem

marvey323

Member
Reaction score
1
Basically, I setup creeps in my oRPG to wander around so they dont look stupid standing motionless all the time.

I created regions for each kind of creep like 'Furbolg Area 1' and placed all furbolgs in there.

Then I created this triggeR:

Trigger:
  • Furbolg Area 1
    • Events
      • Unit - A unit leaves Furbolg Area 1 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Furbolg
    • Actions
      • Set CreepReturnArea = (Random point in Furbolg Area 1 <gen>)
      • Unit - Order (Triggering unit) to Move To CreepReturnArea
      • Custom script: call RemoveLocation(udg_CreepReturnArea)


That's to ensure that if they wander outside their region they get thrown back in there so they dont end up wandering all over the map.

The problem:
If a player is OUTSIDE Furbolg Area 1 and starts attacking a furbolg, the furbolg runs up to the border of the region and helplessly runs back inside the region unable to attack the player.

How can I solve this ? I know I need to put another condition like 'unit is attacked by player etc' so that it knows to be allowed to leave the region ONLY if it is attacked by a player...



Edit: Here's what I tried to do.. I tried adding the creep being attacked to a unit group and then the trigger above I added a new condition that checks if that unit is in the unit group. It didn't work.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Maybe use this action:
Trigger:
  • (Current order of (Triggering unit)) Not equal to (Order(attack))
 

marvey323

Member
Reaction score
1
I have given them the wander ability (i said so in my first post).

Just giving creeps the wander ability in an oRPG is not enough. After some time you will see tha they will wander ALL OVER THE MAP !
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top