Weather manipulation

Any information about the fun attribute is given here.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3284
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Weather manipulation

#1

Post by Lobby » Sat Jan 27, 2018 13:46

Since variables are available it's possible to change weather using something called virtual variables. Virtual variables are variables that are used by the game internally and are exposed for use in fun.

Weather in TheoTown has an internal time (in milliseconds) that is used to calculate the current weather (based on a mystic formula :bd ). You can assign a new time for weather by writing a value into a variable called "weatherTime" :json

Code: Select all

    "on click fun":[
      {"actions":[{"type":"set","id":"weatherTime","code":"0"}]}
    ]
So this code sets weather time back to 0. Here more useful numbers:
  • Sunny: 290373
  • Rain: 849711
  • Lightning: 622697
To enable/disable fog, write a value of 1/0 to a variable called "weatherFog".
To lock/unlock the weather timer, write a value of 1/0 to a variable called "weatherLocked". That's how the weather machine preserves the selected weather.

You can also read from these virtual variables.
...Have a nice stay

User avatar
CommanderABab
AB
Reactions:
Posts: 7372
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Weather manipulation

#2

Post by CommanderABab » Sat Jan 27, 2018 16:50

Code: Select all

  {...,
     "on click fun":[
        {"actions":[{"type":"set","id":"weatherTime","code":622697}]},
        {"actions":[{"type":"remove","x":-1,"y":0}],"always":true,"ignore success":true},
        {"actions":[{"type":"remove","x":-1,"y":-1}],"always":true,"ignore success":true},
        {"actions":[{"type":"remove","x":0,"y":-1}],"always":true,"ignore success":true},
        {"actions":[{"type":"remove","x":1,"y":-1}],"always":true,"ignore success":true},
        {"actions":[{"type":"remove","x":1,"y":0}],"always":true,"ignore success":true},
        {"actions":[{"type":"remove","x":1,"y":1}],"always":true,"ignore success":true},
        {"actions":[{"type":"remove","x":0,"y":1}],"always":true,"ignore success":true},
        {"actions":[{"type":"remove","x":-1,"y":1}],"always":true,"ignore success":true},
        
        {"actions":[{"type":"build","x":-1,"y":0,"id":"$road00","level":0}],"always":true,"ignore success":true},
        {"actions":[{"type":"build","x":-1,"y":-1,"id":"$road00","level":0}],"always":true,"ignore success":true},
        {"actions":[{"type":"build","x":0,"y":-1,"id":"$road00","level":0}],"always":true,"ignore success":true},
        {"actions":[{"type":"build","x":1,"y":-1,"id":"$road00","level":0}],"always":true,"ignore success":true},
        {"actions":[{"type":"build","x":1,"y":0,"id":"$road00","level":0}],"always":true,"ignore success":true},
        {"actions":[{"type":"build","x":1,"y":1,"id":"$road00","level":0}],"always":true,"ignore success":true},
        {"actions":[{"type":"build","x":0,"y":1,"id":"$road00","level":0}],"always":true,"ignore success":true},
        {"actions":[{"type":"build","x":-1,"y":1,"id":"$road00","level":0}],"always":true,"ignore success":true},
        
       
        
        {"actions":[{"type":"set","id":"weatherTime","code":290373}]},
        {"actions":[{"type":"remove"}],"always":true,"ignore success":true},
       
        {"actions":[{"type":"set","id":"weatherLocked","code":0}]}
        
        
      ]         
  },
  ...
Pertinent snippet of code. :)

Should build a dirt or country road roundabout and remove the 1x1 that was clicked.
640u640Currently using alpha 640u. 640 What's new? :)
Can't tell!!
:)

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

User avatar
JustAnyone
Junior Developer
Reactions:
Posts: 2545
Joined: Sun Jul 23, 2017 12:45
Location: Pickle command administration
Plugins: Show
Version: Beta
Phone model: Picklephone S5

Plugin Creator

Platform

Re: Weather manipulation

#3

Post by JustAnyone » Sat Jan 27, 2018 16:57

Are you sure this is the right topic? Dang you beat me to that.

User avatar
CommanderABab
AB
Reactions:
Posts: 7372
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Weather manipulation

#4

Post by CommanderABab » Sat Jan 27, 2018 16:59

JustAnyone wrote:
Sat Jan 27, 2018 16:57
Are you sure this is the right topic? Dang you beat me to that.
Yes, it changes the weather!
640u640Currently using alpha 640u. 640 What's new? :)
Can't tell!!
:)

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

Post Reply Previous topicNext topic

Return to “Fun attribute”

Who is online

Users browsing this forum: No registered users and 1 guest