• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

skill

Status
Not open for further replies.
Level 5
Joined
Jul 17, 2013
Messages
90
how to make a skill which charges with items I mean.. I want to make a marine with an amunition clips skill which charges by clicking on founding amunition items. For Example the skill limit will be 15 on lvl 1 and 30 on lvl 3 after amunition ends you cant shoot. and a second question how can I make units who cant move?
 
Level 18
Joined
May 11, 2012
Messages
2,103
Use integers to keep track of amunition. When your unit attacks, do integer -1, and check if it's 0. If it is, order it to stop attack.
Make an Int[] (array) and set Int[1] (Level 1) = 15, Int[3] (Level 3) = 30 etc..
Units can't move if their movespeed is set to 0, so there you go for unmovable units.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Use integers to keep track of amunition. When your unit attacks, do integer -1, and check if it's 0. If it is, order it to stop attack.
Make an Int[] (array) and set Int[1] (Level 1) = 15, Int[3] (Level 3) = 30 etc..
Units can't move if their movespeed is set to 0, so there you go for unmovable units.

Units can move if their movement speed is 0.

To stop them from moving you need to use this.
  • Set tempUnit = Triggering unit
  • Custom script: call SetUnitPropWindow( udg_tempUnit, 0.00)
The above will allow units to turn but will not allow them to move.
If you want to allow them to move again you need to get the prop window of the unit before setting it to 0 and store that in a variable.
Then you need to set the prop window of the unit to the value you have saved.
 
Level 18
Joined
May 11, 2012
Messages
2,103
Units can move if their movement speed is 0.

To stop them from moving you need to use this.
  • Set tempUnit = Triggering unit
  • Custom script: call SetUnitPropWindow( udg_tempUnit, 0.00)
The above will allow units to turn but will not allow them to move.
If you want to allow them to move again you need to get the prop window of the unit before setting it to 0 and store that in a variable.
Then you need to set the prop window of the unit to the value you have saved.

Thanks for correcting me.
 
Status
Not open for further replies.
Top