Jump to content

Trigger teleport on death


DarkKRaziel

Recommended Posts

Oh I see you ninja posted me hehe.

 

But seriously you should think about using a mod manager with archive invalidation , also NVSE launch button.

 

It's true it may work fine without the mod manager ... but how many files are you loading ?

Link to comment
Share on other sites

By the way , just cuz you use a mod manager to load , doesn't mean you have to use it to install mods.

I infact always manually install mod files , by unpacking their contents in a separate folder. Then grab what I need and drop them in the Data folder. Has worked fine for me so far.

The advantage with the mod manager is sorting the load order , and of course the easy button for archive invalidation.

A necessity for modding and testing your changes imo. Of which when mod testing , I am only loading the .esp in question and its master(s)

Link to comment
Share on other sites

Okay, I think I managed to make it work. Downloaded the Mod Manager and did the archive invalidation after changing everything you told me with the perk. I entered the game and... MY CHARACTER HAD THE PERK. Was amazing... I think I did the perk correctly.

 

Then I went to the big scorpions at the north. With 1 hit, my HP dropped at 10% and I stood still... that makes me think that it worked, cause at 12% the script had to do something. But... at 1 second, death animation. Maybe because of the poison? Or something else we are forgetting? How do you make sure that health doesn't go down to 0% and triggers death animation?

 

Hey... at last resource. I multiply my health x10, and I make a < 0.9 health. So it literally is the same as now (when your health reaches 0) but effectively it's impossible to drain HP to zero after the x10, so no problem with death animation. The problem is that... HP bar would seem always full and it would be hard to tell your real % to use steampunks... Just a crazy solution in case we can't avoid the death animation.

 

For now I must go to sleep, but it's a great step!! Tomorrow I'll do more testing if I have time. And the day after that I'll disappear 1 week and maybe I don't appear here, don't think I'll leave, just a vacation week xDD Thanks for everything!!

Link to comment
Share on other sites

So you never got it to teleport you to Doc Mitchell's house with this "PlayerRef.Moveto VCG01PlayerStartMarkerREF"

 

What does your script look like ? Plz copy / paste it here so I can look at it.

You can't simply copy paste my script , but guessing you knew that.

Link to comment
Share on other sites

Regarding the "Command: Let" error. Please see the GECKWiki "NVSE Error" page about possible causes.

 

The "GECK PowerUP" addon has been superseded by RoyBatterian's "GECK Extender". More functionality and more error messages.

 

Your should also check out 'TIP: Pre-load Scripts' of the wiki "Getting started creating mods using GECK" article.

 

-Dubious-

Link to comment
Share on other sites

Okay. I have this.

 

bde01ee010baacc82c59f1ed544449ab.png

 

I don't know why it doesn't work, but... IT'S HERE. Make the player essential. At death it falls unconscious. Then, I can cripple everything and teleport.

 

Tested and proved that the last part (crippling and teleport) works perfectly. Also tested that I have to make setUnconscious to 1 and then to 0 to wake up. The problem is that now it falls unconscious and nothing else happens. Maybe GameMode doesn't work in that state? Why nothing happens?

IT'S THERE, JUST ONE STEP AND IT'S THERE!

 

@dubious thanks, worth checking when I get errors. I'll check if the code gives errors in execution or if it's a logic error... I don't know. Confusing.

Edited by DarkKRaziel
Link to comment
Share on other sites

In this circumstance, my experience is "break down the compound conditionals" until it does work. The reason for this is that you HAVE to think about what is happening in every "ELSE" state even if you don't have it explicitly present. Often the problem is an implied "ELSE" that you failed to cover.

 

