• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] what is wrong with this trigger

Status
Not open for further replies.
Level 21
Joined
Mar 2, 2010
Messages
3,069
construction on site 1
Events
Unit - A unit Finishes casting an ability
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(foundation8 <gen> contains (Casting unit)) Equal to True
(Ability being cast) Equal to transform into crypt
Then - Actions
Unit - Remove (Casting unit) from the game
Unit - Create 1 Crypt custom for (Owner of (Casting unit)) at (Center of foundation8 <gen>) facing Default building facing degrees
Unit Group - Add (Last created unit) to site8
Else - Actions
Do nothing
 
This condition:
  • (foundation8 <gen> contains (Casting unit)) Equal to True
makes the spell unable to work. You are not sure that the casting unit is inside that region. In spells, we are discouraged to use regions. It is a must to use points.

The trigger below might solve the issue. This must be made MUI for good use.

  • ConstructionOnSite
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <your custom ability>
    • Actions
      • Set ConstructionOnSitePos = (Position of (Triggering unit))
      • Unit - Create 1 Crypt for (Owner of (Triggering unit)) at ConstructionOnSitePos facing Default building facing degrees
      • Unit - Remove (Triggering unit) from the game
      • Custom script: call RemoveLocation(udg_ConstructionOnSitePos)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Instead create and removing them, you can use Unit - Replace function.

Well onto the trigger, well the unit did not get into the Unit Group ?
I think it bugs with Unit Finishes casting an ability because that ability is full of bugs such as it can't properly save (Target unit of ability being cast) if cast time is long and other else.

Well, if you use Starts the effect of an ability, it should work fine.

By the way, does this spell requires a certain cast time until it forces you to use the Finishes event ?
 
Level 8
Joined
Sep 7, 2008
Messages
320
  • Events
    • Unit - A unit Finishes casting an ability
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • (foundation8 <gen> contains (Casting unit)) Equal to True
      • (Ability being cast) Equal to transform into crypt
      • Then - Actions
        • Unit - Create 1 Crypt custom for (Owner of (Casting unit)) at (Center of foundation8 <gen>) facing Default building facing degrees
        • Unit Group - Add (Last created unit) to site8
        • Unit - Remove (Casting unit) from the game
      • Else - Actions
        • Do nothing
fsafas
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
This condition:
(foundation8 <gen> contains (Casting unit)) Equal to True
makes the spell unable to work. You are not sure that the casting unit is inside that region. In spells, we are discouraged to use regions. It is a must to use points.
If the spell is intended for only that particular map, it is still considered as spell and sure working, just you can't import it correctly because you have to pre-set a region for yourselves in your own game.

Also, maybe he has his own agenda, when someone cast this ability on that particular region, the owner will get this special unit namely Crypt custom and only in that region while other unit cast this ability outside the region, gets nothing.
 
Level 8
Joined
Sep 7, 2008
Messages
320
If the spell is intended for only that particular map, it is still considered as spell and sure working, just you can't import it correctly because you have to pre-set a region for yourselves in your own game.

Also, maybe he has his own agenda, when someone cast this ability on that particular region, the owner will get this special unit namely Crypt custom and only in that region while other unit cast this ability outside the region, gets nothing.

His problem is here
Owner of (Casting unit)
There is not such thing called "Casting unit" after you remove it :ogre_icwydt:
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
interesting script but it isnt what i need. basal golems transform into a building selected from a build menu. the building appear on that menu when the basal golem enters a certain region.(called foundation.)then the basal golem that moves near that building gets units on its build menu that it can transform into based on what building occupies the nearby foundation. i have managed to get that part working though but when i click on any of the spells that creates the building it always selects transform into temple. all spells are based on destroyer form.
 
interesting script but it isnt what i need. basal golems transform into a building selected from a build menu. the building appear on that menu when the basal golem enters a certain region.(called foundation.)then the basal golem that moves near that building gets units on its build menu that it can transform into based on what building occupies the nearby foundation. i have managed to get that part working though but when i click on any of the spells that creates the building it always selects transform into temple. all spells are based on destroyer form.

This is the most detailed info about the spell that you wanted.
 
You can add this trigger then.
  • add ability
    • Events
      • Unit - A unit enters Region 000 <gen>
      • Unit - A unit enters Region 002 <gen>
      • Unit - A unit enters Region 003 <gen>
      • Unit - A unit enters Region 004 <gen>
      • Unit - A unit enters Region 005 <gen>
      • Unit - A unit enters Region 006 <gen>
      • Unit - A unit enters Region 007 <gen>
      • Unit - A unit enters Region 008 <gen>
      • Unit - A unit enters Region 009 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to <your unit of type>
    • Actions
      • Set CC_ConstructionOnSitePos = (Position of (Triggering unit))
      • Set CC_NewBuilding = (Units within 200.00 of CC_ConstructionOnSitePos matching (((Matching unit) is A structure) Equal to True))
      • Unit Group - Pick every unit in CC_NewBuilding and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Region centered at CC_ConstructionOnSitePos with size (500.00, 500.00)) contains (Picked unit)) Equal to True
            • Then - Actions
              • Unit - Add Construct Crypt to (Triggering unit)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_CC_NewBuilding)
      • Custom script: call RemoveLocation(udg_CC_ConstructionOnSitePos)
 
Status
Not open for further replies.
Top