Trouble with OnActivate

Old and generally outdated discussions, with the rare hidden gem. Enter at your own risk.

Moderators: Haplo, Lead Developers

Locked
Starcrunch
Developer Emeritus
Posts: 1649
Joined: Tue Aug 17, 2004 5:12 am
Location: DC, USA

Trouble with OnActivate

Post by Starcrunch »

I have been writing a script, and have had lots of trouble with the command OnActivate, infact copy-and-pasting a Beth. made script and saving it results in EXPRESSION errors. Even the following test script results in such errors upon entering a cell where the script is running.

Code: Select all

Begin Test

if ( OnActivate == 1 )
   MessageBox "Activate"
endif

end
I have never come across this sort of problem before, can anyone provide advice?

-Starcrunch
Noirgrim
Developer Emeritus
Posts: 2695
Joined: Thu Aug 21, 2003 11:36 am
Location: Chicago, IL

Post by Noirgrim »

What is the script on (attached to)?
"Noirgrim, (who is accused of working too hard) is the worst kind of modder this project can get." -Ender
Starcrunch
Developer Emeritus
Posts: 1649
Joined: Tue Aug 17, 2004 5:12 am
Location: DC, USA

Post by Starcrunch »

It does not matter...after encountering the problem I made this test script and tried to attach it to continers, doors, misc. objects, everything. All of them give this error when I enter a cell where the script runs. I don't believe there is anything wrong with the script itself but something is not being compiled correctly. If I for instance recompile the script associated with beds then all beds will give this error (as they use OnActivate).

-Starcrunch
Noirgrim
Developer Emeritus
Posts: 2695
Joined: Thu Aug 21, 2003 11:36 am
Location: Chicago, IL

Post by Noirgrim »

Man, I have no idea, it's such a simple script, and there's nothing wrong with it as you said. Wanna post the esp file?
"Noirgrim, (who is accused of working too hard) is the worst kind of modder this project can get." -Ender
Starcrunch
Developer Emeritus
Posts: 1649
Joined: Tue Aug 17, 2004 5:12 am
Location: DC, USA

Post by Starcrunch »

I will if I have not solved it by tommorow I will post the esp file, I have to bring it from home to a computer that is online.

-Starcrunch
User avatar
Colostriph
Member
Posts: 274
Joined: Wed Nov 10, 2004 3:27 pm

Post by Colostriph »

You aren't attaching this to an Npc to force dialogue right?

Anyhow, what exactly is in the message box?
Starcrunch
Developer Emeritus
Posts: 1649
Joined: Tue Aug 17, 2004 5:12 am
Location: DC, USA

Post by Starcrunch »

This was a test script that fails. The message box is just some text that will appear. The purpose of this script was to show that there was general trouble with the OnActivate command (alternaively if Beth. made scripts are recompiled they fail in the same way if they use the OnActivate command). It does not matter what I apply it to, the result is an error.

-Starcrunch
User avatar
Argoth
Developer
Posts: 98
Joined: Mon Aug 30, 2004 1:43 pm

Post by Argoth »

Hmm... That's odd.
I think that the error you are getting is something that you would get if you were using a variable that you hadn't declared...
But OnActivate isn't a variable, it is a function. This sounds more like a bug in the TES editor, if you can't figure it out I'd take it to the official beth forums....
Starcrunch
Developer Emeritus
Posts: 1649
Joined: Tue Aug 17, 2004 5:12 am
Location: DC, USA

Post by Starcrunch »

OK I have investigated this problem further. I have created a simple script like the one above and placed it on an object in the census and excise office (my test character is in Seyda Neen). I made and compiled this plugin with just Morrowind loaded, then made a new version with Tribunal added, and a new version with Bloodmoon added, then finally a version with map1v67 added (my script is for a quest so I had been making it with this loaded). The three plugins made with just the master files functioned fine, the one made with map1 loaded as well failed (with the EXPRESSION error). Taking that plugin and loading it without map1 and recompiling the script (no chages) solved the problem. Included are the failed plugin and the one the worked with al three masters loaded.

I have devised a work around that has allowed me to fix the script I am using in the quest:

1.) Load the quest without map1 setting no active files. This will usually generate errors, and you need to include at least all of the objects referenced by your script (it may be necessary to intentionally "dirty" your plugin).
2.) Recompile the script!
3.) Save (you will create a new mod with just the script)
4.) Quit the editor and load Map1, quest, and script plugins and playtest in game, readjust the script as needed.
5.) Merge quest and script. If the script is recompiled after this stage the error becomes manifest.
6.) Make sure the merger was successful.

This error may only occur on my computer and I do not understand it at all, it would be nice if somwone could see if this problem is general.

-Starcrunch
User avatar
Majra
Developer Emeritus
Posts: 1871
Joined: Fri Jan 16, 2004 3:23 am
Location: Darvulk Haven Elsweyr
Contact:

