HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Rotating Unit 360degrees

04-11-2005, 02:22 AM#1
sweet5
how would I loop the rotating of a unit 360 degrees

in other words how do I make a unit rotate 360 degrees thru out the whole game?
04-11-2005, 03:23 AM#2
Zandose
I think this should do it. Though I haven't tested it.

Code:
Untitled Trigger 001
    Events
        Time - Every 0.50 seconds of game time
    Conditions
    Actions
        Unit - Move Peasant 0000 <gen> instantly to (Position of Peasant 0000 <gen>), facing ((Facing of Peasant 0000 <gen>) + 1.00) degrees
04-11-2005, 06:40 PM#3
sweet5
thx rep added
04-12-2005, 02:16 AM#4
Raptor--
don't forget to clean memory, periodicals like this are bad with that

Code:
Untitled Trigger 001
    Events
        Time - Every 0.50 seconds of game time
    Conditions
    Actions
        Custom Script: local location X
        Custom Script: set X = GetUnitLoc(gg_unit_hpea_0000) //Or whatever unit you choose
        Unit - Move Peasant 0000 <gen> instantly to (X), facing ((Facing of Peasant 0000 <gen>) + 1.00) degrees
        Custom Script: call RemoveLocation( X )
04-12-2005, 12:36 PM#5
Elven Ronin
Would using "make unit face angle" work better then "moving" the unit?
04-12-2005, 12:51 PM#6
Anitarf
Quote:
Originally Posted by Elven Ronin
Would using "make unit face angle" work better then "moving" the unit?
It probably would, depends on what you need it for. The main difference is that "make unit face angle" isn't instant, the unit actually turns over time, and it can only do that with it's max turn rate, so this action can't be used for fast turns. Also, while turning, a unit can't play animations other than stand, I think, so, for example, a swordsman quickly slashing in all directions around him would require instant moving in combination with playing attack animation with increased speed.