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

[Trigger] Guard 'AI' Troubles

Status
Not open for further replies.
Level 7
Joined
Jun 16, 2008
Messages
253
I stuck this in my intro thread, and I'd like some help if you can, I'll try my best to explain it.

I want the Guards (unit group) of one City (region) to be able to recognise that a particular item a unit is carrying is classified as contraband in that city or zone.

That's it in a nutshell. :D Every else I can take care of, but just that simple getting a guard that's within visual range to compare every item, with a bad item list that that city has. This will likely require a large array variable list (or several), especially considering that there will be different lists for different city regions. The World Edit won't even let me do a 'general unit acquires a target' thing, let alone how to create my contraband lists that can be changed in the game.

Can anyone help with this? Or is there anything more I need to explain?

EDIT: Oh, and the item generally won't be a pre-existing game item, I need it to be applied to the unit type, or something that creates the same effect.
 
Last edited:
Level 2
Joined
Jun 15, 2008
Messages
18
I've attached my solution to the problem. I wouldn't use this exactly, since it it leaks, but it solves your problem exactly I think.

- You cannot take the ring named 'OMG CONTRABAND' into the city limits while there is a gaurd there. If you kill him, you are able to then take the ring into the city without recieving the contraband message

- It doesn't matter which item slot you carry it in

- You can very easily edit the trigger for multiple cities (Just change the region from 'Troll Hut' to something else)

- You can very easily set the list of banned items
 

Attachments

  • Contraband Trigger.w3x
    10 KB · Views: 60
Level 7
Joined
Jun 16, 2008
Messages
253
Thanks for the trigger froolow, and the trigger is a handy reference, but unfortunately it doesn't address my chief problem.

If it was simply a fixed item-type that I had to prevent from getting inside the city, then I wouldn't have this problem.

There are several guards, all of whom 'watch' the passing crowd with a trigger, if a person that they watch has a piece of contraband, then they do their thing.

But contraband will not be a specific item, there are city laws which will govern which item-types are contraband and which are not, and these lists can differ between different zones.

I'm thinking I might restrict potential contraband items to like 12 dodgy items, but that really hampers the gameplaying style I want, where I want lots of potential.

I might have to post my map.
 
