• 🏆 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] This should be simple... but why doesn't it function?!?

Status
Not open for further replies.
Level 10
Joined
Aug 15, 2008
Messages
448
Hello everyone, here's the situation: I've made a structure that can call an Ion cannon attack. The ion cannon beam can be moved, so I want the player to automatically select it once it appears. Here's the trigger:
  • Ion cannon selection
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unit type of (Entering unit)) equals Ion cannon beam
    • Actions
      • Wait 0.25 seconds
      • Selection - Select (Entering unit) for (Owner of (Entering unit))
The problem is: once the structures casts the ability, the ion cannon beam appears ingame but nothing happens... the beam isn't selected. So, what should I do?

[EDIT]
I also tried with a debug message and, when the beam appears ingame, it gives me a proper message, but the beam isn't selected yet. I also tried to store the beam owner as a variable, but it didn't function. Here is what I've done to the actions:
  • Actions
    • Wait 0.25 seconds
    • Set IonCannonBeamOwner = (Owner of (Entering unit))
    • Selection - Select (Entering unit) for IonCannonBeamOwner
    • Game - Display for (All players) for 1.00 seconds the text: THE BEAM SHOULD BE SELECTED NOW
[EDIT]
By the way, I forgot to say that when the beam appears, my selection gets cleared, so I deselect the Ion cannon building... but the beam isn't selected yet... T_T
 
Last edited:
Level 3
Joined
Jul 6, 2008
Messages
42
Well , the trigger should be okay ...

but try put
  • Set IonCannonBeamOwner = (Owner of (Entering unit))
above
  • Wait 0.25 seconds
and also , I don't think
  • Wait 0.25 seconds
is needed .

And , I not very clear about the situation .
structure that can call an Ion cannon attack?
Is that mean it train a unit?
or just active a "spell" to order the Ion cannon attack?
or summon it and attack target?

And also note that , dummy unit (unit with locust ability) cannot be selected.
 
Level 10
Joined
Aug 15, 2008
Messages
448
The structure uses a custom ability based on the Inferno one. I added a Wait action because there is some delay before the beam actually appears (it has a birth animation). I also tried to remove the Wait event, but nothing happened.

[EDIT]
I forgot to say that the beam hasn't got the Locust ability but it has an immolation ability.
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Not being mui, this could be, what you want
  • Partikelkanone
    • Events
      • Unit - A Unit starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to ION BEAM
    • Actions
      • Set ion_point = (Target point of ability being cast)
      • Set ion_cannon_caster_point = (Position of (Triggering Unit))
      • Special Effect - Create a special effect at ion_cannon_caster_point using war3mapImported\IonCannonBeam.mdx
      • Set ion_effect = (Last created special effect)
      • Wait 0.50 seconds
      • Unit - Create 1 Ion Beam for (Owner of (Triggering unit)) at ion_point facing default building degrees degrees
      • Unit - Add a 10.00 second Standard expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_ion_punkt)
      • Custom script: call RemoveLocation(udg_ion_cannon_caster_punkt)
      • Selection - Select (Last created unit) for (Owner of (Triggering unit))
      • Wait 9.50 seconds
      • Special Effect - Destroy ion_effekt
That makes the ionbeam last 10 seconds
 
Level 10
Joined
Aug 15, 2008
Messages
448
Not being mui, this could be, what you want
  • Partikelkanone
    • Events
      • Unit - A Unit starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to ION BEAM
    • Actions
      • Set ion_point = (Target point of ability being cast)
      • Set ion_cannon_caster_point = (Position of (Triggering Unit))
      • Special Effect - Create a special effect at ion_cannon_caster_point using war3mapImported\IonCannonBeam.mdx
      • Set ion_effect = (Last created special effect)
      • Wait 0.50 seconds
      • Unit - Create 1 Ion Beam for (Owner of (Triggering unit)) at ion_point facing default building degrees degrees
      • Unit - Add a 10.00 second Standard expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_ion_punkt)
      • Custom script: call RemoveLocation(udg_ion_cannon_caster_punkt)
      • Selection - Select (Last created unit) for (Owner of (Triggering unit))
      • Wait 9.50 seconds
      • Special Effect - Destroy ion_effekt
That makes the ionbeam last 10 seconds

Mmh, your trigger might work, but doesn't it go crazy if another player uses an Ion cannon attack? Up to 4 players can actually use it. I'd like to use only generic triggers that apply to every player without making a trigger for every player; however, if there's no other way, I'll use it.

[EDIT]
I re-edited my trigger and it seems to work fine; I think that it would be ok if more than one player fire with the ion cannon when there's already one. However, here's the trigger:

  • Ion cannon selection
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unit type of (Entering unit)) equals Ion cannon beam
    • Actions
      • Wait 0.25 seconds
      • Set IonCannonBeamOwner = (Owner of (Entering unit))
      • Unit - Remove (Entering unit) from the game
      • Unit - Create 1 Ion cannon beam 2 for (Owner of (Entering unit)) ai (Position of (Entering unit)) facing (Facing of (Entering unit)) degrees
      • Unit - add a 20.00 seconds Generic expiration timer to (Last created unit)
      • Animation - Play (Last created unit)'s Birth animation
      • Selection - Select (Last created unit) for IonCannonBeamOwner
 
Last edited:
Level 9
Joined
May 27, 2006
Messages
498
Just use Triggering unit instead of Entering unit... ;| No need for using variables, the trigger in first post is good, just change the values.

Other unit-referring actions than Triggering unit are reset back to null after any wait action.
In most cases Triggering unit is the unit entering, caster, attacking, contructing, taking order, etc... And it doesnt leak so much + its partially 'MUI' afaik.
 
Level 10
Joined
Aug 15, 2008
Messages
448
Nice spell, but it's not the kind I'm looking for =D.
My spell must create a continuous ion beam that damages every nearby unit and that can be moved, like the USA particle cannon in Command & Conquer: Generals: it's almost the same ;).

[EDIT]
However, the trigger I'm using now is fully functional, maybe just a bit leaking (I haven't tested it online).
 
Level 9
Joined
May 27, 2006
Messages
498
MUI stands for Multi Unit Instanceable, meaning many units can cast the spell at the same time and wont screw it up. Its usually achieved by using locals in jass. It is also possible in GUI, but its 'a bit' harder.

@Up
He means, that if you remove the wait, the trigger wont bug when 10 players at once will use the spell. And by the way, i dont understand why you placed that wait in there...

I tried to change the (entering unit) with (triggering unit) but it didn't give any result...

You probably switched only the ... Select (Entering unit) ... to triggering unit, leaving the other parts of the action unchanged... You have to change EVERY entering unit, otherwise it wont work. If you have triggering unit placed everywhere, but the trigger still doesnt work, then you screwed something up...
 
Level 9
Joined
May 27, 2006
Messages
498
Hax ; o Try deleting that trigger and making a new one. I read it somewhere posted by Poot or someone else, sayed it should help... :p

Well, the (much) more plausible reason is that this certain type of action (Select) is kinda buggy and doesnt work with a wait action after which its referring to the unit stated in the events.
 
Level 10
Joined
Aug 15, 2008
Messages
448
Well, I actually made another trigger, deactivating my first one... so you may be correct about the buggy trigger.

If you want to check my triggers in my map (and get a better overview of what I did about this trigger), go here: http://www.hiveworkshop.com/forums/f202/battlemasters-beta-testing-96697/ (map is v0.41BETA and the Ion cannon trigger still has some errors, but I updated it in the map in my computer ;)).
 
Status
Not open for further replies.
Top