• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Problems with triggers(first time trigger)

Status
Not open for further replies.
Level 1
Joined
Dec 17, 2010
Messages
5
Hi,

ive got this trigger, but in the test it doesnot work.(i tried with lvl set but it also failed.
I need it to test my map(DBZ).

  • cheat
    • Ereignisse
      • Spieler - Spieler 1 (Rot) types a chat message containing up as Exakte Übereinstimmung
    • Bedingungen
    • Aktionen
      • Held - Add 1000000 experience to (Triggering unit), Verbergen level-up graphics
The other trigger is a transformation:
  • Ereignisse
    • Spieler - Spieler 1 (Rot) types a chat message containing ssj as Exakte Übereinstimmung
  • Bedingungen
    • (Hero level of (Triggering unit)) Größer gleich 10
  • Aktionen
  • Spiel - Display to TempPlayerGroup the text: ( |cffFF0000Bonus attributes |cffFFFF00 + (String(BunusTransformation[(Player number of (Triggering player))])))
But it also doesnt work.
May be the Heros have problems?
i use Dragonball Models.
 
Level 13
Joined
Jun 1, 2008
Messages
360
(Triggering unit) refers to an event which you aren't using.

You have to either directly select a unit from the map or store the hero in a variable when he enters the map (is created).
To do so make a second trigger:
event: Unit - Unit enters (Playable map area)
condition: Unit-Type of (Triggering unit) equal to [your hero unit type]
action: set Hero = (Triggering unit)

Note that now (Triggering unit) refers to the unit entering the map.
Hero is a variable of type 'Unit'.

Now you can use the variable Hero instead of (Triggering unit) in your first trigger.
 
Level 1
Joined
Dec 17, 2010
Messages
5
Thanks for the fast answer.
Here ist the Trigger:

  • enter
    • Ereignisse
      • Einheit - A unit enters (Playable map area)
    • Bedingungen
      • ((Unit-type of (Triggering unit)) is Ein Held) Gleich True
    • Aktionen
      • Set Hero = (Triggering unit)
May be i missed to say that i use a Taverne and may be of this it doesnt work?
(Because it doesnt work ...)

edit:
my fault it works!
I have to use in the "cheat" the variable ;)
 
Level 1
Joined
Dec 17, 2010
Messages
5
Ok, my next Question i want to realize a transformation.
How can i switch a character or change the model?
One of the two i need.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
To change model:
Simply go to Object Editor -> Select any unit -> Find "Art - Model File" in the field -> Select any unit you like -> DONE !

To switch/transform character in-game:
Create a new Custom Unit (new model) in the Object Editor then:
  • Unit - Replace *WantToTransformUnit* with a *TransformedUnit* using The old unit's relative life and mana
This is a permanent transform/switch

If you want for a temporary, do this:
  • Actions
    • Unit - Hide *WantToTransformUnit*
    • Set HideUnit = (Position of *WantToTransformUnit*)
    • Unit - Create 1 *TransformedUnit* for Owner of *WantToTransformUnit* at HideUnit facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_HideUnit)
To make it appear again, just:
  • Actions
    • Set TransformedUnit = (Position of *TransformedUnit*)
    • Unit - Move *WantToTransformUnit* instantly to TransformedUnit
    • Unit - Remove *TransformedUnit* from the game
    • Unit - Unhide *WantToTransformUnit*
    • Custom script: call RemoveLocation(udg_TransformedUnit)
It's all about tricks =D
 
Level 1
Joined
Dec 17, 2010
Messages
5
ok thx it works.
But another problem:
How can i fix the abilites?
i dont want that the player has to select new abilities, because they are almost the same.(only one or 2 different)
 
Level 4
Joined
Jul 30, 2010
Messages
57
To change model:
Simply go to Object Editor -> Select any unit -> Find "Art - Model File" in the field -> Select any unit you like -> DONE !

To switch/transform character in-game:
Create a new Custom Unit (new model) in the Object Editor then:
  • Unit - Replace *WantToTransformUnit* with a *TransformedUnit* using The old unit's relative life and mana
This is a permanent transform/switch

If you want for a temporary, do this:
  • Actions
    • Unit - Hide *WantToTransformUnit*
    • Set HideUnit = (Position of *WantToTransformUnit*)
    • Unit - Create 1 *TransformedUnit* for Owner of *WantToTransformUnit* at HideUnit facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_HideUnit)
To make it appear again, just:
  • Actions
    • Set TransformedUnit = (Position of *TransformedUnit*)
    • Unit - Move *WantToTransformUnit* instantly to TransformedUnit
    • Unit - Remove *TransformedUnit* from the game
    • Unit - Unhide *WantToTransformUnit*
    • Custom script: call RemoveLocation(udg_TransformedUnit)
It's all about tricks =D

just completting the deskfull's answer you must set the Xp of the unit if it is a hero of course.
  • Actions
    • Unit - Hide *WantToTransformUnit*
    • Set HideUnit = (Position of *WantToTransformUnit*)
    • Unit - Create 1 *TransformedUnit* for Owner of *WantToTransformUnit* at HideUnit facing Default building facing degrees
  • Hero - Set (TransformedUnit) experience to (Hero experience of (WantToTransformUnit)), Hide level-up graphics
    • Custom script: call RemoveLocation(udg_HideUnit)
  • Actions
    • Set TransformedUnit = (Position of *TransformedUnit*)
    • Unit - Move *WantToTransformUnit* instantly to TransformedUnit
    • Hero - Set (WantToTransformUnit) experience to (Hero experience of (TransformedUnit)), Hide level-up graphics
    • Unit - Remove *TransformedUnit* from the game
    • Unit - Unhide *WantToTransformUnit*
    • Custom script: call RemoveLocation(udg_TransformedUnit)
 
Status
Not open for further replies.
Top