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

Face direction

Status
Not open for further replies.
Level 16
Joined
Dec 15, 2011
Messages
1,423
Actually, there is no way to set instant facing. A possible workaround used by dummy recycler systems here is storing dummies with different facing angles and when the system needs a new dummy for a particular angle, it will find a dummy with a current facing angle closest to the required value and adjust it accordingly. Thus you will have an (almost) instant facing.

There is also a SetUnitLookAt way but I am not really sure about the way it works.
 
Level 8
Joined
May 9, 2010
Messages
266
Actually, there is no way to set instant facing. A possible workaround used by dummy recycler systems here is storing dummies with different facing angles and when the system needs a new dummy for a particular angle, it will find a dummy with a current facing angle closest to the required value and adjust it accordingly. Thus you will have an (almost) instant facing.

There is also a SetUnitLookAt way but I am not really sure about the way it works.

hmm.. I`ll try this function. But can I also replace unit with required facing without recyclers?
Btw I want to make wall-bouncing units :D
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
hmm.. I`ll try this function. But can I also replace unit with required facing without recyclers?
Btw I want to make wall-bouncing units :D

You can't do so I am afraid. As said there is still this SetUnitLookAt method and you can experiment with this a bit and see if you can yield any notable results.

Off-topic: 1111th post :D Time to take a screenshot :>
 
You can use replace unit. That is a pretty nice method if you don't want to use systems.

However, you just have to be careful about things that are saved--items, stat mods, anything that is saved under their hashtable ID, etc.. Also note that there are some floating rumors about units and memory being left over ([sarcasm]shh don't tell anyone but you might have issues after 100,000 units were created and removed[/sarcasm]).

Creating units is also a pretty expensive operation, but since you are only doing it when they bounce on the walls, it shouldn't be that bad.

tl;dr if you can make it work with replacing units--then try it. It is a clean option visual wise, especially if you are dealing with actual units. If you are using dummies or effects that are bouncing, then you should resort to a dummy system for sure.
 
Level 8
Joined
May 9, 2010
Messages
266
You can't do so I am afraid. As said there is still this SetUnitLookAt method and you can experiment with this a bit and see if you can yield any notable results.

Off-topic: 1111th post :D Time to take a screenshot :>

congratulations :D
(trying to use function)
edit: could you tell me what arguments needs this function?:D
You can use replace unit. That is a pretty nice method if you don't want to use systems.

However, you just have to be careful about things that are saved--items, stat mods, anything that is saved under their hashtable ID, etc.. Also note that there are some floating rumors about units and memory being left over ([sarcasm]shh don't tell anyone but you might have issues after 100,000 units were created and removed[/sarcasm]).

Creating units is also a pretty expensive operation, but since you are only doing it when they bounce on the walls, it shouldn't be that bad.

tl;dr if you can make it work with replacing units--then try it. It is a clean option visual wise, especially if you are dealing with actual units. If you are using dummies or effects that are bouncing, then you should resort to a dummy system for sure.

My system made in hash-tables. And okey, I will be carefull with that. I have not expirience enough=)
 

Attachments

  • func.jpg
    func.jpg
    267.1 KB · Views: 88
Status
Not open for further replies.
Top