Jump to content

Can not enable/disable creatures in script


Balagor

Recommended Posts

Hi there.

After spending some days searching for troubleshooting, I give up.

I want to disable and enable creatures (Ghosts to be exact) in a part of a script. Normally it works for me with objects.

I read all about on the CS WIKI, but it did´nt work. Nor did the copies I tried to paste from existing scripts in the game.

 

What do I do wrong? I have the latest patch for the CS, and use OBSE 0019.

I try to make the script run something like this:

 

Scriptname MyName

float fQuestDelayTime

Begin Menumode

if ( IsPCSleeping == 1 && player.getincell MyCell == 1 )

WakeUpPC

MyGhostRef.enable

SetStage MyQuest 10

endif

end

 

I either get the warning that my creature is not an object,

or (if I remove the "MyGhostRef", and only keep "enable") I get the warning that I need an explixit ref. in my quest.????????? :wallbash: :wallbash: :wallbash:

 

Help will be very much appreciated :biggrin: :biggrin: Thank you in advance

Link to comment
Share on other sites

First, is your ghost already disabled?....you can do this without script, when you place it in the render window, double click on it and tick the box Initially Disabled.

I will call it's RefID MyGhostRef as well

 

Scriptname MyName

 

float fQuestDelayTime

 

Begin gamemode

 

set fquestdelaytime to 1

 

if getstage MyQuest < 10 && IsPCSleeping == 1 && player.getincell MyCell == 1

WakeUpPC

MyGhostRef.enable

SetStage MyQuest 10

endif

end

 

Try that. It must be a quest script attached to a quest to work.

Link to comment
Share on other sites

First, Thanks a lot for your help, @Sly.

Yes, my Ghost is disabled.

I have tried the structure you gave me. I do not get the warning that "my creature is not an object" anymore.

However now I get a warning "Script command: (MyGhost.Enable) not found", and can still not save the script.

 

This is how my scrip looks with your structure:

 

 

Scriptname 1GhostScript

float fQuestDelayTime

Begin gamemode

set fquestdelaytime to 1

Ref 1TFUndeadBossLvl100Ref

if getstage 1GhostQuest < 10 && IsPCSleeping == 1 && player.getincell 1TwinFallsHouse == 1

WakeUpPC

1TFUndeadBossLvl100REF.enable

SetStage 1GhostQuest 10

endif

end

 

I really do not know what is wrong. Just a few days ago I made a script for a door with enable/disable. No problems,

Is it my references that cause the problems?

I will continue tearing hair off my head :sick: and look into it. Suggestions are welcome. btw kudos, Sly

Link to comment
Share on other sites

There is one line you do not need, and that is your problem here.

 

get rid of this line.

 

Ref 1TFUndeadBossLvl100Ref

 

Open the render window where your ghost is and double click on it....in the box that opens, right at the top is a small box called Reference Editor ID...place the Ref for your Ghost in there if you have not done so....I will use the same as you have done and call it 1TFUndeadBossLvl100REF. Your script should look like this.

 

Scriptname 1GhostScript

 

float fQuestDelayTime

 

Begin gamemode

 

set fquestdelaytime to 1

 

if getstage 1GhostQuest < 10 && IsPCSleeping == 1 && player.getincell 1TwinFallsHouse == 1

WakeUpPC

1TFUndeadBossLvl100REF.enable

SetStage 1GhostQuest 10

endif

 

end

 

Try that, and see what happens....Oh and thank you for the kudo Balagor :thumbsup: :biggrin:

Link to comment
Share on other sites

It works now. Thank you very much.

However I do have some adjustment that was necesarry to get it to run,

 

WakUpPc is to alert player when sleeping. It is not needed. At least it says so in the ElderScroll WIKI, which actually is the same site that told me to use this function.

 

After I inserted an EditorID on MyGhost, I do not need ...."Ref" at the end of the expresion, only "MyGhost".

 

To make the script run at all from sleepmode, I found that I can not use "GameMode" but should use "MenuMode" instead, and refer to 1012 (sleep/wait menu).

 

The finished script looks like this, and it works:

 

Scriptname MyScript

float fQuestDelayTime

Begin MenuMode 1012 (sleep/wait)

set fquestdelaytime to 1

if getstage MyQuest < 10 && IsPCSleeping == 0 && player.getincell MyCell == 1

MyGhost.enable

SetStage MyQuest 10

endif

end

 

 

That´s it. One more time thank you for your help, Slygothmog.

 

Balagor

Link to comment
Share on other sites

  • Recently Browsing   0 members

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