Jump to content

Photo

Problems with scripting a statue to crumble.


  • Please log in to reply
1 reply to this topic

#1
JdeRau

JdeRau
  • Members
  • Pip
  • Curate
  • Joined: 28-March 09
  • 478 posts
  • Location:Durban, South Africa
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 0
StartQuest {NameOfYourNewQuest}
Set {NameOfYourNewQuest}.fQuestDelayTime to .1

End

This is the script attached to the quest that I suggested to animate the dust cloud:
ScriptName {NameOfYourNewQuest}Script

Float fQuestDelayTime

Begin GameMode

If GetSecondsPassed < 5
  Return
Else
  MessageBox "Animation Started"
  {ReferenceIDOfGroundHitDustCloud}.playgroup forward 0
  StopQuest {NameOfYourNewQuest}
EndIf

End

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.

#2
Phitt

Phitt
  • Members
  • PipPipPipPip
  • Master
  • Joined: 05-May 06
  • 5142 posts
  • Location:Rain forest
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 done
float timer

Begin OnDeath

{ReferenceIDOfStatue}.playgroup unequip 0
set done to 1
set timer to 5

End

; ---------------------------------------------------

begin gamemode

if done == 1

set timer to timer - getsecondspassed

  if timer < 0

  MessageBox "Animation Started"
  {ReferenceIDOfGroundHitDustCloud}.playgroup forward 0
  set done to 2

  endif

endif

end



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users