Strain. - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Strain. (/Thread-Strain) Pages: 1 2 |
Strain. - Mordaunt - 08-17-2012 01:15 PM Yes it's a strange title but bear with me. Looking into changing the way my environmental script runs it's checks on players, currently it's this: Code: ON=@Environchange While this is a simple check to see what the current region temperature is and a check to see what the player is wearing it does create problems on a populated server with the @environchange trigger firing quite often (something I was never encountered on my private test server) This script already runs a seperate timekeeping function under the f_onserver_timer function firing each minute. Would including a player check under this timer create a bunch of lag? That's my question And my noob question of the day because it's slipped my mind.... someone please remind me what value fval returns. [EDIT:]Wow looking at this on my server NONE of the weather effects even seem to work anymore which is a tad bit disappointing, has anyone using these forums run this script on the latest nightly builds?.... Thinking this could be a complete rebuild from scratch deal here RE: Strain. - Shaklaban - 08-17-2012 01:44 PM Im using similar thing on @Environchange with maximum of 80 players, never had lag issue. But if you want a faster method you can store players layer on=@itemequip and on=@itemunequip in a tag, then you don't need to use for loop in every @environchangemethod. You can get detailed information about your functions with enabling script profiler from sphere.ini. then when you write p# on console sphere writes all data about triggers and functions inti profiler_dump.txt. RE: Strain. - Mordaunt - 08-17-2012 01:52 PM Still need to run the check for the temperature though.... is weather broken or something? Been going through checking bits and pieces seems as though sector.rain and sector.snow don't do anything anymore, though it does cause @environchange to fire RE: Strain. - Shaklaban - 08-17-2012 02:00 PM hmm i never tried with weather, mine is basic thing only controls for terrain and if there is a snow if (<isneartype t_snow>) and player has not weared clothes player get cold like: Code: [function getcold] RE: Strain. - Extreme - 08-17-2012 02:32 PM I'm thinking in about something like this: One handler that have a timer, 60 seconds, and send serv.allclients a function to check if where the player is with the right environ. The first time, the script looks what should be the environ in the moment and set it and set one tag in the region/sector i don't know, preventing it to get evaluated again for some time. Example: Code: [ITEMDEF BLA BLA] If 2+ players in the same sector/region, it will be checked only one time. This is the best idea that I had. Using the 'serv.rtime' would be very very nice too. Right now we need get USE for the GameMinuteLength in sphere.ini =D RE: Strain. - RanXerox - 08-18-2012 01:00 AM FVAL returns a floating point result (it puts a decimal point right before the last digit) RE: Strain. - Extreme - 08-18-2012 01:03 AM A small fix and suggestion to your Environ System Mord: Quote:[FUNCTION f_lightning_strike]Falling from horse and anim 21 is nice hahahaha looks real! RE: Strain. - Mordaunt - 08-18-2012 03:19 AM @Extreme, that's not a bad idea lol Even without my system on the older versions of the server you could change the weather in a sector with sector.snow sector.rain and I beleive sector.weather <x value> Checking on it last night before I went to bed, regardless what I entered sector.weather always returned a value of 255. I am assuming it is currently broken RE: Strain. - Mordaunt - 08-18-2012 05:32 AM *facepalm* helps if i have weather turned on in sphere.ini RE: Strain. - Extreme - 08-18-2012 09:43 AM NoWeather = 0 or 1? 1 disables weather, 0 enables... I set 0 and don't tested with set 1. |