Jump to content

Scripting Question


clockout1

Recommended Posts

No luck. This is the most recent version (that does save without errors) yet it doesn't seem to have an effect ingame.

 

Scn AADungeonCreatureHitDetection

short currentHealth
short baseHealth

Begin OnHit

set currentHealth to AAThePlaceHolder.GetAV Health
set baseHealth to AAThePlaceHolder.GetBaseAV Health

if getIsID AADungeonSword ==1
 set currentHealth to currentHealth - (1 + .2 * GetRandomPercent)
endif

if getIsID AADungeonSword == 0
  set currentHealth to baseHealth
endif

end

Link to comment
Share on other sites

Ah, I see it.

 

Those variables you created aren't the actor values, they're just variables.

 

You need an extra line in each if statement setting the AAThePlaceHolder's Health

actor value to those variable values.

 

So, in both if statements you need this line:

AAThePlaceHolder.SetAV Health currentHealth

Your script is calculating the values, it's just not using them.

Link to comment
Share on other sites

Yes, that line works, but I might need to rethink this script.

 

Is it possible to assign the damage dealt on a hit to a variable, then add the amount of damage dealt? (this is getting pretty complex here)

 

Because originally the script would reset the actor's health, but there is no "setBaseAV" command. I'm new to scripting so I'm sort of losing track here.

Link to comment
Share on other sites

Okay, I'm not quite sure what you mean.

 

If the weapon's damage was 0, and then the damage would be fully controlled by your script,

and you could create a cumulative damage effect by creating a damage 'counter.'

 

The first hit you did 4 damage, on the second hit you'd do 4+5 damage. That could be done.

 

But there's no call for a 'setBaseAV' command, so I'm not sure what you mean.

 

Or are you talking about if you were to hit the creature with the correct

weapon, and then switch to a different weapon you'd give it it's health back?

That would happen, but I don't think it's a problem.

Link to comment
Share on other sites

So, you mean to increase the actor's health above it's current level?

 

You can do that by altering it's stats (I think that's the only way you can do that).

 

This page has the formula the game uses to calculate health: Link

 

I'm not sure if that formula applies for actors other than

the player though, but it should be pretty similar.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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