HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Attaching/Removing Weapons

03-28-2005, 02:49 PM#1
Das Jank
Ok first off there seems to be a little bug with my triggers, for some reason that wont remove the special effects on add to my units.

Code:
Special Effect - Create a special effect attached to the left hand of (Hero manipulating item) using war3mapImported\Hammer.mdx
Set WeaponAttached[(Player number of (Owner of (Hero manipulating item)))] = (Last created special effect)

I have this in the fist trigger so when a player picks up a weapon it creats the special effect and then set it to a Special Effect Variable array that is unique to the players number.

Code:
Special Effect - Destroy WeaponAttached[(Player number of (Owner of (Hero manipulating item)))]

In another trigger I then have this which should destroy the special effect but it doesnt. It is impossible for the hero to pick up 2 weapons and it check to see if he has a weapon already before it creats the special effect. What wrong here?


Also this is question is prob in the wrong forum but why are the special effect weapons so giant on my units? I made a Villager into a hero and when I give him a weapon special effect it is like 5x the size of him. Is there any way to make it more to the right size like the weapons in the Dark Lineage map?
03-28-2005, 03:32 PM#2
Hyarion
Heh. You're still using triggers for this? There's an ability called "sphere". Copy and modify that. Change the model from the bloodmage ball things to whatever weapon model you want, and change attatchment point to something like hand, right. Or something. As for the size, I think you'd need to edit the model.
03-28-2005, 08:44 PM#3
Raptor--
Quote:
Originally Posted by Hyarion
Heh. You're still using triggers for this? There's an ability called "sphere". Copy and modify that. Change the model from the bloodmage ball things to whatever weapon model you want, and change attatchment point to something like hand, right. Or something. As for the size, I think you'd need to edit the model.

triggers are far superior for that since you can create as many as you want with whatever paths and references you want and not have to create a million objects

i can attach 1000 different weapons to a unit by changing sAttachmentString and then running 1 trigger

anyways, that was off topic


the trigger that you stated will work for removing the special effect, its something else thats causing the problem
03-29-2005, 12:48 AM#4
Kahuna
Quote:
Originally Posted by Das Jank
Code:
Special Effect - Destroy WeaponAttached[(Player number of (Owner of (Hero manipulating item)))]

In another trigger I then have this which should destroy the special effect but it doesnt.



if i could see the entire trigger i would know exactly how to fix this but for now try this...
Code:
Special Effect - Destroy WeaponAttached[(Player number of (Triggering player))]
i think that you have the event for your trigger is wrong so this would help but if you show me the entire thing then i can defenetly fix it.


Quote:
Originally Posted by Das Jank
It is impossible for the hero to pick up 2 weapons and it check to see if he has a weapon already before it creats the special effect.


well not quite...

Code:
attach weapon
    Events
        Unit - Villager (Male) 0054 <gen> Acquires an item
    Conditions
        (Item-class of (Item being manipulated)) Equal to Artifact
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                __P1_Weapon_Set Equal to False
            Then - Actions
                Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
                Set __P1_Weapon_Set = True
            Else - Actions
                Do nothing

So this will work make all weapons Artifacts and create a boolean variable named P1_Weapon_Set default to false (or you could use an array instead of making a variable for each player but im in a hurry so thats up to you)

fires when set unit aquires an item. then it checks to make sure its an artifact (weapon)
then it checks in an if/then/else multiple actions to see if the variable is false
If it is then it creates the special effect and sets the variable to true
Else it dosent create the special effect but still lets the unit keep the item.

oh and when you have it destroy the effect when the unit drops the item make the variable = false so you can pick up another item and still have the effect (but you will not be able to have 2 items and drop one and keep the others special effect... so you might just want to make it so they can only have 1 weapon at a time.

Good luck on your map...
~Kahuna