Initiating a timer to kill the player

Post » Wed Apr 24, 2013 5:43 pm

I have a room that is supposed to be filled with poisonous gas, and after 5 minutes, the should player will keel over and die.

I want this timer to initiate when the player runs through a trigger box. I thought I had an idea of how to do it, but at this point, I've all but given up. What's the best way to go about doing this? This is what I have thus far:

I have this poison script, which complies fine:

int timer = 0Function BeginPoisoned()timer = 0GotoState("Poisoned")RegisterForUpdate(PoisonTick)EndFunctionFunction EndPoisoned()GotoState("")UnregisterForUpdate()EndFunctionState PoisonedEvent OnUpdate()  PoisonHitImod.Apply(3)  timer += PoisonTick  if (timer > DeathTime)   PlayerRef.Kill()  endifEndEventEndState

I can't figure out how to make my quest call this script correctly. I looked through some other quests and I tried to define this script within the master script of my quest like so:

HVGQ06PoisonScript Property HVGPoisonStartTest Auto

I am able to assign the script to a property. I try to call this script by adding:

HVGQ06PoisonScriptTest.BeginPoisoned

I add this to one of my quest stages, but when I go to compile this script fragment, the one that is supposed to call my function, I get this error:


variable HVGQ06PoisonScriptTest is undefined

none is not a known user-defined type

I don't know where to go with this. I've checked with the quests that I'm trying to copy from and it seems like it should work. Any / all help is appreciated.
User avatar
Eddie Howe
 
Posts: 3448
Joined: Sat Jun 30, 2007 6:06 am

Post » Wed Apr 24, 2013 7:54 pm

blah delete this
User avatar
aisha jamil
 
Posts: 3436
Joined: Sun Jul 02, 2006 11:54 am

Post » Wed Apr 24, 2013 10:10 pm

variable HVGQ06PoisonScriptTest is undefined

Didn't you define your property as "HVGPoisonStartTest"

Also I think you can use the "kMyQuest" here so you don't even have to set it as a property. In the drop down menu you can select the script and then you can simply do

kmyquest.BeginPoisoned
User avatar
Shianne Donato
 
Posts: 3422
Joined: Sat Aug 11, 2007 5:55 am

Post » Wed Apr 24, 2013 12:00 pm

Didn't you define your property as "HVGPoisonStartTest"

Also I think you can use the "kMyQuest" here so you don't even have to set it as a property. In the drop down menu you can select the script and then you can simply do

kmyquest.BeginPoisoned

Would you mind describing what the kmyQuest thing does?

Also, I knew I was making a dumb mistake. Thanks for helping me realize what it was!
User avatar
Misty lt
 
Posts: 3400
Joined: Mon Dec 25, 2006 10:06 am


Return to V - Skyrim