Posted: Tue Jan 03, 2012 7:20 pm Post subject:
Spotlight with tracking light
Alright here's the tutorial for the tracking spotlight that was discussed in the research center. I managed to cut some useless stuff from it, e.g. the fake particle system wasn't needed after all. This is how it looks like in action:
EDIT: Code updated based on LKO's suggestion
First, look for MinDamage=1 in rules.ini and change it to MinDamage=0.
Next, give these keys to your building or unit that you want to use the spotlight:
The last 3 keys attempt to make sure enemy AI units don't try to avoid getting hit by the spotlight overly much, because it could possibly be exploited. If you want the AI to dodge the lights actively, try changing the last 3 keys.
Next, define the weapons, projectiles and warheads:
Code:
; Spotlight weapon 1st stage
[SpotLight]
Damage=0
AmbientDamage=0
ROF=1
Range=8
Speed=100
Warhead=FirestormWH ; This doesn't matter, no damage is done. Just make sure none of the verses are 0%.
Projectile=SpotLightPR
ProjectileRange=1
; Spotlight weapon 1st stage projectile
[SpotLightPR]
Inviso=yes
Image=none
Cluster=1
Ranged=no
Range=2
Splits=yes
AirburstWeapon=SpotLightNext ; Fires the 2nd stage of the weapon
IgnoresFirestorm=yes
RetargetAccuracy=100%
; Spotlight weapon 2nd stage
[SpotLightNext]
Damage=1 ; This has to be 1. 0 or -1 won't work.
ROF=1000
Range=8
Speed=100
Warhead=SpotLightWH
Projectile=Invisible
; Spotlight weapon 2nd stage warhead
[SpotLightWH]
Spread=0
Verses=-100%,-100%,-100%,-100%,-100% ; These have to be -100%
InfDeath=0
ProneDamage=-100%
Particle=SpotLightSys
Next up, the particle systems. Search rules.ini for *** Particle Systems *** and *** Particles *** to find the correct location for them.
Code:
; Spotlight weapon particle system
[SpotLightSys]
HoldsWhat=SpotLightParticle
BehavesLike=Web ; Key to making this work, the only type of particle beside Gas that can be used with warheads.
ParticleCap=0
SpawnRadius=0
Lifetime=1
Spawns=no
SpawnFrames=0
Slowdown=1.0
SpawnCutoff=15.0
SpawnTranslucencyCutoff=13.0
AlphaImage=ALPHASPOT ; If you use your own alphaimage, put it here.
; Spotlight weapon particle
[SpotLightParticle]
Image=INVISO
BehavesLike=Web
Persistent=true
MaxEC=4 ; *** Read more about this later!
DeleteOnStateLimit=yes
Velocity=0.0
Deacc=1.0
WindEffect=0
EndStateAI=4
StateAIAdvance=4
*** The MaxEC key controls how long the light lives. > 4 can cause the light to leave behind trails, while < 4 causes the light to flicker on and off.
And finally, remember to add your warhead, particle system and particle to the lists in rules.ini.
Code:
[Warheads]
...
xx=SpotLightWH
[Particles]
...
xx=SpotLightParticle
[ParticleSystems]
...
xx=SpotLightSys
You also need to give SpotLightNext as a weapon to some unit, or the game will crash as soon as the spotlight is cast. Westwood used WEEDGUY fake infantry for this role, just create a copy of WEEDGUY and call it WEEDGUY2 and give it this:
Code:
[WEEDGUY2]
...
Elite=SpotLightNext
This version doesn't connect the spotlight to the building or unit that casts it (like a beam of light being cast from the building or unit). For that you'd need to play around with either the projectile, or possibly create a particle system for the SpotLight weapon.
Below is the alphaimage I used for the spotlight, just stick it in ecache0X.mix. It is required for this to work. If you want to replace it with your own, remember to update the code!
These two should be avoided, because on some systems they cause massive lags, while on others no lag at all.
TI used them once in many places, but i had to remove them after some staff members reported about lags due to this. So it's better to use an AlphaImage on the particlesystem.
Can you explain why you used a splits two stage weapon? The first stage seems completely redundant. The damage/repair is done anyway.
Why do you changed MinDamage? I doubt it's because Damage=0 weapons don't use the warhead. But then again you still do damage (via the second stage) and this change doesn't makes much sense from what i can see. _________________ SHP Artist of Twisted Insurrection: Nod buildings
These two should be avoided, because on some systems they cause massive lags, while on others no lag at all.
TI used them once in many places, but i had to remove them after some staff members reported about lags due to this. So it's better to use an AlphaImage on the particlesystem.
Had these on cause I thought they were required for the alphalight to show up, but I tested it and yeah they aren't needed. They only made the center of the spotlight brighter. Updating the tutorial to remove these.
Lin Kuei Ominae wrote:
Can you explain why you used a splits two stage weapon? The first stage seems completely redundant. The damage/repair is done anyway.
Without 2 stage weapon the targetting didn't work correctly. It would not automatically shoot at enemy units, and if ordered to fire on them it would only fire once. It would keep firing on friendly units though. No idea why it does what it does, this is the only way I could get it to work.
Lin Kuei Ominae wrote:
Why do you changed MinDamage? I doubt it's because Damage=0 weapons don't use the warhead. But then again you still do damage (via the second stage) and this change doesn't makes much sense from what i can see.
If you use the Damage=1 and all Verses=-100% way (so the enemy targets the spotlight), then the spotlight will keep dealing damage unless you change MinDamage to 0. You can leave MinDamage to 1 if you use Damage=-1 and all Verses=100%. Though I would still change MinDamage to 0 regardless of which way you use, cause there might be other uses for non damaging weapons. I can't see any negative effects of changing it. _________________ QUICK_EDIT
ok seems like the Damage=-1 and Verses=100% way doesn't work properly, it heals the target it fires on. Tried using different damages, verses and messing with MinDamage and couldn't get it to work. So controlling the AI reaction can't be done this way, they will target and attack the spotlight once they get lit up. I will do some further testing to try to get rid of this. Though I guess it does make sense that the enemy gets mad if they are spotlighted, but I think it would be better for them to prioritize targets a little better than going after a spotlight...
This also means the MinDamage has to be set to 0 as mentioned in my previous post. Updating the tutorial again. _________________ QUICK_EDIT
Tested this a bit further, it seems that putting verses to -100% and having a positive damage will create the situation where no damage is dealt, but the warhead still gets applied (thus playing any animation or particle system you have attached to it). It also requires you to set the MinDamage to 0.
You also need to use the Reaper missile split logic, otherwise the unit will simply run next to the target, not firing the weapon. So without the 2nd stage weapon, the unit acts as if the weapon had Damage=0.
Even if the weapon deals no damage, it will piss off the enemy, making them retaliate. I found a way to get past this using the Webby=yes key on the warhead, but it has a problem with infantry. Even with all the web related keys set to 0, the infantry will flicker the web anim on and off very quickly, even if it doesn't actually affect them in any gameplay terms. The system could still be used if you got rid of the normal web logic or made all infantry web-immune, but I really don't think it's worth replacing the web logic for this small benefit.
Speaking of webs, noticed that the web system sure can have a massive spread... couldn't find any way to attach damage to this though, if there was a way it could be used for super weapons without resorting to debris logic.
Joined: 25 Sep 2006 Location: Teamblackistan Posts: Over 9000
Posted: Wed Jan 04, 2012 9:04 am Post subject:
Nice work! Functional, buildable properly looking light tower without lag issues -- yes please!
I like how yo put the radial indicator on there, I think there's a potential for this as a stealth detection building too _________________ The Fall of Hammerfest - Epic Tiberian chain story
Tiberian Odyssey mapping department. Discord The Team Black Index QUICK_EDIT
Very grateful you made this, I have been trying to follow LKO's thread to try and create the above, was stuck on the getting the light to work with the particles.
On a similar note in regards to damage and modifiers (verses), I want to create a weapon that damages infantry (no amour) but does no damage to heavy or concrete armour types. I have mindamage=0, damage=50 and verses=100%,0%,40%,0%,0%, but it still does continues to do minute amounts of damage to concrete buildings and heavy armoured vehicles still
still trying to figure out what real use in skirmish a watchtower could have.
edit: question to joshy or hyper
would it be engine/coding wise possible in theory that at a specific global lightning, for example global night lightning that the range of units is shortened and watchtowers who spot enemy units give nearby defenses a daylight normal range? _________________ Hydraw Art on Facebook QUICK_EDIT
Joined: 25 Sep 2006 Location: Teamblackistan Posts: Over 9000
Posted: Wed Jan 04, 2012 2:58 pm Post subject:
In know the beta they implemented light and dark to make lit-up units more vulnerable (and spotlight towers actually useful) but I don't know to what extent, or how much of that is still in TS _________________ The Fall of Hammerfest - Epic Tiberian chain story
Tiberian Odyssey mapping department. Discord The Team Black Index QUICK_EDIT
still trying to figure out what real use in skirmish a watchtower could have.
On dark maps, it helps you spot an enemy scout. It can be just an extra feature of a regular gun tower.
but that would just be a visual gimmick nothing of that much use that you plaster a base with 4-5 of those towers _________________ Hydraw Art on Facebook QUICK_EDIT
Maybe it isn't useful as a building - but it is more then useful for missions and maps! _________________
Think of me as Nordos, 'cause Banshee wouldn't rename me QUICK_EDIT
Joined: 25 Sep 2006 Location: Teamblackistan Posts: Over 9000
Posted: Wed Jan 04, 2012 9:28 pm Post subject:
I think it would do pretty good as a cloak detector. Not only would it detect, but anything in the spotlight would uncloak.
If nothing else, it would be good in mission maps as something to avoid, such as on a stealth mission or something _________________ The Fall of Hammerfest - Epic Tiberian chain story
Tiberian Odyssey mapping department. Discord The Team Black Index QUICK_EDIT
all i can think of is an early game detection device with a medium range for cloaked scouts, that it , if the jumpjet infantry uncloak logic works on buildings too _________________ Hydraw Art on Facebook QUICK_EDIT
Joined: 25 Sep 2006 Location: Teamblackistan Posts: Over 9000
Posted: Wed Jan 04, 2012 11:53 pm Post subject:
the jumpjet uncloak logic is tied to the locomotor, but the spotlight itself should do the uncloaking, since it's a weapon.
One thing to consider is a multi-directional spotlight image coming from the tower, treated like a muzzle flare animation _________________ The Fall of Hammerfest - Epic Tiberian chain story
Tiberian Odyssey mapping department. Discord The Team Black Index QUICK_EDIT
Facing specific alphaimage muzzleflashes are quite code heavy as they need 8 warheads, 8 particlesystems (1 particle for the 8 ) and 8 art.ini debris.
A facing specific alphaimage-muzzleflash might not even look good due to the restricted 8 facings and the 8 facings would also not allow the alphabeam to tilt up/down concerning the range of the targeted unit. So the beam probably looks odd most of the time.
However as a use case, i see this being used on a unit. Consider a mod using by default fog of war, a unit with this spotlight could work as a spotter for artillery which doesn't has a long sight. For this the spotlight could then reveal the shroud in a small area around the spotlight, so the artillery has a clear sight to the target.
On very dark maps, this could be also used as a field illumination device. Though for that i would rather use a weapon with a slow ROF and a quite long particleduration so the alphaimage isn't constantly drawn and deleted like here, which is quite CPU heavy. _________________ SHP Artist of Twisted Insurrection: Nod buildings
still trying to figure out what real use in skirmish a watchtower could have.
Well, in my mod the Forgotten have a watch tower that detects stealth / subterranean. It also has an alarm when enemies come too close. Handy if the enemy is trying to sneak in with an APC while you are looking elsewhere. By naming the structure GAVULC you could give it two weapons, one for the spotlight and one for the alarm. Not really gameplay affecting, but I think it gives something unique to the structure. And maybe in dark maps it would allow you to spot the unit faster. In a situation where the enemy is rushing at your con.yard. with an APC full of engineers a few seconds difference could mean alot.
Tartan Bunny wrote:
On a similar note in regards to damage and modifiers (verses), I want to create a weapon that damages infantry (no amour) but does no damage to heavy or concrete armour types. I have mindamage=0, damage=50 and verses=100%,0%,40%,0%,0%, but it still does continues to do minute amounts of damage to concrete buildings and heavy armoured vehicles still Confused
Any thoughts?
You need a secondary (fake) weapon that is used against the 0% armor types that you don't want the real weapon to be used against. Give the fake weapon damage=0 and verses=0%,1%,0%,1%,1%. _________________ QUICK_EDIT
Joined: 25 Sep 2006 Location: Teamblackistan Posts: Over 9000
Posted: Fri Jan 06, 2012 6:07 am Post subject:
I actually wasn't thinking of alphas for the muzzle flash, just a normal shp to show where the spotlight was coming from _________________ The Fall of Hammerfest - Epic Tiberian chain story
Tiberian Odyssey mapping department. Discord The Team Black Index QUICK_EDIT
I actually wasn't thinking of alphas for the muzzle flash, just a normal shp to show where the spotlight was coming from
This is something I tried, though this uses a projectile so the spotlight jumps around a bit. A simple muzzleflash could be done for 8 directions, but it would be hard to properly connect to the spotlight, since it would always be the same regardless of the distance. One thing I was thinking that might work well is a railgun or laser effect coming from the tower and hitting the target. A constantly drawn railgun particle might slow down the game alot. With laser you could try attaching it to the first or second stage of the weapon with some other tweaks.
EDIT: Adding Turret=yes for the tower could help too to give the proper angle for the source of the light. _________________ QUICK_EDIT
A single laser line using a railgun without particles is the best choice imo. It can be pure white colored and doesn't has the transparent red outer part of normal lasers. Without particles it won't cause any lag as well. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Joined: 25 Sep 2006 Location: Teamblackistan Posts: Over 9000
Posted: Fri Jan 06, 2012 5:17 pm Post subject:
I haven't seen a colorless laserline yet, but it might just look decent.
However, all hell would break loose for those who get waveclass errors _________________ The Fall of Hammerfest - Epic Tiberian chain story
Tiberian Odyssey mapping department. Discord The Team Black Index QUICK_EDIT
yes, it works in RA2 as well. though you would have to use a verses=0% warhead, remove the second stage weapon (reaper split logic doesn't exist in RA2) and attach the particle to the first stage weapon. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Mon Jan 09, 2012 10:26 am Post subject:
Verses=0% warhead, wut?
3% is needed to auto-target (in Ares at least, since it fixes the floating-point calculation of 2%). I dunno how TS works there, but except if it's PrismSupport or forced by Airstrike, there's no way to fire a weapon on a 0% target. _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
well, whatever special case ra2 uses on the verses to produce 0 damage but still keep targeting possible.
Ra2 might even show a warhead on Damage=0 weapons, so the whole verses tinkering isn't even necessary. But i don't know it, as the last time i've modded Ra2 was when there didn't exist a TI,DTA and TO mod.
Though anyone modding Ra2 should be able to find out himself how this has to be coded. _________________ SHP Artist of Twisted Insurrection: Nod buildings
So, after many years, I've once again become hooked on creating my own little rules.ini tweaks. This is a nice tutorial, although it could have been a little clearer in a couple of places, but I managed to remember enough to get this working well. However, I discovered that it was impossible to save and load the game without encountering an internal error, and after much trial and error I discovered that it was because of the WEEDGUY2 entry. If I removed this entry, it would allow me to save/load once again, but of course the tower would then cause a crash when it fired.
In case it's relevant - I had also created an additional WEEDGUY2 entry under the Infantry Type List, even though it wasn't specified in the tutorial, I assumed this was correct, and it wouldn't work without it.
I'm curious if anyone else has created this and attempted to save and then load a game?
Oh and the except entry was EXCEPTION_INT_DIVIDE_BY_ZERO QUICK_EDIT
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