Jump to content

Script Woes


krimzin

Recommended Posts

ok so I'm having issues with this script:

 

scn 0DeathScript

 

float playerhealth

float currenthealth

short doOnce

float fquestdelaytime

 

 

begin gamemode

if doonce == 0

set fquestdelaytime to 0.001

set playerhealth to player.getav health

set doonce to 1

endif

 

if player.getav health <= 18 && doonce == 1

player.moveto entermark 0 0

set doonce to 2

endif

 

if doonce == 2

player.resethealth

player.removeallitems playerstuff

player.saa 0.5

set doonce to 1

endif

end

 

Just to clarify in case you haven't figured it out, the script is supposed to make it so when your health gets to 18 or below you are sent to a location, your equipment is moved to a chest, your health reset, and your alpha level halved.

 

So far, I'm stuck at the "moveto entermark 0 0" spot. I go there, but then I can't move from there, or even look any other direction, and none of the other effects [Alpha, inventory, health] are applied. What am I forgetting to do.

Link to comment
Share on other sites

You are stuck in an endless loop.

 

if player.getav health <= 18 && doonce == 1 
player.moveto entermark 0 0
set doonce to 2  ; Goto second block
endif

if doonce ==  2 
player.resethealth
player.removeallitems playerstuff
player.saa 0.5
set doonce to 1  ; Since player.reset health does not fire and health will alway be <= 18, Goto first block. 
endif

 

As soon as you get to the place you have been moved to, you get moved there again and you can't leave. People would argue with me for saying this, but Oblivion scripting language generally does not work and is very unreliable. There are so many ifs, ands, and buts, that it does not seem logical. It seems more like magic, and you just fiddle around until you chance upon a combination that works.

 

To stop the endless loop, you could change your doonce value to a better one in the second block in my quote.

 

set doonce to 3 

 

Now your commands should be executing, but they aren't. To misquote a song, "There is no use trying to argue, Oblivion just don't understand." Begin GameMode blocks will give you fits. You might try changing the order or the command given.

 

if player.getav health <= 18 && doonce == 1
player.resethealth
player.removeallitems playerstuff
player.saa 0.5
player.moveto entermark 0 0
set doonce to 2
endif

; if doonce == 2
; set doonce to 3
; endif
end

 

It might be that "player.resethealth", "player.removeallitems playerstuff", and "player.saa 0.5" are commands which never or almost never trigger in a Begin GameMode block.

 

You could run a test with a simpler script to see if it is possible to ever make these commands execute under any condition in a Begin Gamemode block.

 

You may want to just cut out that part of the script and have a second script:

 

SCN ODeathScript2

; Object script applied to a bone with a custom form ID hidden inside a nearby rock 
; where the gamer can't see it.

Short DoOnce

Begin GameMode
    If Getdistance Player < 1000 && DoOnce == 0
         player.resethealth
         player.removeallitems playerstuff
         player.saa 0.5
         Set DoOnce to 1
    EndIf
End

Link to comment
Share on other sites

actually, i figured it out on my own yesterday cuz my internet was down. Is what I did was make the quest script add a magic ability which had the actual script only as a magic effect script and for some reason taking out all of the doonce conditions, it worked just great. Oblivion is an odd lass, but occasionally you can figure out what she wants. Now I'm going to work on making the container into a quest object dead skeleton that moves to where the player dies and is named &pcname;'s Corpse, which will of course take the player's gear upon death, however, instead of simply returning it once the player returns from their afterlife, they need to find their original corpse and get their gear back. So hopefully the old girl can process such a large block of script.
Link to comment
Share on other sites

Gah! &pcname; only works for Fo3?! This is blasphemy, this is madness! How can I do what &pcname; does in fallout 3 in Oblivion. [it inserts the player's name in it's place]
Link to comment
Share on other sites

lol, again I beat you to the punch. sorry. Yup, for now Your Corpse will do. But I know it's possible, I believe I would need Pluggy. Kiyoma's Journal mod adds a journal with the player's name in it's title, so there's hope. I just gotta figure out how the hell they did it
Link to comment
Share on other sites

  • Recently Browsing   0 members

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