Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 8:09 am
All times are UTC + 0
Creating an AA-only unit
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
SuperJoe
Commander


Joined: 03 Sep 2009

PostPosted: Thu Aug 25, 2011 7:18 pm    Post subject:  Creating an AA-only unit Reply with quote  Mark this post and the followings unread

Creating an anti-air only unit in TS isn't as simple as one might think, since there are a few issues that come along with it. These include being able to force-fire the AA weapon on the ground, and the AA-only unit targetting enemy ground units, even if it can't fire at them. This tutorial covers how to avoid these issues.

You need to give your AA-only unit 2 weapons:

Code:

[MyUnit]
...
Primary=AAMissile
Secondary=AAMissileFake



Now to define the weapons:

Code:

; The real weapon
[AAMissile]
Damage=30
ROF=60
Range=15
Projectile=AAHeatSeeker ; The projectile must have AA=yes, and AG=no.
Speed=60
Warhead=AAMissileWH ; Special warhead to prevent force-fire bug
Report=SAMSHOT1

; Real weapon warhead
[AAMissileWH]
Spread=3
Verses=0%,100%,100%,100%,100% ; The first one must be 0% to prevent force-fire bug
InfDeath=3
AnimList=XGRYSML1,XGRYSML2,EXPLOSML
ProneDamage=100%


; The fake weapon
[AAMissileFake]
Damage=0 ; Does not deal damage
ROF=60 ; Same ROF as real weapon to not mess up reload sequence
Range=15 ; Same range as real weapon to make sure real weapon is not fired on ground
MinimumRange=20 ; THIS IS VERY IMPORTANT. Must be higher than Range to make this work.
Projectile=Invisible ; Use projectile that has AA=no, and AG=yes.
Speed=100
Warhead=AAMissileFakeWH

; Fake weapon warhead
[AAMissileFakeWH]
Spread=0
Verses=100%,100%,100%,100%,100% ; Make sure all verses are 100%, so the real weapon is not fired at ground targets.
InfDeath=0
ProneDamage=100%



Few things to note. Since we prevented the force-fire on ground bug by giving the real weapon 0% verses for armor type none, no aircraft or any other air unit can have Armor=none. Otherwise the AA unit won't be able to shoot at them. By default none of the aircraft have Armor=none, and I don't see this really being a problem. Make sure the primary weapon is the real weapon, and the secondary is the fake one. Other way around the unit won't be able to properly shoot at air units.

With this code the unit will automatically target and shoot at enemy air units, and never automatically target ground units. If the unit is fired upon by an enemy ground unit, or manually ordered to attack an enemy ground unit, it will walk towards the enemy, but won't fire either weapon. Wish there was a way to make the unit just stand still or back away if it gets fired upon, but I couldn't find a way to do this. Still, I think this problem is alot smaller than having the AA-only unit constantly targetting ground units, thus ignoring potential air threats unless manually ordered to fire at them.


Key Words: #Tutorials #Modding #TiberianSun #Firestorm #Rules.INI 

_________________

Last edited by SuperJoe on Fri Aug 26, 2011 11:16 am; edited 2 times in total

Back to top
View user's profile Send private message
SuperJoe
Commander


Joined: 03 Sep 2009

PostPosted: Fri Aug 26, 2011 10:54 am    Post subject: Reply with quote  Mark this post and the followings unread

After some testing I noticed that the MinimumRange has to be bigger than just Range + 1, since the AA-only unit could still target certain buildings with the fake weapon. I played it safe and made it Range + 5, and now the problem is gone. I've updated the original post with this info.

_________________

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri Aug 26, 2011 10:59 am    Post subject: Reply with quote  Mark this post and the followings unread

You can also give the ground weapon Range=0.

btw, something you can experiment with is the key SAM=yes. IIRC caused this key the building to forget the last fired target after each shot, thus allowing it to target always the biggest threat. Next to the intended feature of being able to only attack aircrafttypes.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
SuperJoe
Commander


Joined: 03 Sep 2009

PostPosted: Fri Aug 26, 2011 11:31 am    Post subject: Reply with quote  Mark this post and the followings unread

Lin Kuei Ominae wrote:
You can also give the ground weapon Range=0.


Won't think make the unit fire the primary on its way to the range of the secondary weapon, which is 0? So if you targetted a ground unit, it would walk towards it while firing primary? But if the primary has AG=no, dunno what would happen. Guess I'll just have to test. Though with MinimumRange being greater than Range the unit behaves as if the weapon range was 0, it walks next to the target and never fires the weapon.

Something interesting I discovered is that the primary weapon range and minimumrange override the secondary weapon range and minimumrange. That's why making the fake weapon primary and the real weapon secondary won't work, cause the fake weapons minimunrange will screw up the real weapons targetting.

Lin Kuei Ominae wrote:

btw, something you can experiment with is the key SAM=yes. IIRC caused this key the building to forget the last fired target after each shot, thus allowing it to target always the biggest threat. Next to the intended feature of being able to only attack aircrafttypes.


Hmmm, one more hidden key not listed by westwood? According to ModEnc it only affects BuildingTypes and doesn't target jumpjets?

_________________

Back to top
View user's profile Send private message
Crimsonum
Seth


Joined: 14 Jul 2005
Location: Fineland

PostPosted: Fri Aug 26, 2011 12:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

At least I've never seen the SAM key used outside BuildingTypes. True, it doesn't target jumpjet units, and FinalSun tends to freeze when trying to place such building (at least it did for me).

_________________


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1387s ][ Queries: 11 (0.0087s) ][ Debug on ]