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 Tue Dec 10, 2024 12:07 am
All times are UTC + 0
[Solved]AttachEffect on self while firing enemy?
Moderators: Ares Support Team at PPM, Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [9 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
rey
Disk Thrower


Joined: 15 Jul 2019

PostPosted: Tue Feb 11, 2020 3:41 pm    Post subject:  [Solved]AttachEffect on self while firing enemy? Reply with quote  Mark this post and the followings unread

all mods that use Ares usually have either units who put effect on enemy while attacking, or effect themselves.  can smb please give me hints on simpliest(shortest code-wise) way to put effect on unit-itself while still making a distant attack on enemy(without effecting it)?
for the moment i found only use of animations to "re-call" another weapon during use of main enemy attacking weapon, but that involves quite a heap of code, so maybe there is some other/simple way?

Last edited by rey on Mon Jan 03, 2022 10:26 am; edited 1 time in total

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


Joined: 11 Feb 2016

PostPosted: Wed Feb 12, 2020 5:22 am    Post subject: Reply with quote  Mark this post and the followings unread

Animation weapon on the weapon's Anim
Code:
[GUNFIRE]
Damage=1
Weapon=AESpawnerWeapon

Make sure your flh is not too off and the AE-spawner weapon has some CellSpread

_________________

Back to top
View user's profile Send private message Skype Account
XxpeddyxX
Commander


Joined: 03 Sep 2004

PostPosted: Wed Feb 12, 2020 8:03 am    Post subject: Reply with quote  Mark this post and the followings unread

If your unit only has 1 weapon, the easiest (and cleanest IMO) way would be to:

ART
Code:
[UNIT]
PrimaryFireFLH=0,0,0 ; bang on in the middle of the unit so no other unit gets affected
SecondaryFireFLH=70,0,140 ;change this to whatever your unit actually uses, note that if you change this on infantry, sequence may need to be altered


RULES
Code:
[UNIT]
Primary=DummyWeapon
ElitePrimary=DummyWeaponE ;if range increases add elite dummy
Secondary=ProperWeapon
EliteSecondary=ProperWeaponE
ReloadAmount=1
NoAmmoWeapon=1
Reload=60 ; set this to how often you want the buff reapplied
Ammo=1

[DummyWeapon]
Damage=1
ROF=1
Range=6 ;make sure it matches the proper weapon's range
Projectile=DummyProj ;to explode instantly
Speed=100
Warhead=BuffWH
Ammo=1 ;necessary

[ProperWeapon]
Ammo=0 ;just add this to the weapon

[DummyProj]
Image=CLRANIM
Arcing=yes
Vertical=yes ;needed
;DetonationAltitude=0
Ranged=yes

[BuffWH]
Verses=0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0% ;change it to only affect the unit's armor, or better yet add a custom armor just for the purpose of this buff to the unit. make it 10% so no damage is parsed
CellSpread=0.25 ;play around with this but doesn't need to be higher than this so it only affects the unit
AffectsEnemies=no
AttachEffect.Duration=60 ;play around with duration to suit
AttachEffect.Animation=INSERT POWER UP ANIM HERE
AttachEffect.TemporalHidesAnim=yes
AttachEffect.FirepowerMultiplier=1.15    ;change this to whatever buff you want, check the manual
AttachEffect.Cumulative=no ;if you want, recommended

_________________

ayylmao on Discord

Back to top
View user's profile Send private message
rey
Disk Thrower


Joined: 15 Jul 2019

PostPosted: Wed Feb 12, 2020 9:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

@XxpeddyxX interesting approach, thank you for unexpected idea!

@cxtian39 that's kinda what i was talking about - this way demands at least new weapon, WH, projectile, plus as it's a "spawned weapon" it can't be set to affect only allies/enemies(at least i didn''t find a way to have area effect for only one side).

Back to top
View user's profile Send private message
kingoni909
Medic


Joined: 14 Dec 2012

PostPosted: Fri Aug 27, 2021 2:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

XxpeddyxX wrote:
If your unit only has 1 weapon, the easiest (and cleanest IMO) way would be to:

ART
Code:
[UNIT]
PrimaryFireFLH=0,0,0 ; bang on in the middle of the unit so no other unit gets affected
SecondaryFireFLH=70,0,140 ;change this to whatever your unit actually uses, note that if you change this on infantry, sequence may need to be altered


RULES
Code:
[UNIT]
Primary=DummyWeapon
ElitePrimary=DummyWeaponE ;if range increases add elite dummy
Secondary=ProperWeapon
EliteSecondary=ProperWeaponE
ReloadAmount=1
NoAmmoWeapon=1
Reload=60 ; set this to how often you want the buff reapplied
Ammo=1

[DummyWeapon]
Damage=1
ROF=1
Range=6 ;make sure it matches the proper weapon's range
Projectile=DummyProj ;to explode instantly
Speed=100
Warhead=BuffWH
Ammo=1 ;necessary

[ProperWeapon]
Ammo=0 ;just add this to the weapon

[DummyProj]
Image=CLRANIM
Arcing=yes
Vertical=yes ;needed
;DetonationAltitude=0
Ranged=yes

[BuffWH]
Verses=0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0% ;change it to only affect the unit's armor, or better yet add a custom armor just for the purpose of this buff to the unit. make it 10% so no damage is parsed
CellSpread=0.25 ;play around with this but doesn't need to be higher than this so it only affects the unit
AffectsEnemies=no
AttachEffect.Duration=60 ;play around with duration to suit
AttachEffect.Animation=INSERT POWER UP ANIM HERE
AttachEffect.TemporalHidesAnim=yes
AttachEffect.FirepowerMultiplier=1.15    ;change this to whatever buff you want, check the manual
AttachEffect.Cumulative=no ;if you want, recommended

Back to top
View user's profile Send private message
kingoni909
Medic


Joined: 14 Dec 2012

PostPosted: Sat Aug 28, 2021 1:36 am    Post subject: Reply with quote  Mark this post and the followings unread

[ProperWeapon]
Ammo=0 ;just add this to the weapon
I think ammo = 1, same as DummyWeapon

Back to top
View user's profile Send private message
rey
Disk Thrower


Joined: 15 Jul 2019

PostPosted: Mon Dec 27, 2021 1:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

Long time passed and i settled that case in some other way, but again stumbled with kinda similar problem and now really need hints why my approach doesn't work.

I'm trying to modify unit(infantry) and add buff that it gets for short duration after attacking. For some reason the unit doesn't get the buff, though the code works = when i make Damage= in Art.ini high, plus Warhead has big Cellspread and only this unit in Versus - it does hurt unit and nobody else(but no buff acquired).

Anim-weapon and Warhead:
Code:
[SpBuff]
Damage=1;40
ROF=1
Range=1
Projectile=InvisibleAll
Speed=100
Warhead=SpBuffWH

[SpBuffWH]
Verses=0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%
InfDeath=0
Versus.charger=100%
CellSpread=10
;PercentAtMax=1
AffectsEnemies=no
AffectsAllies=yes
AffectsOwner=yes
AttachEffect.Duration=90
AttachEffect.DiscardOnEntry=yes
AttachEffect.SpeedMultiplier=2
AttachEffect.Animation=SPUP
AttachEffect.PenetratesIronCurtain=yes
AttachEffect.TemporalHidesAnim=yes
PreventScatter=yes


Using Unit's Weapon > AnimList= > modifing existing anim in Art.ini with added Weapon= > BuffWeapon > Warhead - AttachEffect.
Code:
[CHARGE]
Normalized=no
UseNormalLight=yes
ZAdjust=-999
CustomPalette=eurekastorm.pal
YSortAdjust=-999
Report=EurekaChargeSmall
YDrawOffset=-12
Rate=800
;-------
Damage=1  ;50 ;testing
DamageRadius=1000
Weapon=SpBuff
Damage.Delay=1



Using Unit's Weapon > PreImpactAnim= > new anim in Art.ini with Weapon= > BuffWeapon > Warhead - AttachEffect.
Code:
[BUFFSP]
Normalized=no
Surface=yes
Rate=300
Damage=1  ;100 ;testing
DamageRadius=1000
Weapon=SpBuff
UseNormalLight=yes
Translucent=no


Both no luck, damage happens, no buff acquired. I understand only some commands in Art.ini, so totally don't understand if i'm setting it somehow wrong?

Back to top
View user's profile Send private message
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Mon Dec 27, 2021 1:29 pm    Post subject: Reply with quote  Mark this post and the followings unread

Did you add the new anims to the [Animations] list & [SpBuff] to the [WeaponTypes] list?

_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL
rey
Disk Thrower


Joined: 15 Jul 2019

PostPosted: Mon Dec 27, 2021 2:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

Mig Eater wrote:
Did you add the new anims to the [Animations] list & [SpBuff] to the [WeaponTypes] list?
Animation, weapon, warhead - all added.

ADD: Damn! A simple one letter mistake in weapon name declaration in [WeaponTypes] was braking everything!! What an irritating shame.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [9 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.2033s ][ Queries: 11 (0.0087s) ][ Debug on ]