Post by Majra »

what did you name the script

you named it test it seems... the issue may be as simple as another script already named test. This is why I say make all names atleast unique enough
R:6 I:22 N:30
Screw it, I'm back for sweet sweet TR

Uldar Gerzae: Expect no dodgeballs out of my arse. Though if something were to shoot out of me nether regions it mgiht be wise to dodge it all the same
Starcrunch
Developer Emeritus
Posts: 1649
Joined: Tue Aug 17, 2004 5:12 am
Location: DC, USA

Post by Starcrunch »

The scripts are called test_BM and test_M1, IIRC. The problem also occured in scripts named TR_m1_Redram_1, TR_m1_Redram_2, TR_m1_test, and a few other names I tried while examining this problem. Plus it is rather easy to determine if a script name is taken...

-Starcrunch
Starcrunch
Developer Emeritus
Posts: 1649
Joined: Tue Aug 17, 2004 5:12 am
Location: DC, USA

Post by Starcrunch »

Uldar has discovered the cause of this problem, and I posted a fix in Map 1 error reporting (the script causing problems had a logical error in addition to the one causeing this problem). Noir has fixed this and posted a new version of map 1 solving this problem.

Case closed,
-Starcrunch
Stalker
Developer Emeritus
Posts: 4576
Joined: Fri Apr 09, 2004 9:12 pm
Location: Ukraine
Contact:

Post by Stalker »

And somebody said that we don't need script reviewers... They either work or don't work. Sounds simple, eh ?
[img]http://img430.imageshack.us/img430/3336/oblivionforum5tb.jpg[/img]

Your friendly slavedriver.
Assassinace
Developer
Posts: 811
Joined: Thu Aug 21, 2003 10:56 am
Location: Dreamland

Post by Assassinace »

heh whoever said that never scripted anything more then one module in size. Thankfully most code in Tescs is really short and doesn't interconnect.
Stalker
Developer Emeritus
Posts: 4576
Joined: Fri Apr 09, 2004 9:12 pm
Location: Ukraine
Contact:

Post by Stalker »

So maybe now core will recosinder their view on script reviewers ?
[img]http://img430.imageshack.us/img430/3336/oblivionforum5tb.jpg[/img]

Your friendly slavedriver.
Assassinace
Developer
Posts: 811
Joined: Thu Aug 21, 2003 10:56 am
Location: Dreamland

Post by Assassinace »

Currently I see no real need to. There isn't enough script being claimed and implemented for it to be worth it right now (IMO of course and I could be wrong since I haven't been around.) At any rate that discussion is for the core and this script has been fixed. (Even though it wasn't technically this script.)
Starcrunch
Developer Emeritus
Posts: 1649
Joined: Tue Aug 17, 2004 5:12 am
Location: DC, USA

Post by Starcrunch »

Well the OnActivate error was in a 10 line script with 2 lines that made it impossible to use the commands OnActivate and OnDeath, and additionally the script would never function as it was intended as they used the wrong command for what they were trying to do. I think a better idea might be to have people make sure that they tell us if they have a new script in their claim, that way when it is reviewed it becomes the job of the reviewer to determine if the script works properly. Of course then you need reviewers who know how to script to review those claims.

EDIT: if I'd reviewed the bogus script I'd have spent 10 min on this problem instead of two days plus of time lost in working on TR. Add to that the time Uldar spent working on this problme and the time Noirgrim spent not getting his scripts to work and not knowing what was going on and I think we can see the need to do something to ensure that this sort of thing does not occure again.

-Starcrunch
Assassinace
Developer
Posts: 811
Joined: Thu Aug 21, 2003 10:56 am
Location: Dreamland

Post by Assassinace »

How did the claim pass if there was a script that didn't work in the claim. Don't people at least list what scripts in thier claims do so people can check if they work? (Apparently I need to check out the review process).
Starcrunch
Developer Emeritus
Posts: 1649
Joined: Tue Aug 17, 2004 5:12 am
Location: DC, USA

Post by Starcrunch »

I have no idea, but I have seen at least one claim come across my desk that had a script that was not declared to have any (the one I can think of failed review). Most people don't write readme files anymore which makes it even more difficult especially if the person performing the review does not know how to script. The script in question would not result in error messages in game, and to discover it was not working the playtester would have to kill an NPC they had no reason to kill. The script was supposed to prevent the player from looting the body of an armless khajiit slave, because the armless affect was generated by a gauntlet, and the maker had to hide this from the player somehow.

-Starcrunch
Assassinace
Developer
Posts: 811
Joined: Thu Aug 21, 2003 10:56 am
Location: Dreamland

Post by Assassinace »

well I did what I could to try and clear this type of problem up. We'll see what happens.
Locked