• 🏆 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!

[Trigger] Unit wont create

Status
Not open for further replies.
Level 5
Joined
Jan 29, 2009
Messages
92
  • Hero Pick
    • Events
      • Unit - Paladin (Dummy) 0016 <gen> Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Pick Hero
    • Actions
      • Unit - Create 1 Paladin for (Triggering player) at (Center of Spawn[(Player number of (Triggering player))]) facing Default building facing degrees
      • Unit - Remove (Triggering unit) from the game
the hero is owned by neutral passive. why doesn't the unit get created when i use the ability?
 
  • Hero Pick
    • Events
      • Unit - Paladin (Dummy) 0016 <gen> Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Pick Hero
    • Actions
      • Unit - Create 1 Paladin for (Triggering player) at (Center of Spawn[(Player number of (Triggering player))]) facing Default building facing degrees
      • Unit - Remove (Triggering unit) from the game
the hero is owned by neutral passive. why doesn't the unit get created when i use the ability?

because there is no triggering player... its a unit event... use Owner of Triggering Unit...
 
Level 13
Joined
Mar 24, 2010
Messages
950
There its fixed where there is cap locks on. :)

  • Hero Pick
    • Events
      • Unit - Paladin (Dummy) 0016 <gen> Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to ABILITY NAME??
    • Actions
      • Unit - Create 1 Paladin for (OWNER OF Triggering UNIT) at (Center of Spawn[(Player number of (OWNER OF Triggering UNIT))]) facing Default building facing degrees
      • Unit - Remove (Triggering unit) from the game
 
Level 5
Joined
Jan 29, 2009
Messages
92
as i said in the first post, the unit is owned by neutral. passive. but even when i change it to owner of unit, the unit is removed, but none is created

EDIT: so using triggering player creates the unit for neutral passive. but owner of unit doesnt create anything
 
as i said in the first post, the unit is owned by neutral. passive. but even when i change it to owner of unit, the unit is removed, but none is created

EDIT: so using triggering player creates the unit for neutral passive. but owner of unit doesnt create anything

now you're confusing me... I thought at first the unit is not created but you're saying that it is created for neutral passive?

so the paladin is like a dummy selector that a player uses to pick his hero? you cannot do it using abilities (at least for multiplayer)...

the thing to do is rather than using an ability make it a shop type unit... and make the hero pick an item that is perishable and used on pick up... and make the dummy paladin sell that item and then use the event a unit sells an item...

  • Events
    • Unit - a unit sells an item
  • Conditions
    • Unit -Type of TriggeringUnit equals to PaladinDummy
    • Item -Type of SoldItem is equal to HeroPick
  • Actions
    • Unit - Create 1 Paladin for OwnerOfBuyingUnit blahblah
    • blahblaahblah
 
would you, please?

This uses some variables... and uses the real hero units rather than dummies...

Note: If you select the event Player - Player 1 selects a unit it says that use TriggeringUnit to get the unit selected...

