Jump to content
  • 0

Global Switch & Variables


DarkZone

Question

10 answers to this question

Recommended Posts

  • 1

One solution with the event system would be as follows:

 

Let's say you have 2 chests that you want to reset each week. Suppose the switches are "Chest1" and "Chest2".

Create a player variable. I'll call it "Reset Chests". First it is set to 0.

 

Now let's say a week passes and you want to reset all those switches for every player.

Create a Common Event. Trigger: "Autorun". Execution condition: player variable "Reset Chests" does not equal to 1.

In this event you set "chest1", "chest2" to false. Also, you set the "Reset Chests" variable to 1, so the reset won't happen again for that player.

2a84ccd881296139c2cbae862aee4165.png

Let's say one more week passes, what do you do now? Easy, you just go to the same common event and change the execution condition to player variable "Reset Chests" does not equal to 2. Then, instead of setting

that same variable to 1, you set it to 2.

051e4de63cf4a06efa71eacc5834492b.png

The only problem here is that you still have to manually change those two values each week, although it's a lot easier than manually changing the switches from the database (unless you have a script that automatically does that).

 

Link to comment
Share on other sites

  • 0

I have it set so they can open it once but once a week or once a month i want to be able to reset all of them for everyone using one event

And rite now it only reset for a single player who use's the player switch event

Link to comment
Share on other sites

  • 0

@NewWun

 

Hello mate, i make a script for do that, here is the download link:  CustomScript_IntersectEngine.zip

 

Instructions:

 

There is two main files: CSharpConnector.exe and config.ini

 

[CONFIG]
;your database path

DatabasePath=C:\Engine 2D\Intersect Engine\Intersect Engine Beta 4.8.1\Intersect Engine Beta 4.8.1\Server\resources\intersect.db

 

;delete all player switches change value to 1

DeletePlayerSwitch=0
 

;delete all player variables change value to 1

DeletePlayerVariable=0
 

;delete all server switches change value to 1

DeleteServerSwitch=0

 

;delete all server variables change value to 1
DeleteServerVariable=0

 

Observation

My script creates a backup file before executing the commands in folder where it is running exe file in a bkp sub directory.

 

Conclusion

 

After choosing what to delete in the configuration file, just run CSharpConnector.exe

 

If you want to run the script on a specific date or specific time, I recomend you to use windows scheduler itself, it does that for you, that is, just schedule it with your own routines.

 

Any questions just let me know, I hope I have helped you.

 

 

 

Link to comment
Share on other sites

×
×
  • Create New...