Level 7
Joined
Jun 16, 2008
Messages
253
Not as far as I can see either:(. I can't even append a variable item classification to an item type. I think I can get away with a dumbed down version, with just 12 contraband items which can be toggled on and off (as contraband) in each city or region. That'll take a little setting up, but it's too 'fixed' for my liking. I'd like to be able to put a ban on cheese if I want :(.
I'm really hoping to be able to do the full fledged version of it. If I have to, I'll download a JASS program or whatever it is that you might need, but I'll have to learn to use it :(.

I really will have to upload map, so that anyone interested can actually poke at it.

The central problem I'm actually having right now is with the B portion of a trigger.
Roughly-
Event- Unit casts and ability
Conditions- Ability = Watchful Eye
Actions = Casting unit attacks Target of cast ability.

That's the sum of my dilemma, and it's one I used to have on the first draft i made of the map. The computer for some reason can't figure out who the casting unit and the target of cast ability is. It doesn't recognise at all.

Does anyone know why?

EDIT: Love your sig btw :D
 
Last edited:
Level 5
Joined
Sep 10, 2006
Messages
185
The central problem I'm actually having right now is with the B portion of a trigger.
Roughly-
Event- Unit casts and ability
Conditions- Ability = Watchful Eye
Actions = Casting unit attacks Target of cast ability.

  • Unit - Order (Triggering unit) to Attack (Target unit of ability being cast)
?
 
Level 7
Joined
Jun 16, 2008
Messages
253
Lol, BagofChips. That didn't occur to me. That solves one half of the equation.
Now to figure out how to get it to recognise the Target within the trigger. I can't just slap a variable = the target from the A trigger, mainly because there will be a lot of units throwing this watchful trigger around at the same time, so I need it to work like an array, the unit has to be associated with that trigger only and units only, I don't want another random guard running over the city to bash the culprits brains out. I want the spotting unit to do that. :D

EDIT: I can get the computer to recognise the casting unit when I 'fix' the trigger, so that the trigger will only run once at a time, for test purposes. But for some reason it still doesn't recognise the Target of ability.

'Sides which, I need it to work with multiple instances of the trigger working at the same time.
 
Level 2
Joined
Jun 15, 2008
Messages
18
Attached is my second attempt at your trigger. I think this solves everything you could possibly want

- At the start of the map, it sets every item to an item type array "BASE"
- You then set the items that are contraband and the regions they are banned in by typing "-set##" (instructions in the quest menu)
- Having done this, you cannot bring illegal items too close to gaurds.
- There are different contraband lists for each 'city', which are independantly controlled

It is sickeningly modular - to add a new item you just need to set a new item into the "BASE" item array (to add a new region is slightly more complicated because I assumed you might want to use different types of gaurd for each region)

- It also has the plus point that you don't need to give your gaurds an ability - they scan you automatically once you come into their sight range
And I even wrote an endy bit to the trigger - at the moment if you enter a city with contraband they just say "Contraband" to prove the trigger works.
- You could very easily change that to "make matching unit attack picked unit", solving the last of your problems I believe.
 

Attachments

  • Contraband Trigger2.w3x
    12.7 KB · Views: 43
Level 7
Joined
Jun 16, 2008
Messages
253
It sounds great! Thanks for taking the time! I'll test it right now.
It sounds like a little modification will be needed in just niggly things.
I wanted the searching to be based on who's watchful or not, and for the moment I have an ability that tells you this.
And I think yourr trigger should support the fact that I want to create new regions/towns for players themselves if they so choose. I can still just add created town to whatever variable I need can't I?
But still, your trigger sounds like it has covered my problem areas, and I'm very grateful. :D

Check out my current map in the Map Dev section if you're of a mind. Bear in mind it's very early.
 
Level 7
Joined
Jun 16, 2008
Messages
253
Hey, I tried the map, but it doesn't work.
I tried to see what was wrong but it's all new areas what you did and I couldn't figure out how to fix it.
One area I did see was you put "pick all units within (picked unit) etc.." sort of deal. Can you put (picked unit) right away? I thought you could only do that with (matching unit)?
Would you be able to tell me how to fixith it?
 
Level 2
Joined
Jun 15, 2008
Messages
18
What specifically doesn't work?

When I tested it just now it worked perfectly.

Try typing "-set12" (without the quotes) then try and take item 1 into the huts at the bottom. You should get a quest message saying 'Contraband'. The first number refers to the item, the second to the area you can or can't take it in, but I assume you already know that - I don't know where else the problem could be
 
Level 7
Joined
Jun 16, 2008
Messages
253
I'll try it, maybe I was using trigger with the item in my inventory, would they make a difference? I'll get back to you. Here' a cookie for your trouble btw.
:cookie ! lol
 
Level 24
Joined
May 9, 2007
Messages
3,563
Btw, Alakon. . .

There is a button on the bottom of your posts that allows you to edit it.

Please do this instead of making too seperate posts.

You really should use buffs for your problem. It will be a lot easier.

Your map sounds very interesting. .

Tell us more in the "Idea Factory"
 
Level 7
Joined
Jun 16, 2008
Messages
253
Sorry about that. I believe this was the first post I made here and I was still used to the unoffic WoW site where you can't edit.

It's probably a good idea to stick RPG Myriad in the Idea Factory, but it's in fact already pasted up in the normal Map section.

I see if I can use Buffs but I think that would be only a superficial solution as there are far ranging integration techniques that I'm using, as also Buffs would only affect a unit, not the item he is carrying. So it is difficult to write triggers for arbitrary variable array forces to do specific things about it. To the best of my expertise anyway.

EDIT: I found out what I was doing wrong with the map, I wasn't putting - before the setXX. Thanks for the trigger!
 
Last edited:
Status
Not open for further replies.
Top