Jump to content

DisableAImarkerScript?


Agnot2006

Recommended Posts

I am not very good at scripting as I don’t do it that much.

I have some spare time at work, but cannot try anything until I get home.

I have created some Idle Dance markers which I have placed around my cell and work fine. What I am hoping the script will do is enable them after 6pm and disable at midnight.

Is this possible with Idle markers and do I need to initially set the marker to disabled in its tick box?

 

scn DisableAImarkerScript

 

short Toggle

 

begin gamemode

if gamehour >= 0 && Gamehour <= 18 && Toggle=1

aaAIdanceMarke.disable

Set Toggle to 0

elseif

gamehour > 18 && Toggle=0

aaAIdanceMarke.enable

Set Toggle to 1

endif

 

end

Link to comment
Share on other sites

I just thought I needed to set the Toggle first so have amended the script.

Will this work?

 

scn DisableAImarkerScript

 

short Toggle

short Dofirst

 

begin gamemode

if gamehour >= 0 && Gamehour <= 18 && Dofirst=0

Set Toggle to 1

Endif

Set Dofirst to 1

 

end

 

begin gamemode

if gamehour >= 0 && Gamehour <= 18 && Toggle=1

aaAIdanceMarke.disable

Set Toggle to 0

elseif

gamehour > 18 && Toggle=0

aaAIdanceMarke.enable

Set Toggle to 1

endif

 

end

Link to comment
Share on other sites

I want to have idles markers placed so that there are no changes to any vanilla NPC’s or sandboxes but will be used by them at certain times. For instance when a Radio timer comes on dance Idles will also be activated etc. Its just something I am looking at if its at all possible. So a visiting companion etc will also use without any changes

RRCompanionVault.esm does it with trigger boxes I just thought it could be done with markers?

Link to comment
Share on other sites

I want to have idles markers placed so that there are no changes to any vanilla NPC’s or sandboxes but will be used by them at certain times. For instance when a Radio timer comes on dance Idles will also be activated etc. Its just something I am looking at if its at all possible. So a visiting companion etc will also use without any changes

RRCompanionVault.esm does it with trigger boxes I just thought it could be done with markers?

Give it a try and see what happens.

 

"Make mistakes, there's nothing wrong with trying." ~ Paul Hewson (a.k.a. Bono)

Link to comment
Share on other sites

I am trying to develop the script whilst learning at the same time. My script has changed as Geck keeps telling me to put things right and I keep changing until the error goes away

This is the latest version

 

scn DisableAidleProjectorScript

 

short Toggle

short Dofirst

 

begin gamemode

if Dofirst==0

If gamehour >= 0 &&gamehour <=18

Set Toggle to 1

endif

endif

Set Dofirst to 1

 

end

 

begin gamemode

if gamehour >= 0 && Gamehour <= 18 && Toggle==1

aaSpringValePosingMarker.disable

aaSpringValeprojectorLight2.disable

aaaSpringValeProjectorLightFX01.disable

Set Toggle to 0

endif

If gamehour > 18 && Toggle=0

aaSpringValePosingMarker.enable

aaSpringValeprojectorLight2.enable

aaaSpringValeProjectorLightFX01.enable

Set Toggle to 1

endif

 

end

 

My problem now is the error:

 

Script 'DisableAidleProjectorScript', Line 18

Syntax error. Invalid reference 'aaSpringValePosingmarker' (only references and reference variables are allowed in this context)

 

I have gotten completely lost now. Can anyone please help?

Link to comment
Share on other sites

  • 2 weeks later...

I only got it to work!! After looking at every script on this site (thank you all) and some encouragement thank you BadPenney

The scrip now turns on the projector light, an extra effect light and a Dance marker that I set up to use one of Umpa’s Dance idles after 18:00 and turns it all off again after midnight. The NPC’s in the area use the marker when its activated as part of the normal sandbox. The only fly in the ointment at the moment is an NPC can continue dancing for a while after de-activation, I am still looking at that.

It didn’t work until I added the script to the extra effect light which was the only one that had a script dropdown list, and then everything worked fine

For anyone that’s interested and maybe help tidy up the script her it is.

 

scn DisableAidleProjectorScript

 

short SBToggle

short Dofirst

 

begin gamemode

if Dofirst==0

If gamehour >= 0 && gamehour <=18

Set SBToggle to 1

endif

endif

Set Dofirst to 1

 

end

 

begin gamemode

if gamehour >= 0 && Gamehour <= 18 && SBToggle==1

PosingMarkerDanceREF.disable

FSPlightBulbSBREF.disable

FSPlightREF.disable

aadanceMarkerSB01REF.disable

Set SBToggle to 0

endif

If gamehour > 18 && SBToggle==0

PosingMarkerDanceREF.enable

FSPlightBulbSBREF.enable

FSPlightREF.enable

aadanceMarkerSB01REF.enable

Set SBToggle to 1

endif

 

end

Link to comment
Share on other sites

If you always have the same NPC continue to dance after the dance idle is disabled, then it might help to include an evaluate package command in a script.

 

i.e. "NPCnameREF.evp"

 

That should get them to recheck their script package and do something more appropriate. ResetAI can be useful for that too.

Link to comment
Share on other sites

I'm not so sure now that the Markers are turning off as they should do, or if the game is just remembering that they are there. All the physical bits are being removed, but I had an NPC start Dancing before they were turned on! Its a problem with waiting for an NPC to use or not.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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