Jump to content

Scripting Problems


kungfubellydancer

Recommended Posts

Can someone take a look at these scripts and tell me what's wrong? When loaded in the game, the first script does not work at all, but gives me no error messages either.

 

begin kfbd_bedteleportscript832

 

short onactivate

 

if ( OnActivate == 1 )

Player->PositionCell, 3532, 4011, 553, 270, "land of nightmares, phase one"

MessageBox "You fall asleep in the bed. You start to dream."

endif

 

end

 

Here is the second one. It gives me an error message about EXPRESSION and Right (or left) Eval upon entering the cell, and does not work either.

 

begin kfbd_littlegirldeadscript

 

short onactivate

 

if [ onactivate == 1 ]

return

endif

 

if [ ondeath == 1 ]

player->positioncell 3855, 4076, 15401, 0, "apnea, meanin's house"

messagebox "You begin to wake up from your nightmare."

journal kfbd_ap_journal_nightmare 20

endif

 

end

 

Link to comment
Share on other sites

Some of the GetFoo and OnFoo statements are variables that must be declared in your code, but most of them are functions, which don't need to be declared anywhere. OnActivate and OnDeath are both in the latter category, so by declaring one in your code, you're effectively overriding it with a variable that's always equal to zero.

 

Also, conditions and the like need to be delimited by parentheses. Putting them in square brackets instead is just the sort of thing that's bound to set off Morrowind's catch-all "eval" errors.

 

There are a couple of smaller issues, which may or may not cause problems. Post back here if

  • kfbd_bedteleportscript832 teleports you, but doesn't display a message; or
  • kfbd_littlegirldeadscript doesn't teleport you at all sometimes, but always prevents you from searching the girl's corpse.

Link to comment
Share on other sites

Okay, here are my results. I made the bed script what is posted in blue below, and it gave me an error about EXPRESSION and Righteval upon entering the cell. If I remove the short, there is no error message but the script doesn't work either.

 

begin kfbd_bedteleportscript832

 

short OnActivate

 

if ( OnActivate == 1 )

Player->PositionCell, 3532, 4011, 553, 270, "land of nightmares, phase one"

MessageBox "You fall asleep in the bed. You start to dream."

endif

 

end

 

The girl script was changed to what is posted below, and it worked, even though I declared the OnActivate.

 

begin kfbd_littlegirldeadscript

 

short onactivate

 

if ( onactivate == 1 )

return

endif

 

if ( ondeath == 1 )

player->positioncell 3855, 4076, 15401, 0, "apnea, meanin's house"

messagebox "You begin to wake up from your nightmare."

journal kfbd_ap_journal_nightmare 20

endif

 

end

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...