Ability based on Pocket Factory - weird hero behavior

gameshow

New Member
Reaction score
1
So have a hero with the ability "pitch tent" using the pocket factory to spawn said tent. After pitching the tent, i want the ability removed, and the "pack tent" ability added, giving the unit the ability to move his tent aruond at will.

Problem is, if the event is "a unit finishes casting..." it's possible for the hero to pitch the tent, quickly issue an order like move, and have a tent, but not get the ability to pack it up (after all, he never finished casting).

If I change the event to "a unit begins casting..." Then for some reason I must issue my unit a stop order or i can't move him at all. If i have the trigger issue the stop order, then the tent never gets pitched.

If I chagne the event to "begins the effect of..." The tent never gets cast. The ability fires, but no tent. IdeaS?

EDIT: Adding a casting time to the ability doesn't help.
 

perkeyone

something clever
Reaction score
71
maybe the events that are used to remove the tent ability and to give pack up ability should be different.

like maybe "begins the effect of" could be used to remove pitch tent
and if it gets canceled use an event for "unit cancels an ability" or what ever
to give it back to the unit
and maybe the "finishes the affect of" to add pack up

experiment with it and lemme know how it goes


wait how about this instead

one it finishes casting remove pitch tent.
use a diff trigger to detect when units enter the playable map area of the unit type of the tent and give the ability to pack tent to the hero that made it. but that will only work if only one unit per player can make tents
 

gameshow

New Member
Reaction score
1
which should be the case. No player will ahve more than 1 of these heroes. Thanks for your help - off i go to test.

EDIT: Apparently, spawning the tent with this spell doesn't appear to trigger the "a unit enters playable map area" triggers. Weird. Maybe i'll have to settle for using a dummy unit to spawn the tent. Actually, yes they do, and this now works just fine. Here's teh trigger.

JASS:
Pitch Tent
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        (Unit-type of (Triggering unit)) Equal to Tent
    Actions
        Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Woodsman) and do (Actions)
            Loop - Actions
                Unit - Remove Woodsman - Pitch Tent  from (Picked unit)
                Unit - Add Woodsman - Pack Tent  to (Picked unit)
 

perkeyone

something clever
Reaction score
71
wow thats odd
best of luck with the dummy caster

edit: oh nice you got it to work
 

gameshow

New Member
Reaction score
1
It does. In fact, it always has. Here's the trigger

JASS:
Pack Tent
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Woodsman - Pack Tent 
    Actions
        Set tentInRange = False
        Unit Group - Pick every unit in (Units in (Region centered at (Position of (Triggering unit)) with size (600.00, 600.00))) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                (Owner of (Picked unit)) Equal to (Triggering player)
                                (Unit-type of (Picked unit)) Equal to Tent
                    Then - Actions
                        Set tentInRange = True
                        Set currentTent = (Picked unit)
                    Else - Actions
                        Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tentInRange Equal to True
            Then - Actions
                Unit - Remove currentTent from the game
                Unit - Remove Woodsman - Pack Tent  from (Triggering unit)
                Unit - Add Woodsman - Pitch Tent  to (Triggering unit)
            Else - Actions
                Game - Display to (Player group((Triggering player))) the text: You must be near yo...


Learning the magic of "starts the effect of..." made this one work perfectly.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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