• 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.

[Noob Alert] Help

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
How to use triggers to place a weapon on a model? Like, is there a snippet of code i could look at, or a guide?
Attaching weapons requires a unit to use an appropriate weapon-less model and for you to import stand alone weapon models for attaching. You then use the special effect creation native that creates a special effect at the specified attachment point (usually a hand one for attachment orientated models). There is a GUI action to do this as show by TriggerHappy.

Do remember to save the special effect to a variable so it can be destroyed at a later time to prevent leaks. If the unit is removed by any means (decay or triggers) I am not sure it will remove the generated attachment effect in a leak-less way automatically. You may need triggers to handle such cases.
 
Status
Not open for further replies.
Top