What is wrong with this script?

Post » Mon Sep 14, 2009 3:46 am

I have this script on a door...It doesn't do anything at all. Why?
It's supposed to play a sound when the player gets close to the door (I don't know how the distance works. Can someone explain that?) and show a message box like someone is screaming, and only do this once.

begin FirthaScreamshort DoOnceif ( DoOnce == 1 )	messageBox "I've done this before." ;TESTINGendifif ( DoOnce == 0 )	if ( GetDistance, player == 200 ) ; Maybe this is the problem?		PlaySound "BM Nord attackF"		messageBox "Hedron! Heeeedron! Help!"		set DoOnce to 1	endifendifEnd

User avatar
Abi Emily
 
Posts: 3435
Joined: Wed Aug 09, 2006 7:59 am

Post » Sun Sep 13, 2009 4:50 pm

if ( GetDistance, player == 200 ) ; Maybe this is the problem?

Since GetDistance returns a float, it's better to use < or > to compare instead of ==. Does it work better if you use '<'?

It's better to use == with integral values.
User avatar
Nuno Castro
 
Posts: 3414
Joined: Sat Oct 13, 2007 1:40 am

Post » Mon Sep 14, 2009 9:21 am

Since GetDistance returns a float, it's better to use < or > to compare instead of ==. Does it work better if you use '<'?

It's better to use == with integral values.


Yes that worked. Thank you.

I have another question and then I think that's it. When I start the game I have the player starting out on a boat in a town I created. Several people and creatures need to be dead in the town. They die just fine of course :laugh: but it really kills the mood of the town when EVERYTHING that is supposed to be dead screams and flops to the ground. Can I kill these off before the player spawns on the boat?
User avatar
Scott Clemmons
 
Posts: 3333
Joined: Sun Sep 16, 2007 5:35 pm

Post » Mon Sep 14, 2009 12:43 am

I have another question and then I think that's it. When I start the game I have the player starting out on a boat in a town I created. Several people and creatures need to be dead in the town. They die just fine of course :laugh: but it really kills the mood of the town when EVERYTHING that is supposed to be dead screams and flops to the ground. Can I kill these off before the player spawns on the boat?

I've seen other mods do this too. It's does kill the mood.

One way to handle this would be to use a scripted FadeIn so the player's view is blank and doesn't see anything for a second until the fadein finishes. Then the corpses will be in place. For not hearing screams you could just extend the idea: black out the screen, position the player very far away from the corpses (perhaps very high in the air), but still in the cell, wait a second, move the player to final position and then fade in.

But maybe there is a better way to do it than that.
User avatar
michael flanigan
 
Posts: 3449
Joined: Thu Jun 14, 2007 2:33 pm

Post » Mon Sep 14, 2009 5:59 am

I have another question and then I think that's it. When I start the game I have the player starting out on a boat in a town I created. Several people and creatures need to be dead in the town. They die just fine of course :laugh: but it really kills the mood of the town when EVERYTHING that is supposed to be dead screams and flops to the ground. Can I kill these off before the player spawns on the boat?
IIRC, first thing to try is ticking "Corpses persist" in the NPC/creature dialog box.
User avatar
Katharine Newton
 
Posts: 3318
Joined: Tue Jun 13, 2006 12:33 pm

Post » Mon Sep 14, 2009 5:52 am

Corpses persist did the job.
User avatar
Russell Davies
 
Posts: 3429
Joined: Wed Nov 07, 2007 5:01 am


Return to III - Morrowind