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

attaching an effect to an item?

Status
Not open for further replies.
Level 3
Joined
Dec 31, 2003
Messages
42
Hiya,

I was playing with the idea of attaching a special effect to an item using AddSpecialEffectTarget, since it allows any widget as target ... but I haven't been able to get it to work. I used one of the tome models and double-checked their attachment points. Has anyone else tried this? Is it possible? It would be nice to have a generic item model which rotates and glows; and you can attach weapons and what-not to.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
This is not possible in Warcraft III as you cannot attach special effects to items. You can only attach special effects to units or the ground terrain.

In StarCraft II you can do this trivially since items are units and attaching anything to anything else (even other attachments) is trivial thanks to the actor system.

To work around this in Warcraft III you will need to import a custom model for the item with the special effect already attached to it. You can then assigned your item's model to this imported model and it will appear to have the effect attached in game. If you want to dynamically attach the effect to the item model you will need two copies of the item, for both states, and then change between them with triggers as required.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
use distructable model
make it look like an item chest
add effect to model
set its life points to 1
make it neutral hostile and add to map

when you click on it your hero will attack and destroy it with 1 hit, appearing so like it was taken

use trigger to give item to hero when model of that type destroyed

solution ^^
 
Level 3
Joined
Dec 31, 2003
Messages
42
Woa, I wasn't expecting so many replies!

Moved to world editor helping zone.

Unlike units, items don't have an attach point for special effects.

I will try to clarify a bit because I think my question regards the wc3 engine if anything. What do you mean by items don't have attachment points? The models do. Or at the very least, the tome power ups (e.g. tomeBlue.mdx) have chest, origin and overhead which work when the model is used by a unit. Nothing happens for items though. An effect "can" be added with the native JASS function below but I guess it's not supported then?

Code:
native AddSpecialEffectTarget       takes string modelName, [i][b]widget targetWidget[/b][/i], string attachPointName returns effect

@The others: The destructible idea is cool. I'll mess around a bit with that for now
 
Level 3
Joined
Dec 31, 2003
Messages
42
specify different model for an item, any unit, to see if it's about item type or it's model. maybe chests have no attach points

Effects attach to units with the tome model but not items. I think there's definitely something going on here
 
Status
Not open for further replies.
Top