Script help please

Post » Sat May 28, 2011 2:50 am

Hey there,

So I have a script that has a gethealth function at the bottom of it. The script is placed on a creature.

Basically when the creature dies I want the creature to disable and play effects. The first part of the script deals with the creatures AI while the mid part deals with its timer (its part 2 of a summon script)

the final part is suposed to deal with the fact that if the crreature dies, it then "disappears" - i.e becomes unsummoned.

but the end bit doesnt seem to work...

begin sm_FH_AIScript

float timer
short count
short doOnce

if ( doOnce == 0 )
aifollow, player, 0, 0, 0, 0
PlaceAtMe sprigganup 1 1 1 ; Visual effect
set doOnce to 1
endif

if ( GetDisabled == 1 );the creature has been disabled
set count to ( count + 1 )
if ( count == 5 )
DontSaveObject;make sure it isn't saved (duh!)
SetDelete, 1;delete it from current game
endif
endif

if ( MenuMode == 1 );make sure it doesn't count during inventory and dialogue
Return
endif

set timer to ( timer + GetSecondsPassed )
if ( timer < 30 );don't do anything until 30 seconds have passed
return
endif

PlaceAtMe sprigganup 1 1 1 ; Visual effect
Disable

if ( Gethealth == 0 )
PlaceAtMe sprigganup 1 1 1
Disable
endif

end

User avatar
Kara Payne
 
Posts: 3415
Joined: Thu Oct 26, 2006 12:47 am

Post » Fri May 27, 2011 7:21 pm

never mind - I have figured it out :D (one of those rare moments when I have the clarity to see a mistake in a script! - just needed to put the gethealth function about the timer)
User avatar
Channing
 
Posts: 3393
Joined: Thu Nov 30, 2006 4:05 pm


Return to III - Morrowind