Weylon Santana Posted May 3, 2020 Share Posted May 3, 2020 Hello guys, I came to present a simple tutorial that I haven't seen in other tutorials about the intersect and that I use my game a lot. Running events at the exact time, or the exact day. The usefulness of this system serves as a basis for more complex systems that you want to make, such as daily prize for the player, giving or withdrawing vip ingame with exact date and time, home system (rent, take the player's house when renting end ..) and etc. For this system we will need 1 variable (preferably global) and 1 common event. Only that. I call GBtime to remember Global Time. Call your variable as you like. For the common event use... And ready. End of system. Use as you wish hahaha kidding, this is the center of everything. Now I'm going to show you how you can activate any event at exactly the right time. Everything is done with the condition of comparing variables. If you are experienced, you know how it works. One shot trigger. Spoiler Requirements: You will need 2 variable. It must be global, at the end you will understand why. One variable will be integer and the other will be boolean. 1 - In the Event [which can be on the map or common event], place the condition: If (your variable) is less than (GBtime) 2 - In this area you will insert all the commands you want and at the end you will insert the command set (boolean variable) to true. 3 - Finally create a new page, and place the condition: if (its boolean variable) is true. All your actions will be carried out and the event will come to a standstill. Of course, this will be something for all players. If you want something more specific for someone, put more conditions Class is X Player variable is X The player has X item There are several conditions and combination of conditions that you can specify. Return to the variable editor and enter the exact date and time when you want the event to run at the variable value. (look at the end of the tutorial to learn how) Auto Trigger (periodic events) Spoiler Requirements: You will not need the global boolean variable only the integer global variable. Repeat steps 1 and 2 above. Only this time, you will not use the boolean variable but will use the same variable, using the command, '' add '' to add a specific value. The logic here is simple. The event will always be activated in the same time interval defined for you. Remember that to activate the event you must enter the date and time. (look at the end of the tutorial to learn how) How to add the date and time. Spoiler There, the most important part. To add date and time is simple. But you must understand something. 1 - The time used by this intersect's time system is in timestamp, which ignores game time if your game uses more advanced time to simulate several days that is configured in the time editor. 2 - The time taken into account is the machine time. If you change the time of the machine, change the time in timestamp used in that system. Okay, come on. 1 - First use a timestamp converter (ask to "father of all": google) I use this: https://timestamp.online/ 2 - Set date and time 3 - Copy this value and paste it into the variable value. VERY IMPORTANT NOTE: The intersect uses time in ms, this site gives the time in s, that is, you must add 3 times the number 0 in the variable value. If you want, look in father of all, for a converter that already responds in ms. When setting dates, always put the date in future of the current time and take a 5 minute break. For example, now it is 10:30 AM, if I were to put a date I would put 10:35 AM for today. If you have doubts you can send that I will try to answer, as well as better ideas and etc. Maybe later on, when I stop being lazy, present my periodic dungeon system (like the one that many people want to use) as a tutorial, to provide the basis for other future systems, which will contribute a lot to the growth of the intersect. I made a video showing everything working. https://reccloud.com/u/gj9swqy If the video is crashing, take my 2 GB of ram with discord, chrome, server, editor and open client into account. Zoagel, Vio, Kamus and 16 others 18 1 Link to comment Share on other sites More sharing options...
BabyLoves Posted May 8, 2020 Share Posted May 8, 2020 I am terribly scared that such exceptional and useful content has not yet been commented on and its reach is not the highest. After all, this is of unprecedented importance. Dear Weylon, congratulations. I come here first of all to congratulate you for your incredible action in making this magnificent tutorial available! [PT-BR] Estou terrivelmente assustado como um conteúdo tão excepcional e útil ainda não foi comentado e seu alcance não é dos mais altos. Afinal, isto é de uma importância sem precedentes. Querido Weylon, parabéns. Venho aqui antes de tudo parabenizar sua incrível ação em disponibilizar este tutorial magnífico! Beefy Kasplant and Weylon Santana 1 1 Link to comment Share on other sites More sharing options...
AisenArvalis Posted May 8, 2020 Share Posted May 8, 2020 This is a very impressive system and works in a similar fashion to my day tracker I made a while back (Post for some reason can't be found o.O) It has ONE inherent flaw from using the Event system, for the Common Events to trigger there has to be at LEAST one player online at any time for this to work, but other than that, GREAT work buddy Weylon Santana and Beefy Kasplant 1 1 Link to comment Share on other sites More sharing options...
Weylon Santana Posted May 8, 2020 Author Share Posted May 8, 2020 5 hours ago, BabyLoves said: I am terribly scared that such exceptional and useful content has not yet been commented on and its reach is not the highest. After all, this is of unprecedented importance. Dear Weylon, congratulations. I come here first of all to congratulate you for your incredible action in making this magnificent tutorial available! [PT-BR] Estou terrivelmente assustado como um conteúdo tão excepcional e útil ainda não foi comentado e seu alcance não é dos mais altos. Afinal, isto é de uma importância sem precedentes. Querido Weylon, parabéns. Venho aqui antes de tudo parabenizar sua incrível ação em disponibilizar este tutorial magnífico! hahahahah thank you very much, I feel awkward like that. [hahahahah muito obrigado, eu fico sem jeito assim] 2 hours ago, AisenArvalis said: This is a very impressive system and works in a similar fashion to my day tracker I made a while back (Post for some reason can't be found o.O) It has ONE inherent flaw from using the Event system, for the Common Events to trigger there has to be at LEAST one player online at any time for this to work, but other than that, GREAT work buddy I know that. In fact, all event systems only work if you have an online player. I did not mention this because it is something more advanced and complicated, those who already move and manipulate the intersect would know that it only works with at least one online player. In addition to your comment, I can say that php scripts are able to change and update variables even offline. But I don't know about it so I didn't bring it to this tutorial. One last thing. The autotrigger, self-regulates itself when a player enters. For example, you have an event that happens every 2 hrs and is 2 days without entering, when you enter it will be adding every 2 hours until the time is greater than gb. Happening even at times determined by you. Which is cool. But thank you very much for your note. Link to comment Share on other sites More sharing options...
Zerinho Posted January 17, 2021 Share Posted January 17, 2021 you are a monster Weylon Santana 1 Link to comment Share on other sites More sharing options...
Weylon Santana Posted January 17, 2021 Author Share Posted January 17, 2021 6 hours ago, daviih123 said: monstro Thank you very much. We are in the tab in English so be careful, you can be warned for speaking in another language. Put an English translation too when you comment on something. Zerinho 1 Link to comment Share on other sites More sharing options...
izakt Posted August 24, 2021 Share Posted August 24, 2021 Thank you for the thread. I just needed to read it to figure out how I could create a Daily Reward System / Claim Items After x Time System. Global Variable (int): "Server Timestamp" = 0 Player Variable (int): "Next Claimable Timestamp" = 0 Autorun -> "Server Timestamp" = Server Time (ms) If player claims daily reward -> "Next Claimable Timestamp" = "Server Timestamp" "Next Claimable Timestamp" + 86,400,000 If "Next Claimable Timestamp" is less than "Server Timestamp" -> player can claim reward again Link to comment Share on other sites More sharing options...
Weylon Santana Posted August 24, 2021 Author Share Posted August 24, 2021 @izakt Until now, I would say this topic is a bit outdated, currently you can't use an autorun event as explained above, because that will make your server not support more than 3-5 players online. An autorun event cannot exist without a condition (and a good reason too). Finding a way to constantly update the Server Timestamp variable value without autorun is currently a problem. But for a Daily Reward System, no problems This is correct: 9 hours ago, izakt said: Global Variable (int): "Server Timestamp" = 0 Player Variable (int): "Next Claimable Timestamp" = 0 And this also: 9 hours ago, izakt said: If player claims daily reward -> "Next Claimable Timestamp" = "Server Timestamp" "Next Claimable Timestamp" + 86,400,000 If "Next Claimable Timestamp" is less than "Server Timestamp" -> player can claim reward again The changes I suggest are: 1 - If player claims daily reward -> "Server Timestamp" = Server Time (ms) "Next Claimable Timestamp" = Server Time (ms) (not = var int value) "Next Claimable Timestamp" + 86,400,000 2 - Commom event with "On login" trigger without conditions "Server Timestamp" = Server Time (ms) If "Next Claimable Timestamp" is less than "Server Timestamp" -> player can claim reward again Did you get the idea? So far I haven't found a good way to keep the Server Timestamp variable constantly updated, so I'm using this command -> "Server Timestamp" = Server Time (ms) <- in all player interactions with events (on respawn, on teleport, on login, on equip, on pvp kill/death, etc), to keep the value updated without weighing on server performance. Even if the event does something simple, like teleport the player when he dies, I update the value before. If you have any questions, feel free to express them. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now