HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Can i limit a certain hero ability to an area?

01-28-2003, 04:07 PM#1
Guest
Yeah, through triggers is it possible to allow a hero to use one of his abbilities only in certain areas of the map?
01-28-2003, 04:27 PM#2
DaKaN
THe basic idea to that is:

Unit uses a ability (cant remember exact action)

Condiiton: Triggering unit is (hero) [suggest you set the hero to a varible and use the varible there]
Issued order is (spellOrderName) [You can get that from the (race)AbilityFunc.txt there should be a "Order=name" thing in there for that ability

Actions

If (Boolean[Unit is in Region (Region) Is = to True]) Then Do Nothing, Else to Order Unit to Stop


that should stop the unit from even casting it
01-28-2003, 05:12 PM#3
fr0ggE
yay! Dakan's info says that's he's 1% done with hero quest 3. Oh happy day!
01-28-2003, 06:21 PM#4
Guest
now a little bit more, what if i have a couple of regions that i want the unit to be able to cast the certain spell in and not the rest of the map, should i make a number of such trigers each for the approrpreate region and one for if the unit is not in them, or is there some way to combine all of that into one trigger. The basic premis is i have a hero that has the ability to castdark portal. I want him to be able to cast this spell only in the vicnity of way gates and not outside. Throughout the map i will have 6 or so waygates. Thank you in advance.
01-28-2003, 06:49 PM#5
fr0ggE
i think this works. This is just what dakan had for events and conditions, we're just making it negative and having a bunch of ands.

ACtions:
IF [ AND (AND (triggerin unit is in region 1 = false) (triggering unit is in region 2 = false)) (triggering unit in region 3 = false)] etc...
THEN do nothing
ELSE order triggering unit to stop
01-28-2003, 07:01 PM#6
rwxr-xr-x
Another thing you could do is simply disable the Hero ability you don't want them to be able to use, and enable it when they enter the regions you want them to be able to use it in. This would only really work best if the player had only 1 hero, or if 2 of their multiple heros did no have the same ability. Would take 2 triggers, but is much simpler and less cpu intensive than several if-then statements.

[EnableAbility]
EVENTS
Unit enters Region A
Unit enters Region B
...
CONDITIONS
Triggering unit is a Hero Equal to True
(or be more specific to the exact hero)
ACTIONS
Player - Enable <hero ability> for Owner of triggering unit

[DisableAbility]
EVENTS
Unit leaves Region A
Unit leaves Region B
...
CONDITIONS
Triggering unit is a Hero Equal to True
(or be more specific to the exact hero)
ACTIONS
Player - Disable <hero ability> for Owner of triggering unit
01-28-2003, 07:20 PM#7
fr0ggE
you can *DO* that!?!?! hot damn, you learns something new every day. :D

EDIT: can you do that with custom spells? Will they show up under "Value" for that trigger when you implant the new abilities...or can you get a custom spell to be an "ability variable" and use it there that way?
01-28-2003, 07:36 PM#8
rwxr-xr-x
Quote:
Originally posted by fr0ggE
you can *DO* that!?!?! hot damn, you learns something new every day. :D

EDIT: can you do that with custom spells? Will they show up under "Value" for that trigger when you implant the new abilities...or can you get a custom spell to be an "ability variable" and use it there that way?


To be completely honest with you, I haven't tried enabling/disabling with custom spells (i.e. creating new ones, not editing current ones). My guess, however, is that you would be able to do that so long as your AbilityData.slk and corresponding .txt files are in the Units folder so that WE can read them and know about your custom spells.
01-28-2003, 10:56 PM#9
Guest
rwx its going to be only for one hero, its not a mele game either, but rather a rpg thing im working on, part of the sinister plot twist :)
01-29-2003, 12:16 AM#10
rwxr-xr-x
Quote:
Originally posted by Kal'ash
rwx its going to be only for one hero, its not a mele game either, but rather a rpg thing im working on, part of the sinister plot twist :)


Then for your condition, you can specify the unit type of that hero.
01-29-2003, 03:37 AM#11
Guest
guys i tired it, and i have had no luck. I would appreciate if you could help me out, i tired both ways to no avail, although i did not choose a specific unit. If that is the case than plz instruckt me on how to set it to a specific user and if something else is amiss, than please explain it as if i were severly brain dmg'd
01-29-2003, 06:13 PM#12
Guest
bump