Jump to content

Trigger teleport on death


DarkKRaziel

Recommended Posts

@ Dubious LOL I guess that script is a good example of " would ? " the 3 consecutive "Set" lines be able to work in a 1 frame block with themselves ???

Hence I used the gamemode block ... but wondering could they with the ghz speed of the processor ?

 

Sorry to high jack the thread with an inside conversation .

Link to comment
Share on other sites

Ok I am a little lost.

 

My first objective is to set up a script that activates a teleport once the player reaches 0 health., where 0 is not actually 0.

The plan is to add 10000 hps artificially through the geck so as to make sure the player does not actually die and trigger a game over and auto load.

 

Taken from the wiki: "

Bear the following in mind when attempting to determine the health of any actor:

[ActorRef].GetHealthPercentage is unreliable as it's determined from "base health" and sometimes returns values over 1.0 (100%).

[ActorRef].GetAV Health returns the current, modified health value.

[ActorRef].GetBaseAV Health returns the base value with no consideration for permanent (eg. Life Giver perk) or temporary effects (eg. Buffout).

[ActorRef].GetPermAV < StatName > returns include permanent effects (e.g. Perks like "Tag!", and from Skill Books), but no bonus from situational perks, equipped items, drugs, etc..

[ActorRef].ResetHealth Restores the actor's health and cures crippling damage.

No function known at the moment can return the max value with temporary effects.

"

 

Gethealthpercentage will not work accurately enough for me as it will not properly take into consideration any health increases that the player receives as they level in terms of perks or using buffout etc.

So which of these health functions if any will calculate the player's CURRENT health as it is lost through battle, poison or whatever rather than the total possible health a player has. For example the player has

 

10001 hp out of a possible 10500 hps. I want a function that activates in reference to the 10001 value not the 10500 value

 

If I can find that function I can then create a script which only triggers once the player's health has been reduced to less than 10001 hps over the course of battle. This approach should allow for the normal increases of hps as a player levels.

 

I thank you for your help and uh sorry if it has been explained already and I am just not understanding it.

Link to comment
Share on other sites

Please see the GECKWiki "ActorValue" page regarding the "Damage Pool" and that determining an Actor's current health is a multistage process. It looks like "GetAV Health" is what you want, but I have no idea if that reflects the "Damage Pool" from frame to frame. "DamageActorValue" implies that it does.

 

I'll add a Tip to Scripting with the results of your experience if you will let us know how things work out for you.

 

-Dubious-

Link to comment
Share on other sites

Okies first , lets define a couple terms so we clearly understand what we are talking about.

 

Buffer Health - The hidden health that keeps the player from dying.

Playable Health - The health pool that the player will see through the hud.

 

So the buffer health should be a static size , but big enough to account for a max possible incoming damage at any point in the game.

And unless you make the playable health dynamic to reflect increases through the game. Then it would make leveling up pointless.

 

So what I attempted in my script , was to get a starting point , and divide it by the total full health at a current time giving you a ratio number. To then increase the playable health past the buffer health , to then be able to adjust the displayed health.

 

I used the "GetHealthPercentage" as an on/off switch , not as a factor to calculate with.

But if it is unreliable , and may show 1.0 or greater when the player is in fact damaged.

Then forget about using it. And thinking it through more. I guess all we really need do is set the buffer health one time.

Which I guess should be set at the beginning of game , or we could calculate it back to that point were someone to load the mod using a leveled up character.

 

So once that starting point is established , then you just divide it by the current full health to give you the ratio.

And this can be done at points of permanent increases to the health pool, like level up , or skill books , perks... can't think of any others off the bat. But it doesn't need checked all the time.

And I think the temporary increases / bonuses , should be just that , and not used to calculate the ratio. Which really ... is just for showing that hud health bar correctly to the playable health.

Because the intended death point (buffer health) will never change , and easily checked for in scripts.

 

And any where health displays as a number , I guess should be fine with just adding a few zero's , which is why you're picking 10000 as that point ? Also seems like you should be able to color that text when it hits certain thresholds.

But like I said , am not well versed in adjusting those sorts of things.

 

Hope that helped clarify :wink:

Link to comment
Share on other sites

Got my teleportation script working!

 

Just an update on the

 

GetActorValue Health script function

 

It monitors actor's current variable health not maximum health so it works perfectly for my purpose. It takes into consideration perks as they contribute to your health pool (tested) but unsure as to temporary increases such as buffout etc.

 

Mctavish thanks for your help but your script is too complex for my noob scripter brain to comprehend. For the moment I will focus on getting the basic mechanics of my mod working and then I will revisit the hp display problem when I confirm that the game doesn't break when the player teleports all over the place on "death".

Edited by Nexusmodsaccountno2
Link to comment
Share on other sites

Glad you got it working :)

 

My scripting mentioned was a theory towards setting up what the HUD shows.

In which I really don't know how to do that either ... so no worries.

Just a mention towards polishing the mod. But the actual workings are done with setting your buffer health , then GetAV Health , like you figured out sounds like.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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