• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

GlobalEvent Light up the Streets at Night

J.Dre

Unity Games
Joined
May 18, 2011
Messages
2,647
Solutions
3
Reaction score
648
Location
United States
Information:
This script is just an 'extra' feature I like to add to my servers to make the towns more realistic. It's a simple feature that makes all the difference.

Street_Lamp.gif


Tested and working on TFS 0.3 and TFS 1.0.

Update Log:

  • v1.0: Initial Release
    * The initial release of the script.
  • v1.1: Update
    * Added the ".uid" at the end of 'getTileItemById' instead of after 'light'.

The Script:

globalevents.xml

Code:
<globalevent name="script" time="06:00:00" script="script.lua"/>
script.lua

Code:
http://pastebin.com/rP5CDQQQ
 
Last edited:
This is awesome but it can be long to add all lampost areas on the script :p but nice release.
 
This is awesome but it can be long to add all lampost areas on the script :p but nice release.

Yeah, it can be, especially for a "real map server."

In all honesty, I tried several ways to make it check for all lamps on the map, but every method was much more demanding (stressful) on the server and may cause lag for larger maps (like "/clean") by searching through the entire map for street lamps. I couldn't think of a better way to do this, but there may be one... Feel free to share your ideas on how one might do this.

J.Dre ;)
 
Isnt it jsut possible to put a id on every lamp instead? in the map editor?
 
Isnt it jsut possible to put a id on every lamp instead? in the map editor?

Hmm, yes, that may actually work. I did not try that. You could then search for items with the actionId or uniqueId and check the itemId, then transform it. ;)

@Azz: Yes, that's possible with this script as well.
 
Hmm, yes, that may actually work. I did not try that. You could then search for items with the actionId or uniqueId and check the itemId, then transform it. ;)

Yea something like that :)
 
decay works as well, make all street lamps decay to another item after X-time.
So if you put the server save right so the decay start at right time, you wont need to make scripts or anything :)
 
decay works as well, make all street lamps decay to another item after X-time.
So if you put the server save right so the decay start at right time, you wont need to make scripts or anything :)

But you would need a script to restart it.
 
Back
Top