Jump to content
We are aware aware of an issue with authentication on the site. See our status page for details. ×

Some help creating a custom stimpack...


Recommended Posts

I have this code:

Scriptname _LE_FAKit_Effect extends activemagiceffect

SPELL Property _LE_Spell Auto Const

SPELL Property _LE_Spell_2 Auto Const

MiscObject Property _LE_Antiseptic Auto Const

MiscObject Property _LE_Cloth Auto Const

MiscObject Property _LE_Water Auto Const

Event OnEffectStart(Actor akTarget, Actor akCaster)
	if ((Game.GetPlayer().GetItemCount(_LE_Antiseptic) >= 1)&&(Game.GetPlayer().GetItemCount(_LE_Cloth) >= 1)&&(Game.GetPlayer().GetItemCount(_LE_Water) >= 1))
		Game.GetPlayer().RemoveItem(_LE_Cloth,1,true)
		Debug.Notification("You take a piece of cloth")
		Game.GetPlayer().RemoveItem(_LE_Water,1,true)
		Debug.Notification("You cleane it")
		Game.GetPlayer().RemoveItem(_LE_Antiseptic,1,true)
		Debug.Notification("You disinfect it")
		Game.GetPlayer().AddSpell(_LE_Spell, true)
		Debug.Notification("Wounds closed")
		Game.GetPlayer().AddSpell(_LE_Spell_2, true)
		Debug.Notification("Bones set")
	else
		Debug.Notification("You're missing ingredients for the bandage")
	endIf
EndEvent

_LE_Antiseptic, _LE_Cloth and _LE_Water are pretty self-explanatory, they are items, and the code related to them works fine.

 

However, I can't seem to be able to make _LE_Spell (it's supposed to heal the player, tried with a direct effect and with a magic effect on the spell) and _LE_Spell_2 work. They just won't activate, and they are properly assigned in th Properties.

 

Could anyone tell me what am I supposed to do to get an item to alowly heal the player from script?

 

Thanks a bunch!

Link to comment
Share on other sites

It's hard to say with the info you posted.

 

1. Do you see these Debug.Notifications?

 

2. If you don't see them: How are you trying to trigger this magic effect in your post? When is it supposed to "fire"?

 

3. If you see them: What kind of effects are _LE_Spell and _LE_Spell_2? If you compare them to Potion Stimpak, what's the difference? You can use same magic effects in Potions and Spells so you can just copy paste how Stimpaks work and adjust the values how you want(magnitude, duration).

 

Instead of AddSpell you can try PlayerRef.DoCombatSpellApply(_LE_SPELL, PlayerRef) or PlayerRef.Cast(_LE_SPELL) .

Edited by vkz89q
Link to comment
Share on other sites

It's hard to say with the info you posted.

 

1. Do you see these Debug.Notifications?

 

2. If you don't see them: How are you trying to trigger this magic effect in your post? When is it supposed to "fire"?

 

3. If you see them: What kind of effects are _LE_Spell and _LE_Spell_2? If you compare them to Potion Stimpak, what's the difference? You can use same magic effects in Potions and Spells so you can just copy paste how Stimpaks work and adjust the values how you want(magnitude, duration).

 

Instead of AddSpell you can try PlayerRef.DoCombatSpellApply(_LE_SPELL, PlayerRef) or PlayerRef.Cast(_LE_SPELL) .

 

1. The code executes; I see the notifications no problem. That's why I'm confused and it may be how they're set up in the CK.

 

2 & 3. This is how I have them set up:

 

_LE_Spell is _LE_FAKit_Spell and _LE_Spell_2 is _LE_LimbRestore

 

http://i.imgur.com/PAtzCzF.jpghttp://i.imgur.com/hOk9hib.jpghttp://i.imgur.com/7qPk6Pg.jpghttp://i.imgur.com/TF8yvTI.jpg

Link to comment
Share on other sites

I'm not sure. I have heal spell that uses vanilla RestoreHealthStimpak and it works. What's the conditions on your spell?

 

My advice is try without conditions, try using bigger magnitude than 0.10, less duration and try Cast() or DoCombatSpellApply() instead of AddSpell() to see if it starts working.

 

You can also copy the stimpak effect and add script on it that does this:

Event OnEffectStart(Actor akTarget, Actor akCaster)
	Debug.Notification("hi from effect")
	Debug.Trace("caster" +akCaster)
	Debug.Trace("target" +akTarget)
EndEvent
Link to comment
Share on other sites

 

I'm not sure. I have heal spell that uses vanilla RestoreHealthStimpak and it works. What's the conditions on your spell?

 

My advice is try without conditions, try using bigger magnitude than 0.10, less duration and try Cast() or DoCombatSpellApply() instead of AddSpell() to see if it starts working.

 

You can also copy the stimpak effect and add script on it that does this:

Event OnEffectStart(Actor akTarget, Actor akCaster)
	Debug.Notification("hi from effect")
	Debug.Trace("caster" +akCaster)
	Debug.Trace("target" +akTarget)
EndEvent

It has no conditions. I've tried witha condition to check the user is the player, but without it it doesn't work either.

Link to comment
Share on other sites

 

I'm not sure. I have heal spell that uses vanilla RestoreHealthStimpak and it works. What's the conditions on your spell?

 

My advice is try without conditions, try using bigger magnitude than 0.10, less duration and try Cast() or DoCombatSpellApply() instead of AddSpell() to see if it starts working.

 

You can also copy the stimpak effect and add script on it that does this:

Event OnEffectStart(Actor akTarget, Actor akCaster)
	Debug.Notification("hi from effect")
	Debug.Trace("caster" +akCaster)
	Debug.Trace("target" +akTarget)
EndEvent

The code runs, but I set that in the second tier effects and they didn't run... Thanks for that. I'm looking at what can I do to fix this.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...