Jump to content

Script help


Recommended Posts

This syntax is unreliable:

If player.getdistance BGFarmHouse01 <= 500

Don't use it. It can break your mod so that the player has to give up or reload an old savegame.

 

This is the more reliable synax:

If BGFarmHouse01.getdistance player <= 500

 

But neither one of these will work I don't think. It is very important what type of object you place your script on. The most reliable ones for me are movable items. Like you could put the script on a carrot or tomato and hide it inside a wall or inside a rock or someplace where the player can't see it or interact with it.

 

You might need a radius larger than 500. The player might not walk on the right spot and the script could fail to fire.

 

You don't need to name a reference on a script like this if the thing in question is the thing the script is placed on. (Change the "If AABGTomateREF.Getdistance..." to simply say "If Getdistance..." The tomato does not even need to be a persistent reference or have a reference ID.

 

So this is how I would do the script:

 

SCN AABGSetStage100Tomato

; Object script applied to a custom tomato with a unique form ID hidden inside the farmhouse wall. 

Begin GameMode
    If Getdistance Player <= 1000
         SetStage BGM01 100
    endif
end 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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