This also uses the event Player - Cinematic Skipped (you can still use this event on other triggers though since we'll be using a boolean check anyway)

Variables:
HeroPick = a unit array
HasPicked = boolean array

First Set (Allows hero to be picked more than once)

  • Events
    • Player - Player 1 selects a unit
    • Add other players here
  • Conditions
    • Or - Multiple conditions
      • Unit-type of TriggeringUnit equals to Paladin
      • Add all heroes here
  • Actions
    • Set HeroPick[PlayerNumberOfTriggeringPlayer] = TriggeringUnit
  • Events
    • Player - Player 1 Skips a cinematic
    • Add other players here
  • Conditions
    • HasPicked[PlayerNumberOfTriggeringPlayer] is equal to false
  • Actions
    • Unit - Create 1 UnitTypeOfHeroPick[PlayerNumberOfTriggeringPlayer] for triggering player blahblah
    • Set HasPicked[PlayerNumberOfTriggeringPlayer] = true



First Set (does not Allow hero to be picked more than once)
Uses another variable:
HeroWasPicked = boolean array
Also uses custom values



  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Custom Value of Paladin XXXX<gen> to 0
    • Set other heroes here and be sure to set it to different numbers
  • Events
    • Player - Player 1 selects a unit
    • Add other players here
  • Conditions
    • Or - Multiple conditions
      • Unit-type of TriggeringUnit equals to Paladin
      • Add all heroes here
  • Actions
    • Set HeroPick[PlayerNumberOfTriggeringPlayer] = TriggeringUnit
  • Events
    • Player - Player 1 Skips a cinematic
    • Add other players here
  • Conditions
    • HasPicked[PlayerNumberOfTriggeringPlayer] is equal to false
    • HeroWasPicked[CustomValueOfHeroPick[PlayerNumberOfTriggeringPlayer]] equal to false
  • Actions
    • Unit - Create 1 UnitTypeOfHeroPick[PlayerNumberOfTriggeringPlayer] for triggering player blahblah
    • Set HasPicked[PlayerNumberOfTriggeringPlayer] = true
    • Set HeroWasPicked[CustomValueOfHeroPick[PlayerNumberOfTriggeringPlayer]] = true


Here is another version of the picking trigger
  • Events
    • Player - Player 1 selects a unit
    • Add other players here
  • Conditions
    • Or - Multiple conditions
      • TriggeringUnit equals to Paladin XXXX <gen>
      • Add all heroes here
  • Actions
    • Set HeroPick[PlayerNumberOfTriggeringPlayer] = TriggeringUnit
 
Level 11
Joined
Sep 12, 2008
Messages
657
1 thing.
obiously, they can pick more then 1 unit.
do this:

event - a unit starts the effect of an ability
condition - ability behing cast is blah blah
action - create unit type of(triggering unit()) at spawn(player number of owner of triggering
unit()) facing default
action - remove triggering unit
 
1 thing.
obiously, they can pick more then 1 unit.
do this:

event - a unit starts the effect of an ability
condition - ability behing cast is blah blah
action - create unit type of(triggering unit()) at spawn(player number of owner of triggering
unit()) facing default
action - remove triggering unit

it doesnt work because it would always be the neutral passive since the dummy unit is owned by neutral passive and is just shared control... so no matter who clicks the ability, owner will always be neutral passive...

which is why I told him to items or the triggers I posted...
 
Level 5
Joined
Jan 29, 2009
Messages
92
ok it works. these are the triggers ive found to work:

  • Events
    • Map initialization
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Set HasPicked[(Integer A)] = False
  • Events
    • Player - Player 1 (Red) Selects a unit
    • Player - Player 2 (Blue) Selects a unit
    • Player - Player 3 (Teal) Selects a unit
    • Player - Player 4 (Purple) Selects a unit
    • Player - Player 5 (Yellow) Selects a unit
    • Player - Player 6 (Orange) Selects a unit
  • Conditions
    • HasPicked[(Player number of (Triggering player))] Equal to False
  • Actions
    • Set PickingHero[(Player number of (Triggering player))] = (Triggering unit)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Triggering unit) Equal to Paladin (Dummy) 0016 <gen>
      • Then - Actions
        • Set HeroPick[(Player number of (Triggering player))] = Paladin
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Triggering unit) Equal to Archmage (Dummy) 0017 <gen>
      • Then - Actions
        • Set HeroPick[(Player number of (Triggering player))] = Archmage
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Triggering unit) Equal to Mountain King (Dummy) 0018 <gen>
      • Then - Actions
        • Set HeroPick[(Player number of (Triggering player))] = Mountain King
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Triggering unit) Equal to Blood Mage (Dummy) 0019 <gen>
      • Then - Actions
        • Set HeroPick[(Player number of (Triggering player))] = Blood Mage
      • Else - Actions
  • Events
    • Player - Player 7 (Green) Selects a unit
    • Player - Player 8 (Pink) Selects a unit
    • Player - Player 9 (Gray) Selects a unit
    • Player - Player 10 (Light Blue) Selects a unit
    • Player - Player 11 (Dark Green) Selects a unit
    • Player - Player 12 (Brown) Selects a unit
  • Conditions
    • HasPicked[(Player number of (Triggering player))] Equal to False
  • Actions
    • Set PickingHero[(Player number of (Triggering player))] = (Triggering unit)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Triggering unit) Equal to Paladin (Dummy) 0020 <gen>
      • Then - Actions
        • Set HeroPick[(Player number of (Triggering player))] = Paladin
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Triggering unit) Equal to Archmage (Dummy) 0021 <gen>
      • Then - Actions
        • Set HeroPick[(Player number of (Triggering player))] = Archmage
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Triggering unit) Equal to Mountain King (Dummy) 0022 <gen>
      • Then - Actions
        • Set HeroPick[(Player number of (Triggering player))] = Mountain King
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Triggering unit) Equal to Blood Mage (Dummy) 0023 <gen>
      • Then - Actions
        • Set HeroPick[(Player number of (Triggering player))] = Blood Mage
      • Else - Actions
  • Events
    • Player - Player 1 (Red) skips a cinematic sequence
    • Player - Player 2 (Blue) skips a cinematic sequence
    • Player - Player 3 (Teal) skips a cinematic sequence
    • Player - Player 4 (Purple) skips a cinematic sequence
    • Player - Player 5 (Yellow) skips a cinematic sequence
    • Player - Player 6 (Orange) skips a cinematic sequence
    • Player - Player 7 (Green) skips a cinematic sequence
    • Player - Player 8 (Pink) skips a cinematic sequence
    • Player - Player 9 (Gray) skips a cinematic sequence
    • Player - Player 10 (Light Blue) skips a cinematic sequence
    • Player - Player 11 (Dark Green) skips a cinematic sequence
    • Player - Player 12 (Brown) skips a cinematic sequence
  • Conditions
    • HasPicked[(Player number of (Triggering player))] Equal to False
  • Actions
    • Unit - Create 1 HeroPick[(Player number of (Triggering player))] for (Triggering player) at (Center of Spawn[(Player number of (Triggering player))]) facing Default building facing degrees
    • Unit - Remove PickingHero[(Player number of (Triggering player))] from the game
    • Set HasPicked[(Player number of (Triggering player))] = True
 