So (it would be preferable is you pasted your code in "code tabs" so we could copy it. See "How to markup images (etc) in forum posts and comments" article for how to use "code tags" :

 

Note: Edited pseudo-code logic.

IF dcbState == 0
  IF dcbTimer > 5 ; because test for largest values first. GT 0 would trigger for GT 5 values as well.
  ELSEIF dcbTimer > 0
  ELSE ; dcbTimer <= 0
ELSE ; dcbState <> 0
  IF dcbTimer > 5
  ELSE ; dcb <=5
  ENDIF
ENDIF

Once you have things working correctly you can rebuild your compound conditionals, and if they don't work you know it's because your test logic is off. My personal practice is to leave a comment about an implied ELSE statement so I can later recall just what I thought was happening in case something later on changes.

 

-Dubious-

Link to comment
Share on other sites

Ahh good thinking with that "SetEssential 7 1" Cuz I thought of setting the player essential for the death prevent ,but using ...

"SetEssential Player 1" would not compile.

 

However sad to say , I think setting the player essential is borking it. Near as I can tell with the testing I have done anyways.

 

The "GetKnockedState" registers and fires code because of it. But I think being essential will not let the player moveto.

Plus there is the weird freeze with only being able to look up or down , can't even look left / right.

 

I tried trimming stuff down in the .1 game mode block , then had it start another quest that ran a script at 1.0

Still same problem ... but here is the 2 scripts just for looksee haha ...

 

~~~~~~~~~~~~

SCN zzzDeathQuestScript
Short EssentialFlag
Begin GameMode
If EssentialFlag == 0
SetEssential 7 1
Set EssentialFlag to 1
If Player.GetKnockedState == 1
StartQuest zzzDeathTeleportQuest
;MyTrigBoxRef.Enable ; to run an arrival script with OnTriggerEnter Player
endif
endif
End
~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
SCN zzzDeathQuest02Script
short StopFlag
Begin GameMode
If StopFlag == 0
PlayerRef.StopCombatAlarmOnActor
PlayerRef.StopCombat
SetEssential 7 0
Set StopFlag to 1
If StopFlag == 1
PlayBink "Micro.Bik" ; an On death video to play instead of animations
PlayerRef.MoveTo VCG01PlayerStartMarkerREF ; Trig box here to run arrival script
endif
endif
End
~~~~~~~~~~~~~~~
I guess as you can see , I am leaning towards that arrival script , to do your cripple and what ever else.
Would be a one frame block of "OnTriggerEnter"
But ofcourse that doesn't matter much until we can get the player to teleport :confused:
Link to comment
Share on other sites

Thanks for all the help to both! This is going somewhere :laugh: I did some more testing, messed with the logic and... found the issue. "playerRef.getKnockedState" DOESN'T WORK!!! Comparing being == 1 or being <> 1. It doesn't check when we fall to the ground, so nothing triggers. We need another way to check if the player is on the ground.

 

This is my DEFINITIVE script (only one small issue)

 

 

 

scn deathCanBeSoCrippling
int dcbEssential
int dcbTimer
ref dcbWeapon
Begin GameMode
if dcbEssential == 0
setEssential 7 1
set dcbEssential to 1
endif
if isKeyPressed 52
set dcbTimer to dcbTimer + 1
else
set dcbTimer to 0
endif
if dcbTimer >= 3
setEssential 7 0
set dcbEssential to 0
playerRef.stopCombatAlarmOnActor
playerRef.setUnconscious 1
playerRef.setUnconscious 0
set dcbWeapon to playerRef.GetEquippedObject 5
playerRef.unequipItem dcbWeapon 0 1
playerRef.damageav rightMobilityCondition 100
playerRef.damageav leftMobilityCondition 100
playerRef.damageav rightAttackCondition 100
playerRef.damageav leftAttackCondition 100
playerRef.damageav enduranceCondition 100
playerRef.damageav perceptionCondition 100
playerRef.moveTo VCG01PlayerStartMarkerREF
endif
End

Basically:
- Turn the player essential so it turns unconscious at death.
- If you mantain the dot key for 3 seconds, you make the mod work (you can do it without being unconscious but there's no point)
- When you trigger the mod, turn off essential so the moveTo can work.
- Stops combats.
- Turns on and off unconscious so it can wake up.
- Unequip and equip weapon so it doesn't visually bugs (PENDING)
- Cripple everything.
- Teleport to doc's.
- It will re-apply essential after this.
Tested and working. Only fails to equip again the weapon. I cannot make it work. PlayerRef.equipItem with the "dcbWeapon" doesn't work, so after each death I have to manually re-equip the weapon. At least it unequips to avoid the bug. Any idea?
I know... having to mantain a key for each death is not "elegant" or "efficient" but as long as we don't have any way to "read" when we are unconscious, it's a nice try xDD The rest works perfectly (ºuo)
Edited by DarkKRaziel
Link to comment
Share on other sites

  • Recently Browsing   0 members

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