"LoadDoorRef.activate player" ISSUE

Post » Fri Dec 02, 2011 7:00 am

When I activate a load door :

LoadDoorRef.activate player

The load door then becomes "unactivatable". By that I mean the player cannot activate it again the normal way. Has anyone had experience with this issue?
User avatar
Britney Lopez
 
Posts: 3469
Joined: Fri Feb 09, 2007 5:22 pm

Post » Fri Dec 02, 2011 5:19 am

Use "LoadDoorRef.activate player 1"

This is a known bug of the Activate function. (check http://cs.elderscrolls.com/constwiki/index.php/Activate)

I've never tested it with doors, but it makes sense that the problem is the same.
User avatar
MARLON JOHNSON
 
Posts: 3377
Joined: Sun May 20, 2007 7:12 pm

Post » Fri Dec 02, 2011 3:09 pm

This worked like a charm, THANKS! ...but I do not understand why it works.

I read the wiki 5 times plus the other page on"discussion" about the article and I still do not get it.

Can you explain what this flag is exactly and what is the disadvantage of using it?

I think it has to do with activating the door without activation the scripts on the door.

So I do a check first on the door to see if it is scripted, and will not allow the auto activate if it is a scripted door.


Use "LoadDoorRef.activate player 1"

This is a known bug of the Activate function. (check http://cs.elderscrolls.com/constwiki/index.php/Activate)

I've never tested it with doors, but it makes sense that the problem is the same.

User avatar
Amy Gibson
 
Posts: 3540
Joined: Wed Oct 04, 2006 2:11 pm

Post » Fri Dec 02, 2011 9:27 am

I suppose the original purpose was just what the name of the flag, "RunOnActivateBlock", implies: to be able to activate an object with a choice of running or not running its OnActivate block.

But the function came out buggy and causes the problem you experienced if you tell it not to run the OnActivate block and there is no OnActivate block in the first place (or no script at all).

My guess is that, by skipping the non-existing OnActivate block processing, the engine also skips some other process that should not be skipped (like some code to put some internal things back in place or some data cleanup code), therefore leaving some dirty/wrong data behind, which will cause problems the next time it is needed (like doors and containers not opening or NPCs not responding).

Using RunOnActivateBlock = 1 has no problems, as far as I know.

So, the recommendation is ALWAYS use this flag set to 1, unless, of course, you actually need its original purpose, i.e., for some reason you don't want AN EXISTING OnActivate code to run.

One legitimate reason we use all the time is the plain "Activate" (the flag defaults to 0) used within the OnActivate block. In this case, the OnActivate block always exists and there is no bug involved.
User avatar
roxanna matoorah
 
Posts: 3368
Joined: Fri Oct 13, 2006 6:01 am

Post » Fri Dec 02, 2011 10:10 am

WAIT...So I do not have to check to see if the door has a script? using "Activate 1" will run the door script just fine or if the door has no script it will not hurt anything? :hehe:

So, the recommendation is ALWAYS use this flag set to 1, unless, of course, you actually need its original purpose, i.e., for some reason you don't want AN EXISTING OnActivate code to run.

One legitimate reason we use all the time is the plain "Activate" (the flag defaults to 0) used within the OnActivate block. In this case, the OnActivate block always exists and there is no bug involved.

User avatar
Alina loves Alexandra
 
Posts: 3456
Joined: Mon Jan 01, 2007 7:55 pm

Post » Fri Dec 02, 2011 5:10 pm

WAIT...So I do not have to check to see if the door has a script? using "Activate 1" will run the door script just fine or if the door has no script it will not hurt anything? :hehe:

Exactly!
User avatar
Dina Boudreau
 
Posts: 3410
Joined: Thu Jan 04, 2007 10:59 pm


Return to IV - Oblivion