EMERGENCY SCRIPT HELP!

Post » Mon Nov 23, 2009 4:39 pm

I'm Having trouble with a script that I copy and pasted to notepad, then edited a bit to what I think was correct, i have tribunal as one of the parent masters in my mod and thats where the original script came from.

orig: act_changewater_-550_200 <-- or somewhere like that, then whenI edited it then tried to test it, the error message looks like this.

Script error EXPRESSION in AA_changewater

then

Right eval

both have question Continue running executable?

the script i have written/copied is as follows

begin AA_changewater

short changelevel
short crankturn
short currcrank
short initialized

float lowheight
float highheight
float newwaterlevel
float direction
float waterlift
float changerate

float targetheight
float current
float thischange

if ( initialized == 0 )
set lowheight to -128
set highheight to 1400
set changerate to 10
set initialized to 1
endif

if ( MenuMode )
return
endif

;always set angle to make up for different data
SetAngle X crankturn

set current to GetWaterLevel

if ( OnActivate == 1 )
if ( changelevel == 0 )
if ( current >= highheight )
set direction to -1
set targetheight to lowheight
else
set direction to 1
set targetheight to highheight
endif
set changelevel to 1
PlaySound3D "Dwemer Door Open"
endif
endif
if ( changelevel == 0 )
return
endif

set crankturn to 360 * GetSecondsPassed
set crankturn to crankturn * direction
set currcrank to GetAngle X
set crankturn to currcrank + crankturn

if ( current != targetheight )
set thischange to ( changerate * GetSecondsPassed )

if ( direction == 1 )
if ( thischange < 0 )
set thischange to ( thischange * -1 )
endif
set current to ( current + thischange )
if ( current > targetheight )
set current to targetheight
endif
else
if ( thischange > 0 )
set thischange to ( thischange * -1 )
endif
set current to ( current + thischange )
if ( current < targetheight )
set current to targetheight
endif
endif

SetWaterLevel current
endif


if ( direction == 1 )
if ( current >= highheight )
set changelevel to 0
endif
else
if ( current <= lowheight )
set changelevel to 0
endif
endif

end AA_changewater

please, im only a begginer at scripting and I NEED your help, kthnxbai :banghead:
User avatar
Hayley O'Gara
 
Posts: 3465
Joined: Wed Nov 22, 2006 2:53 am

Post » Mon Nov 23, 2009 11:05 am

I did not see any syntax or structural errors in your script. I copied it into the construction set attached it to an activator and tested it in game. The mod loaded without error and I activated the object wearing the script without error (unless you count that I attached it to a Tribunal shrine that began spinning endlessly like a propeller) - but no error messages.

Sometimes scripts are cursed. There is nothing to be done for it but to delete the original (after saving the code elsewhere) and create it anew. I cannot explain it, but I am always grateful when it works.

As for my test, Fargoth walked over to speak with me while my shrine was spinning. He stopped right over it resulting in Fargoth being perpetually battered by the spinning obelisk. I am thinking about releasing the mod :D I'll give you credit for the script.
User avatar
Steeeph
 
Posts: 3443
Joined: Wed Apr 04, 2007 8:28 am

Post » Mon Nov 23, 2009 2:28 pm

thats funny, but what it was supposed to do was change the waterlevel in the current cell. i have been working recently on it but all the scripts i make do not work
User avatar
Angus Poole
 
Posts: 3594
Joined: Fri Aug 03, 2007 9:04 pm

Post » Mon Nov 23, 2009 11:42 am

I know this is possible, i have seen it before! it needs to change the water cell in the current cell that it's in!
User avatar
Cathrine Jack
 
Posts: 3329
Joined: Sat Dec 02, 2006 1:29 am

Post » Mon Nov 23, 2009 12:41 pm

internal cell, right? just thought I'd get the big one out of the way...

ST the obvious
User avatar
Lyd
 
Posts: 3335
Joined: Sat Aug 26, 2006 2:56 pm

Post » Mon Nov 23, 2009 6:58 pm

yes, sorry, interior cells
User avatar
David Chambers
 
Posts: 3333
Joined: Fri May 18, 2007 4:30 am

Post » Mon Nov 23, 2009 11:47 pm

Only thing I can think of (and I am NOT an expert in this, only someone who has played around with scripting) is to take a look in the CS at the Mournhold quest in Sadri manor with the water level script:

this link explains the quest i you need further detail: http://www.gamebanshee.com/morrowind/locations/tribunal18blade.php

ST
User avatar
Emily Shackleton
 
Posts: 3535
Joined: Sun Feb 11, 2007 12:36 am

Post » Mon Nov 23, 2009 12:02 pm

I copied from that script as the original to make simple adjustments to it, (i.e. different water height)
but when I put it in my new dungeon, it doesn't do a thing, it only gives me an error message.
User avatar
Natasha Biss
 
Posts: 3491
Joined: Mon Jul 10, 2006 8:47 am

Post » Mon Nov 23, 2009 10:16 am

is there a way to tell the script to run in the cell that its in??
User avatar
Setal Vara
 
Posts: 3390
Joined: Thu Nov 16, 2006 1:24 pm

Post » Mon Nov 23, 2009 8:05 pm

BUMP: Any help out there??
User avatar
Silencio
 
Posts: 3442
Joined: Sun Mar 18, 2007 11:30 pm

Post » Mon Nov 23, 2009 6:00 pm

As I wrote last week there is nothing wrong with your script - it works perfectly well. When you have had a little more experience with the game editor you will learn to accept that sometimes perfectly good scripts fail when tested in game. It is an anomaly - an errant magnetic domain or something. Create a new script from scratch - do not attempt to edit or overwrite the current one - it (for lack of a better description) is corrupted. Create a new script and type the same code as you have in the original, attach it to your Dwemer crank and I expect that it will inexplicably work when you test it. You can delete the original script at your leisure.
User avatar
Minako
 
Posts: 3379
Joined: Sun Mar 18, 2007 9:50 pm


Return to III - Morrowind