Jump to content

assistance needed, hiccups while mathing out weapon scripts


3aq

Recommended Posts

Making a bit of headway into weapon scripting, convoluted linkage aside..

 

I've encountered one stellar hiccup I am unable to address, so here goes

 

 

Resolved.

Here's my script:

scriptName _OnEffectBloodGold extends activemagiceffect
{Script to gain gold based on the amount of health lost.}

import Math
miscobject property Gold auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
	float BaseHP = Math.Ceiling(akTarget.GetBaseActorValue("Health"))
	float CurrentHP = Math.Ceiling(akTarget.GetActorValue("Health"))
	float HealthPercent = CurrentHP / BaseHP
	int Calc = BaseHP * (1 - HealthPercent)

	akCaster.AddItem(Gold, Calc )
EndEvent

when variables are singular, the effects shows up, ie int BaseHP or int CurrentHP
but when they are combined, ie int Calc
it does not work.
unsure what I may be doing wrong.. :psyduck:

Edited by 3aq
Link to comment
Share on other sites

  • Recently Browsing   0 members

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