Distance script

Post » Fri May 27, 2011 2:44 am

I'm currently making a mod which makes some stuff harder.

I want to make a skeleton revive when the player goes near to it.

How can I do this, this dosen't seem to work:

*Begin gamemode
*
*if player distance >= 10
*resurrect 1
*Endif
*End

I need something to replace 'distance'; can anyone help?
User avatar
Nick Tyler
 
Posts: 3437
Joined: Thu Aug 30, 2007 8:57 am

Post » Fri May 27, 2011 8:50 am

EDIT:

use b3w4r3's script in the next post instead.
User avatar
Mike Plumley
 
Posts: 3392
Joined: Wed Sep 05, 2007 10:45 pm

Post » Fri May 27, 2011 9:05 am

With getdistance player >= 10 the skeleton will resurrect as soon as the cell is loaded even if he is very far away. You will probably want to use somethin more like

short onceif once == 0if getdead if getdistance player < 600; this can be adjusted   resurrect 1   set once to 1endifendifendif

User avatar
oliver klosoff
 
Posts: 3436
Joined: Sun Nov 25, 2007 1:02 am

Post » Fri May 27, 2011 1:16 pm

short onceif once == 0if getdead if getdistance player < 600; this can be adjusted   resurrect 1   set once to 1endifendifendif


Thanks, that was exactly what I was looking for! :dancing:
User avatar
Penny Flame
 
Posts: 3336
Joined: Sat Aug 12, 2006 1:53 am

Post » Fri May 27, 2011 12:29 pm

short onceif once == 0if getdead if getdistance player < 600; this can be adjusted   resurrect 1   set once to 1endifendifendif


Thanks, that was exactly what I was looking for! :dancing:

Keep in mind that this won't work right if the actor was initially dead when placed in the CS.
User avatar
Brooks Hardison
 
Posts: 3410
Joined: Fri Sep 07, 2007 3:14 am

Post » Fri May 27, 2011 5:05 am

Keep in mind that this won't work right if the actor was initially dead when placed in the CS.

Oh, so how can I make it so that it will work when initially dead, because it's like a room with corpses that are revived upon entering the room, however the room is not a new cell, thanks in advance :dancing:
User avatar
louise fortin
 
Posts: 3327
Joined: Wed Apr 04, 2007 4:51 am

Post » Fri May 27, 2011 3:20 am

Oh, so how can I make it so that it will work when initially dead, because it's like a room with corpses that are revived upon entering the room, however the room is not a new cell, thanks in advance :dancing:


Then you will probably need to set the creatures health before using resurrect, see how this works.
if once == 0if getdeadif getdistance player < 600; this can be adjusted   setav health 100 ;or whatever you want   resurrect 1   set once to 1endifendifendif

User avatar
Emmanuel Morales
 
Posts: 3433
Joined: Sat Oct 06, 2007 2:03 pm

Post » Fri May 27, 2011 2:01 am

Yup it works fine now! :dancing:
User avatar
Inol Wakhid
 
Posts: 3403
Joined: Wed Jun 27, 2007 5:47 am


Return to IV - Oblivion