Jump to content

A scripting question


JoKelly

Recommended Posts

I have a script that is supposed to perform an action on several actors. The actors are disabled till the setstage, the script I am using on the actors begins on load.

 

From what I have read though, on load will not run on disabled actors or anything disabled. if the actors are enabled via a script trigger will the on load function as soon as they are enabled.

Link to comment
Share on other sites

I think so. If I recall correctly, the mannequin in my Enterprise Abode mod worked this way in my testing. It could be disabled/enabled with a switch and had an OnLoad script to disable ai and reset its position when you entered the cell, which also seemed to fire every time I enabled it via the switch.

Link to comment
Share on other sites

ElfyPers0n, on 01 Jan 2017 - 1:27 PM, said:

I think so. If I recall correctly, the mannequin in my Enterprise Abode mod worked this way in my testing. It could be disabled/enabled with a switch and had an OnLoad script to disable ai and reset its position when you entered the cell, which also seemed to fire every time I enabled it via the switch.

great, thanks. I thought I would ask before spending half a night fighting the GECK then find out it wasn't possible. LOL

Edited by JoKelly
Link to comment
Share on other sites

WoW ... I am totally confused ... but then again you're the one that needs to know stuff according to this thread. Not me

 

So I guess I ask out of curiosity

ask?

 

Trust me I manage to confuse myself at the best of times. then I spend three hours argueing with myself, then finally I ignore me for three more hours which is hard to do since I tend to follow myself from room room just to annoy me.

Link to comment
Share on other sites

  • 2 years later...

How do you enable them??!? Their own script doesn't seem to work when they are disabled, so they can't self-enable, and whenever I try and use another enabled character's script to enable them, I am not permitted to do so.

However, this DOES work in the console, using the actual number of the thing I want to enable. But since this number varies according to the load order of modifications, I can't do that - assuming that would even work anyway.

I've had this problem repeatedly. Things work fine typed into the console while the game is running, but if it is written in a script then it's completely random whether or not it works.

 

Ahhhhh....... I think I see the problem now. There's an EDITOR ID and also a REFERENCE EDITOR ID. You can't enable the actual thing, you can only enable the copy of it which exists in the world - of which of course there can be multiple, so you can do something different with each one.

 

UUUGGGGHHHHHH Complete waste of time. I even watched someone else do it in a video, and it worked for them, but when I copied everything they did absolutely precisely it wouldn't work for me. Their little "NAME.enable" script saved, but mine wouldn't because that "NAME.enable" command was preventing it.

 

1. Place object in world

2. Give it unique name "objectref"

3. Add a script to an activator...

 

scriptname NAMEOFSCRIPT

 

begin OnTriggerEnter player

objectref.enable

end

 

Person A: No error

Person B: ERROR: "objectref.enable"

 

:/

Edited by ALoonwolf
Link to comment
Share on other sites

Reference variables (like "objectref") must be "defined" and assigned a value before they can be used in a command. This often occurs in one of the script types that are executed before the one you are looking at in the moment. It may also be "implied" as the caller of the current Event/Action Block. But don't assume they are: verify if your script won't save.

 

Please see 'TIP Reference Variables explained' under the "GECK Form-ID Base-ID Ref-ID and Editor-ID", and 'TIP Best Practice Sharing Variables between Scripts' along with the Introduction to the "Scripting" section of the wiki "Getting started creating mods using GECK" article.

-Dubious-

Link to comment
Share on other sites

What you ought to do, rather than enabling each actor, set the placed actor references to have the same parent reference, a dummy object you place in the cell. Then when you want the actors to be enabled, just enable the parent reference in your script. I.E

 

actorrefParent.Enable()

 

See the geck wiki page: https://geckwiki.com/index.php?title=Reference#Enable_Parent

Link to comment
Share on other sites

  • Recently Browsing   0 members

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