Nelderson / MV_Online

RPGMaker Online Core
http://www.neldersongaming.com
MIT License
155 stars 67 forks source link

TimeServer (plugin) #114

Closed tentran2k1 closed 5 years ago

tentran2k1 commented 5 years ago

Create an Admin account using the Global Variable plugin, all connected players will use it at the same time as the admin account ex: admin account is showing it is raining, another player is connecting and joining in the rain with admin account

squareware commented 5 years ago

This is doable by creating a global Variable as you mentioned. depending on the value of a global variable, you create parallel running event that is triggerd by an non global switch by the admin that run with a conditional branche with a Global var = 1 you let it rain, global var =2 storm, global var 3 snow etc.

You can even use the time / date / day / year to give values to the non global variable.

If non global variable 902 = Monday (set global var = 1. In the conditional branch you say it wil rain).

Here is a little snipit I use to make use of the system time in this example the variable 900 to 903 contains the date information on the running system. From there you can create a conditional branch like: if Variable 902 is Monday then global var = 1.

var d = new Date();

var day = d.getDate();

// month is zero indexed

var monthname = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][d.getMonth()];

var month = d.getMonth()+1;

var year = d.getFullYear();

$gameVariables.setValue(903, month);

// var dateStr = day + "-" + month + "-" + year;

$gameVariables.setValue(902, day);

$gameVariables.setValue(901, year);

$gameVariables.setValue(900, monthname);

Van: tentran2k1 [mailto:notifications@github.com] Verzonden: vrijdag 11 oktober 2019 14:53 Aan: Nelderson/MV_Online CC: Subscribed Onderwerp: [Nelderson/MV_Online] TimeServer (plugin) (#114)

Create an Admin account using the Global Variable plugin, all connected players will use it at the same time as the admin account ex: admin account is showing it is raining, another player is connecting and joining in the rain with admin account

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Nelderson/MV_Online/issues/114?email_source=notifications&email_token=ALCM7WNK2PCLLHKYASMJHWDQOBZMDA5CNFSM4I7ZMY42YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HRGNYBQ , or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCM7WIAII56CSFEJBLJASLQOBZMDANCNFSM4I7ZMY4Q . https://github.com/notifications/beacon/ALCM7WOVRIXRJU6YVW66MWTQOBZMDA5CNFSM4I7ZMY42YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HRGNYBQ.gif

tentran2k1 commented 5 years ago

i dont understand, I mean, if another player's account is logged in differently than the admin time, will it apply?