Shako 97 Report post Posted August 11, 2016 Hello guys, I'm trying to write a script for maps which require the map to tick. (every second counter). Right now the only way I see is Every_5_Minutes which ticks.. every 5 minutes! What if I wanted a map tick that has more frequency than that? How do I do so? Thanks! SHAKO Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
DangThao 81 Report post Posted August 12, 2016 Tick everyone second? good luck spamming system =D map tick? what u mean? like Chaos Argent map tick for monster spawnining while there are active players? or map tick for map close down time? If like CA, What's your purpose for make a ticking that is faster than usual? If you really do, u can just do every_5_minutes - certain time so it will be faster. Try to play around with Every_5_minute = Every_5_minute+1 if Every_5_minute == 2 then -- ³õ¼¶±¦Ïä --direct monster create end like instead of going +(plus), you will go -(minus). there should be another way for ticking. maybe ask someone to make u one that will tick after seconds (ofc, it will spam your system if the time is short but mainly depend on what u tick on) Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted August 12, 2016 Hi ! its been awhile but lemme see if i can remember some things...map_copy_run_special_* ticks every 5 minutes. (so use this function if you want to do a set of routine every 5 minutes) the Every_5_Minutes is only a counter so don't mistake it as anything special... (I can change the variable name to Every_10_Minutes and it will still counter every 5 minutes because of it being incremented inside the map_copy_run_special_* function. The function you want to deal with is: map_copy_run_* Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 12, 2016 @KONG is indeed correct. "map_copy_run_X" is a function like "cha_timer", it "ticks" every second only if a player is inside or has been inside the map. The tick won't start unless someone steps inside the map for it to begin. Quote Share this post Link to post Share on other sites
Shako 97 Report post Posted August 12, 2016 1 hour ago, Angelix said: @KONG is indeed correct. "map_copy_run_X" is a function like "cha_timer", it "ticks" every second only if a player is inside or has been inside the map. The tick won't start unless someone steps inside the map for it to begin. 5 hours ago, KONG said: Hi ! its been awhile but lemme see if i can remember some things...map_copy_run_special_* ticks every 5 minutes. (so use this function if you want to do a set of routine every 5 minutes) the Every_5_Minutes is only a counter so don't mistake it as anything special... (I can change the variable name to Every_10_Minutes and it will still counter every 5 minutes because of it being incremented inside the map_copy_run_special_* function. The function you want to deal with is: map_copy_run_* Thanks a lot! Is there a way to make the map's tick start when the portal opens, where anything scripted will spawn regardless of player count? 6 hours ago, DangThao said: Tick everyone second? good luck spamming system =D map tick? what u mean? like Chaos Argent map tick for monster spawnining while there are active players? or map tick for map close down time? If like CA, What's your purpose for make a ticking that is faster than usual? If you really do, u can just do every_5_minutes - certain time so it will be faster. Try to play around with Every_5_minute = Every_5_minute+1 if Every_5_minute == 2 then -- ³õ¼¶±¦Ïä --direct monster create end like instead of going +(plus), you will go -(minus). there should be another way for ticking. maybe ask someone to make u one that will tick after seconds (ofc, it will spam your system if the time is short but mainly depend on what u tick on) In case I want to make something spawn every 3 minutes instead of 5 minutes, how will I do that? Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
Shako 97 Report post Posted August 12, 2016 Also, does anyone know WHAT function draws the map_copy_run_special to tick once every 5 minutes? Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 12, 2016 (edited) 11 minutes ago, Shako said: Thanks a lot! Is there a way to make the map's tick start when the portal opens, where anything scripted will spawn regardless of player count? Currently no, or not any that I have found yet. If someone knows, please show us the way. 11 minutes ago, Shako said: In case I want to make something spawn every 3 minutes instead of 5 minutes, how will I do that? Try this. Since the function works with seconds, not minutes, then a minute translates into 60 seconds, then 180 would be 3 minutes. RandomTickVariable = 0 function map_copy_run_X(MapCopy) RandomTickVariable = RandomTickVariable + 1 if (RandomTickVariable - math.floor(RandomTickVariable/180)*180) == 0 then ... end end Edited August 12, 2016 by Angelix 1 Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted August 13, 2016 @Angelix RandomTickVariable = 0 function map_copy_run_X(MapCopy) RandomTickVariable = RandomTickVariable + 1 if math.mod(RandomTickVariable, 180) == 0 then -- ticks every 180 seconds or 3 minutes -- do something end end Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 13, 2016 30 minutes ago, V3ct0r said: @Angelix RandomTickVariable = 0 function map_copy_run_X(MapCopy) RandomTickVariable = RandomTickVariable + 1 if math.mod(RandomTickVariable, 180) == 0 then -- ticks every 180 seconds or 3 minutes -- do something end end Wouldn't it be same? Or what's the difference? Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted August 13, 2016 @Angelix it is same code but a bit easier. math.mod(RandomTickVariable, 180) equals to RandomTickVariable % 180. 180 % 180 = 0 200 % 180 = 20 300 % 180 = 120 360 % 180 = 0 720 % 180 = 0 799 % 180 = 79 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
Shako 97 Report post Posted August 13, 2016 (edited) 3 hours ago, V3ct0r said: @Angelix it is same code but a bit easier. math.mod(RandomTickVariable, 180) equals to RandomTickVariable % 180. 180 % 180 = 0 200 % 180 = 20 300 % 180 = 120 360 % 180 = 0 720 % 180 = 0 799 % 180 = 79 basically it happens every 180 ticks @Angelix although I haven't tested yours yet, i would assume its the same thing Edited August 13, 2016 by Shako Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted August 13, 2016 1 час назад, Shako сказал: basically it happens every 180 ticks @Angelix although I haven't tested yours yet, i would assume its the same thing Yes it is the same thing Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites