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

Change appearance of a unit during game

Status
Not open for further replies.
Level 19
Joined
Apr 21, 2013
Messages
1,194
Hey everyone, i was wondering if i could change the unit's appearance during the gameplay.

The question is, every player chooses a weapon and im not that good with attachments and instead of that i want to change the unit's whole model with a trigger if thats possible.

For example; i choose sword as my weapon
Simple villager ---> Swordsman
A transformation i mean, just the model though

Any help is appreaciated :)
 
Level 24
Joined
Jul 9, 2009
Messages
4,097
  • Untitled Trigger 001
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Potion of Your Item
    • Actions
      • Set Point = (Position of (Hero manipulating item))
      • Unit - Remove (Hero manipulating item) from the game
      • Unit - Create 1 Your Unit for Player X at (Center of (Point)) facing Default building facing degrees
 
Last edited:
Level 19
Joined
Apr 21, 2013
Messages
1,194
  • Untitled Trigger 001
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Potion of Your Item
    • Actions
      • Set Point = (Position of (Hero manipulating item))
      • Unit - Remove (Hero manipulating item) from the game
      • Unit - Create 1 Your Unit for Player X at (Center of (Your area)) facing Default building facing degrees

it would be great if i didnt have to remove the first unit from the game :(
 
Level 6
Joined
Nov 5, 2013
Messages
132
  • Untitled Trigger 001
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Potion of Your Item
    • Actions
      • Set Point = (Position of (Hero manipulating item))
      • Unit - Remove (Hero manipulating item) from the game
      • Unit - Create 1 Your Unit for Player X at (Center of (Your area)) facing Default building facing degrees

This works if he uses the item so i think you may be change the event to Acquires item, and why you put Your Area in the position to create the unit, you have set the Point variable to this?

Finaly this work perfectly but you need correct it to futures noobs seeing it :D

Oh and you need save the unit in some var to use it if he drop or lost the item.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Level 19
Joined
Apr 21, 2013
Messages
1,194
morphing is a good idea but in my map its not that efficient i guess, because there should be 5 different morphing spells(spearman, swordsman, crossbowman, archer and axeman) i dont wanna create so much triggers for just a spell that the player would use once(because there is no turning back once you choose your class).


The easiest method, imo, is that he just changes the attachment :x

im trying to apply attachments to the unit i got a problem in that too.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Actions
    • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using war3mapImported\Log.mdx
when i use this trigger the unit just disappears :S
whats wrong with this?
PS: dont mind the condition for the trigger its done in the map.



EDIT: okay i got rid of the problem but the problem now is 'How can i change the unit's attack animation?' the unit is attacking with bare hands while he has a spear in hand :D
 
Last edited:
Level 8
Joined
Sep 7, 2008
Messages
320
morphing is a good idea but in my map its not that efficient i guess, because there should be 5 different morphing spells(spearman, swordsman, crossbowman, archer and axeman) i dont wanna create so much triggers for just a spell that the player would use once(because there is no turning back once you choose your class).




im trying to apply attachments to the unit i got a problem in that too.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Actions
    • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using war3mapImported\Log.mdx
when i use this trigger the unit just disappears :S
whats wrong with this?
PS: dont mind the condition for the trigger its done in the map.



EDIT: okay i got rid of the problem but the problem now is 'How can i change the unit's attack animation?' the unit is attacking with bare hands while he has a spear in hand :D

Run animation when unit attack
 
Level 19
Joined
Apr 21, 2013
Messages
1,194
okay i used this as my animation chooser but the villager still uses some previous attacks too not from the list down here

  • Events
    • Unit - A unit Is attacked
  • Conditions
    • (Unit-type of (Attacking unit)) Equal to Simple Adventurer
    • (Item-type of (Item carried by (Attacking unit) of type Spear)) Equal to Spear
  • Actions
    • Set animAttack = (Random integer number between 0 and 11)
    • If (animAttack Equal to 1) then do (Custom script: call SetUnitAnimationByIndex(GetAttacker(), 15)) else do (Do nothing)
    • If (animAttack Equal to 2) then do (Custom script: call SetUnitAnimationByIndex(GetAttacker(), 16)) else do (Do nothing)
    • If (animAttack Equal to 3) then do (Custom script: call SetUnitAnimationByIndex(GetAttacker(), 19)) else do (Do nothing)
    • If (animAttack Equal to 4) then do (Custom script: call SetUnitAnimationByIndex(GetAttacker(), 20)) else do (Do nothing)
    • If (animAttack Equal to 5) then do (Custom script: call SetUnitAnimationByIndex(GetAttacker(), 21)) else do (Do nothing)
    • If (animAttack Equal to 6) then do (Custom script: call SetUnitAnimationByIndex(GetAttacker(), 22)) else do (Do nothing)
    • If (animAttack Equal to 7) then do (Custom script: call SetUnitAnimationByIndex(GetAttacker(), 24)) else do (Do nothing)
    • If (animAttack Equal to 8) then do (Custom script: call SetUnitAnimationByIndex(GetAttacker(), 26)) else do (Do nothing)
    • If (animAttack Equal to 9) then do (Custom script: call SetUnitAnimationByIndex(GetAttacker(), 28)) else do (Do nothing)
    • If (animAttack Equal to 10) then do (Custom script: call SetUnitAnimationByIndex(GetAttacker(), 29)) else do (Do nothing)
 
Level 3
Joined
Mar 31, 2013
Messages
47
You could try using that upgrade ability which trolls have, "Berserking" or something like that.
 
Status
Not open for further replies.
Top