Jump to content
h0tr0d

Inserting code into a buff

Recommended Posts

So I am trying to add this line

 

<triggered_effect trigger="onSelfBuffUpdate" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,-.2,0" parent_transform="LOD0" shape_mesh="true"/>

Into the buff 

 

<buff name="buffIsOnFire"

I want it within this effect_group

 

<effect_group name="run particles, cleanup">
			<triggered_effect trigger="onSelfBuffRemove" action="ModifyCVar" cvar=".buffIsOnFireDisplay" operation="set" value="0"/>

			<triggered_effect trigger="onSelfBuffStart" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,-.2,0" parent_transform="LOD0" shape_mesh="true"/>
			insert here
			<triggered_effect trigger="onSelfEnteredGame" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,-.2,0" parent_transform="LOD0" shape_mesh="true"/>
<!--
			<triggered_effect trigger="onSelfBuffRemove" action="AttachParticleEffectToEntity" particle="p_electric_shock" parent_transform="Spine1" local_offset="0,-.2,0"/>
			<triggered_effect trigger="onSelfDied" action="AttachParticleEffectToEntity" particle="p_electric_shock" parent_transform="Spine1" local_offset="0,-.2,0"/>
-->
			<triggered_effect trigger="onSelfBuffRemove" action="RemoveParticleEffectFromEntity" particle="p_onFire"/>
			<triggered_effect trigger="onSelfDied" action="RemoveParticleEffectFromEntity" particle="p_onFire"/>

			<triggered_effect trigger="onSelfBuffStart" action="AddJournalEntry" journal="onFireTip"/>
		</effect_group>

 

So that it looks like

 

<effect_group name="run particles, cleanup">
			<triggered_effect trigger="onSelfBuffRemove" action="ModifyCVar" cvar=".buffIsOnFireDisplay" operation="set" value="0"/>

			<triggered_effect trigger="onSelfBuffStart" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,-.2,0" parent_transform="LOD0" shape_mesh="true"/>
			<triggered_effect trigger="onSelfBuffUpdate" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,-.2,0" parent_transform="LOD0" shape_mesh="true"/>
			<triggered_effect trigger="onSelfEnteredGame" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,-.2,0" parent_transform="LOD0" shape_mesh="true"/>
<!--
			<triggered_effect trigger="onSelfBuffRemove" action="AttachParticleEffectToEntity" particle="p_electric_shock" parent_transform="Spine1" local_offset="0,-.2,0"/>
			<triggered_effect trigger="onSelfDied" action="AttachParticleEffectToEntity" particle="p_electric_shock" parent_transform="Spine1" local_offset="0,-.2,0"/>
-->
			<triggered_effect trigger="onSelfBuffRemove" action="RemoveParticleEffectFromEntity" particle="p_onFire"/>
			<triggered_effect trigger="onSelfDied" action="RemoveParticleEffectFromEntity" particle="p_onFire"/>

			<triggered_effect trigger="onSelfBuffStart" action="AddJournalEntry" journal="onFireTip"/>
		</effect_group>

 

and I have tried various things including:

 

<insertAfter xpath="/buffs/buff[@name='buffIsOnFire']/property[name='effect_group name-run particles, cleanup']>
	<triggered_effect trigger=onSelfBuffUpdate action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,-.2,0" parent_transform="LOD0" shape_mesh="true"/>
	</insertAfter>
    
    <insertAfter xpath="/buffs/buff[@name='buffIsOnFire']/property[name='effect_group']/@name='run particles, cleanup']>
	<triggered_effect trigger="onSelfBuffUpdate" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,-.2,0" parent_transform="LOD0" shape_mesh="true"/>
	</insertAfter>

<append xpath="/buffs/buff[@name='buffIsOnFire']/property[name='effect_group']">
	
		<triggered_effect trigger="onSelfBuffUpdate" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,-.2,0" parent_transform="LOD0" shape_mesh="true"/>
		
		</append>
	

Those are just some of the mid-work progress where I was trying things. Right now it is much easier to copy/paste that line into the vanilla .xml but I am wondering how I would insert the line into that effect_group which has a name.

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Your xpath syntax is wrong. Did you carefully read through Sphereii's xpath guide? You know, commands may look a bit differently, but xpath itself is always formed in the same way (depending on what you're trying to refer to). It's like an address you're trying to reach. You're basically telling the game where to look to make those changes for you. I could write a correct xpath for you, but you would like to learn how to write one correctly without help, right?

 

Try this

 

And this:

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...