yeah. they have previews of the abilities

oh... but you can use the normal heroes(though would require some more code to add abilities so I guess this one is fine)

but why do you use different sets of dummies? the factions have different selection areas? If yes, I think that's kinda unnecessary...
 
Level 5
Joined
Jan 29, 2009
Messages
92
yes. but i want it so that each team can have any of the heros. meaning both sides can have the same heros if the people want
 
Level 11
Joined
Sep 12, 2008
Messages
657
or.. GetLocalPlayer give unit to a player?
isnt that 100% smarter?
X heroes, 1 ability.
doesnt matter how many heroes
all share 1 ability,
just change owning player of the unit in GetLocalPlayer,
and you'r set..
if that crush game,
create each unit for another player using the getlocal,
i've done it allready, and it works.
 
or.. GetLocalPlayer give unit to a player?
isnt that 100% smarter?
X heroes, 1 ability.
doesnt matter how many heroes
all share 1 ability,
just change owning player of the unit in GetLocalPlayer,
and you'r set..
if that crush game,
create each unit for another player using the getlocal,
i've done it allready, and it works.

IDK if he wants JASS... ^^ there is no getlocalplayer in GUI right?

anyway, he's already made a working trigger...

@Kahiera - you dont really need the init trigger, just set the array size to at least 12 in the variable editor and set default value to false...

and in your trigger, a hero can be picked by a team more than once if all of them clicked that hero and pressed ESC... you can look at the second set I gave you which does not allow a hero to be picked more than once (and since you use different dummies for each team, you can still allow each team to have same heroes)...
 
Last edited:
Level 5
Joined
Jan 29, 2009
Messages
92
does this fix it?

  • Events
    • Player - Player 1 (Red) skips a cinematic sequence
    • Player - Player 2 (Blue) skips a cinematic sequence
    • Player - Player 3 (Teal) skips a cinematic sequence
    • Player - Player 4 (Purple) skips a cinematic sequence
    • Player - Player 5 (Yellow) skips a cinematic sequence
    • Player - Player 6 (Orange) skips a cinematic sequence
    • Player - Player 7 (Green) skips a cinematic sequence
    • Player - Player 8 (Pink) skips a cinematic sequence
    • Player - Player 9 (Gray) skips a cinematic sequence
    • Player - Player 10 (Light Blue) skips a cinematic sequence
    • Player - Player 11 (Dark Green) skips a cinematic sequence
    • Player - Player 12 (Brown) skips a cinematic sequence
  • Conditions
    • HasPicked[(Player number of (Triggering player))] Equal to False
    • (PickingHero[(Player number of (Triggering player))] is alive) Equal to True
  • Actions
    • Unit - Create 1 HeroPick[(Player number of (Triggering player))] for (Triggering player) at (Center of Spawn[(Player number of (Triggering player))]) facing Default building facing degrees
    • Unit - Kill PickingHero[(Player number of (Triggering player))]
    • Set HasPicked[(Player number of (Triggering player))] = True
 
how would i test it on single player?

ahh... you can try to make a test trigger

  • Events
    • Player - Player 1 types -testpick
  • Actions
    • For Each Integer A from 1-12 Do Actions
      • Actions
        • Set PickingHero[IntegerA] = Paladin dummy<>
        • Set HeroPick[IntegerA] = Paladin
  • Events
    • Player - Player 1 types -testselect as a substring
  • Conditions
    • HasPicked[Substring(EnteredChatString, 13,14 )] Equal to False
    • (PickingHero[Substring(EnteredChatString, 13,14 )] is alive) Equal to True
  • Actions
    • Unit - Create 1 HeroPick[Substring(EnteredChatString, 13,14 )] for (Triggering player) at (Center of Spawn[Substring(EnteredChatString, 13,14 )]) facing Default building facing degrees
    • Unit - Kill PickingHero[Substring(EnteredChatString, 13,14 )]
    • Set HasPicked[Substring(EnteredChatString, 13,14 )] = True
it uses 13,14 since -testselect is 11 characters long... to test just type -testselect XX where XX is from 1-12
 
Status
Not open for further replies.
Top