Author Topic:  [How to] Make Scripts  (Read 20713 times)

0 Members and 1 Guest are viewing this topic.

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6499
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: [How to] Make Scripts
« Reply #105 on: June 29, 2014, 06:39:02 PM »
A couple of changes:

Fog [x,z] [radius] [duration] [intensity] [r,g,b] [visibility]
  • [x,z] - the y parameter can also be included for convenience, but is ignored. e.g. [100,200,25] and [100,25] are equivalent.
  • [intensity] is now a %, so valid values are 1 - 100.
  • The [visibility] parameter defines the distance (in blocks) that the fog effect extends for, from the players viewpoint (eyes). Valid values are 2 - 100. For Fog that has an intensity of 100%, this defines the distance the player can see before the Fog becomes an impenetrable wall. If the intensity is < 100%, the player will be able to see the fog effect start to drop off again after the distance defined by [visibility]. The formula used to calculate the distance is FarClip - ((FarClip - FogVisibility) * FogIntensity), where FarClip is the players view distance in blocks, FogVisibility is the total visibility of all the stacked fog effects the player is currently positioned inside, and FogIntensity is the total intensity of all the stacked fog effects the player is currently positioned inside.
  • Both color [r,g,b] and [visibility] are optional parameters (they can be omitted). If these parameters are omitted, the values used are [115+/-r,115+/-r,115+/-r] for color (where r is a random number between 0 - 25, and [50] for visibility.
Rain [x,z] [radius] [duration] [intensity] [r,g,b]
  • [x,z] - the y parameter can also be included for convenience, but is ignored. e.g. [100,200,25] and [100,25] are equivalent.
  • [intensity] is now a %, so valid values are 1 - 100.
  • Color [r,g,b] is an optional parameter (it can be omitted). If it is omitted, the value used is [153,153,178+/-r]  where r is a random number between 0 - 51.

Note: as with most script commands, because the parameters are not named, parameter omission must start from the last parameter, so for example, if you want to omit color [r,g,b] from the Fog command, you must also omit [visibility].

The section quoted below can now be removed from Extra Info, as it is no longer an issue.
"It is a bad idea to cause a script to wait for more than a couple of seconds. The reason for this is because when a script is executing it uses a background thread. The game only has 3 background threads available to it, so while a script is executing, there are only 2 left. Background threads do many many things in TM, including lighting, loading chunk graphics, and streaming data in multiplayer. So if you're holding up 1 of the 3 background threads by having a script needlessly wait for long periods, other things will take longer to get done. It won't cause lag as in low frame rates, but could cause lag in terms of things taking longer to finish than they might otherwise."

A 3rd weather effect has been added, which is also controllable by a script command, but this will remain a surprise for the next update.

Zoidberg

  • Legendary Member
  • *****
  • Posts: 1445
  • Awards Awarded for extraordinary testing services to our game. Awarded to exemplary forum members 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: v Zoidberg v
  • Steam: v_Zoidberg_v
Re: [How to] Make Scripts
« Reply #106 on: June 29, 2014, 06:45:00 PM »
.
« Last Edit: December 22, 2014, 05:11:08 PM by Zoidberg »


Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4254
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: [How to] Make Scripts
« Reply #107 on: June 30, 2014, 08:03:26 AM »
Would you be able to run

Fog [512,512] [511] [999999] [15] [44,0,0] [100]

To make a tinted sky effect on the whole map for a very long time?

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6499
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: [How to] Make Scripts
« Reply #108 on: June 30, 2014, 08:54:42 AM »
Yes, duration is not restricted.

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4254
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: [How to] Make Scripts
« Reply #109 on: June 30, 2014, 09:06:02 AM »
Also, Is there any way to cancel weather effects, Or do you just have to wait until the time runs out?

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6499
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: [How to] Make Scripts
« Reply #110 on: June 30, 2014, 09:10:24 AM »
There is currently no way to cancel weather effects.

Ark

  • Sr. Member
  • ****
  • Posts: 477
  • YouTuber
  • Awards 1 year on site+100 posts
    • View Profile
    • YouTube
    • Awards
Re: [How to] Make Scripts
« Reply #111 on: October 23, 2015, 10:56:26 PM »
Anyone know how to do the facing direction so when a player buys a bank the sign will be on the wall?

Dark Hydrak

  • Elite Member
  • *****
  • Posts: 508
    • View Profile
    • Awards
Re: [How to] Make Scripts
« Reply #112 on: November 06, 2015, 12:40:38 AM »
Craig said that he -may- change the script layout.