Jump to content

I would like to make a tiny mod, missing a step


zdswulyx2

Recommended Posts

The question is really basic, and I am sure I am just missing an obvious point. But after looking around for a while I think it is faster to ask here.

 

I would like to make a mod that:

 

. Waits the start of the game

. executes Con_ToggleMapMarkers 0

. goes to Oblivion ;)

 

I am missing how to ensure that the script is executed only once in the beggining of the game.

Link to comment
Share on other sites

Well, it mostly depends on what you define as "start of the game".

 

But basically you can just add a "doOnce"-like variable and condition to a quest script to make whatever it should do run only once, then never again:

 

 

short doOnce
 
Begin GameMode
    if 0 == doOnce
        if <yourCondition>
            ;do your magic here
            set doOnce to 1
        endif
    endif
End

Additionally you can, like me, add whatever else checks have to run prior to your action ("<yourCondition>" in my example) inside of the doOnce check as well.

 

So this will keep checking the condition, and as soon as it's fulfilled will do the action, then never check or act ever again.

Link to comment
Share on other sites

I understood a script executes only if it is attached to a quest, an object, or a spell? Would your example be running since the beginning of the game?

 

By "beginning of the game" I mean: when the player assumes control of his character in the prison. Or in any other "alternate beginning" mod.

Link to comment
Share on other sites

If it's a spell script, no. They only run when cast.

If it's an object script, possibly, provided the object is in the same cell and close to the player. Those run once every frame.

But the ideal solution would be a quest script and having the quest "start game enabled" checked. Then it runs immediately once the first game scene starts.

 

To be completely honest, quest scripts even run already "before" you start the game, sometimes. But while still on the menu screen or during a video play you're not in GameMode, so the GameMode block won't run.

I don't know if there is a split-second in GameMode before the CharGen screen comes up (=MenuMode). But if there isn't, then the script will only run as soon as you closed the CharGen screen and are able to move around.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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