wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 04-06-2010, 04:24 PM   #1
MasterofSickness
User
 
MasterofSickness's Avatar
 
Join Date: Feb 2006
Posts: 218

MasterofSickness is on a distinguished road (23)

Question TD: 2D towers shall aim in 90

Hi!

I captured some pics of the old SNES game Secret of Mana (also called Seiken Densetsu or so). I want to make a TD where the towers are 2D-Arts. I already got animated mdls and mdx models, but now I don't know, how to set up a good system. The Arts have animations for 4 directions. They can look left, right, forward and backward. Now I need a system that checks where the attacked enemy is. If the enemy is on the left side of the attacking tower, then the tower should play its left animation. If the enemy is beneath the tower, then the tower should play its forward-animation. Yes, that is the problem. And I don't know where to start. I need a system which looks for all the towers and letting the towers play their appropriate animations like the pathing enemies are located. So, it needs to be a good system, because of many events the whole time... I have the 'JassNewGenPackv5d' on my system and some experience in jass, but I haven't done anything in WE since around 2 years... So, hopefully you can give me a solution?

Edit:
I will try to use "SetUnitAnimationByIndex", but some hints would be nice...
__________________
my nicknames:
20002006200720102012
Master of SicknessDesignatusKakarotEdwardElricSourceSeeker

Last edited by MasterofSickness : 04-06-2010 at 06:57 PM.
MasterofSickness is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 04-07-2010, 02:26 PM   #2
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default

a = angle between units tower and target

if a > 315 || a < 45 then face up
elseif a > 225 then face left
elseif a > 135 then face down
else face right

This presumes a is normalized to 0..360 and 0 degrees is up.

As for playing animations: ByIndex is the best method.

As for detecting when to do the facing: In the generic "on attacked" event. When a unit is attacked, and the attacker is a tower who's facing is snapped to 4 directions, set the animation.

Note that I do believe attacking resets animations, even if done by index. You may have to work out something with dummy units to do the actual attacking for the towers.
__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils

Earth-Fury is offline   Reply With Quote
Old 04-08-2010, 01:52 PM   #3
MasterofSickness
User
 
MasterofSickness's Avatar
 
Join Date: Feb 2006
Posts: 218

MasterofSickness is on a distinguished road (23)

Default

Thanks for the hints earth-fury!

And what is with the animation names "left" and "right"? (Reference)
Where are they used? If they work for attack, then I would prefer this for 2 directions!
In the mdl file under sequences I tried Anim "attack left" and "attack right", but the later mdx only attacks with "attack left".
Are they used for stand left or walk left or for what?
Does there exist a tutorial about the uses of the animation names (I think no, used the search function a lot)?
__________________
my nicknames:
20002006200720102012
Master of SicknessDesignatusKakarotEdwardElricSourceSeeker

Last edited by MasterofSickness : 04-08-2010 at 01:57 PM.
MasterofSickness is offline   Reply With Quote
Old 04-08-2010, 03:50 PM   #4
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

I believe they are modifiers for hands "hand, left".
__________________
Ammorth is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:23 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services