Problems with scripting a statue to crumble.

Post » Fri May 27, 2011 12:37 pm

Hello everyone.

Basically, someone on The Nexus Forums wanted to make a copy of the Mehrunes Dagon statue in Lake Arrius caverns and use it in their own shrine. Then this person wanted someone to help them script the statue so that it collapsed when the high-priest of that shrine was killed. I decided to help the person and provided a working script that made the statue collapse.

This person then wanted a way of making a dust cloud appear when the statue hit the ground (one such cloud was in Lake Arrius caverns). I tried making a script that would make this cloud animate when the statue hit the ground but my attempts at making this script didn't work at all. I am baffled as to why the script failed to work properly. As far as I can see, the script should be working, but I guess I'm wrong. Here are the scripts I provided:

This is the script attached to the high priest:
ScriptName {WhateverNameYouWantInOneWord}Begin OnDeath{ReferenceIDOfStatue}.playgroup unequip 0StartQuest {NameOfYourNewQuest}Set {NameOfYourNewQuest}.fQuestDelayTime to .1End


This is the script attached to the quest that I suggested to animate the dust cloud:
ScriptName {NameOfYourNewQuest}ScriptFloat fQuestDelayTimeBegin GameModeIf GetSecondsPassed < 5  ReturnElse  MessageBox "Animation Started"  {ReferenceIDOfGroundHitDustCloud}.playgroup forward 0  StopQuest {NameOfYourNewQuest}EndIfEnd


In the quest script, I have that message box command to debug but that message never appears and I can't work out why. Can anyone tell me what is wrong with this script? Your help will be greatly appreciated.
User avatar
john page
 
Posts: 3401
Joined: Thu May 31, 2007 10:52 pm

Post » Fri May 27, 2011 7:32 pm

GetSecondsPassed returns the amount of time passed since the last frame. That means unless you play the game on a C64 it will always return less than 5. You need to make a timer. I also wonder why you use a quest script. Scripts keep running on dead actors as well. You can of course use a quest script, but I don't think it is really needed in this case to make two new entries (one for the script and one for the quest). Try this:

ScriptName {WhateverNameYouWantInOneWord}short donefloat timerBegin OnDeath{ReferenceIDOfStatue}.playgroup unequip 0set done to 1set timer to 5End; ---------------------------------------------------begin gamemodeif done == 1set timer to timer - getsecondspassed  if timer < 0  MessageBox "Animation Started"  {ReferenceIDOfGroundHitDustCloud}.playgroup forward 0  set done to 2  endifendifend

User avatar
Joanne Crump
 
Posts: 3457
Joined: Sat Jul 22, 2006 9:44 am


Return to IV - Oblivion