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

Instantly remove attached models

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,658
Hi all.

I am making a dungeon map and I have a custom inventory system.
I can equip weapons and armor and they are also attached to the hero with a fittig model.

I also have abilities, basic attacks and other stuff that will require to have a specific weapon equipped.
For example: Heavy slam: Your next basic attack will knock the target back.
This must be done with a heavy weapon ofcourse (Greatsword, Battleaxe, Warhammer)
Also with a bow, wand or staff, you have ranged attacks.

Now I also want to let the player choose 2 sets of weapons of which they can switch during battle so they can use more abilities or change their range.

I do see that attached models (the weapons) stay on the unit for about 5 seconds... So I asked internet for a solution and as a good friend, he answered: Every single model that I use in my map must have a death animation... EVERY SINGLE MODEL!!!
First of all, I don't even know how to make an animation.
But secondly, it would take me more time to make the animations than to write all the code for the map again.

From another map, I know that when I replace a unit, it will have its attachments removed... however that unit will not be the old unit any more and all variables to that unit will be lost.

Does anyone know of a better workaround than this?
 
The only other option is to set SFX Death Time (in Advanced > Gameplay Constants) to 0 (or some low value), but this will ruin a lot of eye-candy.

A better solution to replacing the unit is to use Chaos to transform it. Using this method, any variables associated with it will remain. Use one version of Chaos to transform it to another unit, and then another version of Chaos to transform it into the correct unit. This might have some unwanted consequences, especially when it comes to heroes. Test thoroughly!
 
The "correct" approach here is to edit the models in question and give them a proper death animation.

Unfortunately, the Hive modelling section has no rule that enforces attachment models to have a stand and death animation.


But it's easy to do in Magos on your own and only takes a couple of seconds:

1) open the model in Magos
2) go to "sequence editor"
3) add a "stand" animation; set start frame to 0 and end frame to 100.
4) add a "death" animation, set start frame to 200 and end frame to 300. Set it to non-looping.
5) go to the material editor
6) edit the first material
7) on the "alpha" box, click on "animated"
8) set the interpolation type to linear
9) add the following lines:
Code:
0: 1
100: 1
200: 0
300: 0
10) repeat steps 6 to 9 for all materials
11) check out if the model properly disappears if you select the "death" sequence in the animation player

Save & Done.


If you insist not to go through the labor to fix all your models, there's a workaround, though:
Certain abilities that can attach an SFX to a unit (like the "sphere" ability) do not play the death animation when the ability is removed and remove the SFX instantly. You can use those abilities to apply and remove the effects instantly.
However, sphere comes with the drawback that the model disappears when the unit attacks.
But as you can see, you would need one ability for every single model you want to apply to your units. Not really an effective solution. Better fix your models instead!
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
I have fixed this problem with using the Sphere ability to add models.
When I remove the ability, the special effect is removed immediately.
The only thing is that I will get an ability for every single equipment item.
But I would do anything for the best quality.

(Will be a massive pre-load because I use so many objects and stuff.)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
Give the models a death animation that is practically instant. The problem is that destroying effects where the model used has no death animation results in the last iteration of the stand animation being played to completion. If a death animation is present it will interrupt the current stand animation with the death animation so if you make the death animation instant it will be removed instantly.

If only WC3 had the powerful actor system of SC2 as that allows you to specify when such effects are removed exactly.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
You mean something like "DestroyEffect()" (Play death animation) and "RemoveEffect()" (Completely remove the special effect)?
The way SC2 handles it is completely different, to such an extent you seldom need triggers for any visual effects. It has no idea of "effect", only "actors".

In WC3 as I mentioned you need custom animations as the response of effects is hard coded.
 
I have a map which is still beta which is similar to your project... I made my own equipment system which is GUI friendly but has much complicated triggers.. each item has an ability where the attachment is added.. But mine is when the item is clicked in your inventory, the item will be removed and will be seen to equipment dummy which will become an ability.. if that ability is clicked, the item will be created again in your hero's inventory.. I just want to share my idea...
 

Attachments

  • Battleground v1.0 (Prot).w3x
    4.4 MB · Views: 52
Level 24
Joined
Aug 1, 2013
Messages
4,658
Nice that you upload maps etc... but please if you want to show me how something works, then do not upload protected maps.

Also... that map is 1.0? As far as I can see... it is far from finished.
I can't move, noone tells me what to do, nothing is explained, etc.
Call it 1.0 when you release the map ;)

In any case, I have my own equipment and inventory system.
It is probably also a bit neater than yours:
vvOm42B.png

XnTFc6R.png
(Don't mind the minimap or the 0s in the stats.)

I also have basic attacks depend on your equipped items, abilities that require some items to be equipped to cast them, two different weapon slots and an ability to switch between those weapons in combat, etc, etc, etc.

When it is about concepts, ideas, design, etc... I can handle it myself.
When it comes to things that I have to know about WC3, then I need some help because I am new to modding and havent played WC3 a lot :D
 
Status
Not open for further replies.
Top