PnP Turn-Based System via Wands
#1
Posté 29 mai 2011 - 02:26
I wasn't satisfied with the turn-based options available on the
Vault and some of my DM'd campaign players are a bit older and don't do
well in real time so I devised an easy to use and easy to implement option.
This system is controlled by one variable saved on the DM. A wand toggles this variable on or off. A simple heartbeat script checks for that variable and applies a timestop to the module. The DM can then use a second wand called "Next Turn" to remove the effect for 6 seconds (one PnP round). While frozen, DMs and players can queue up their actions and plan tactically like in a PnP game.
I haven't devised a single-player or PW friendly version of this yet (PW's could just substitute their timestop logic into the scripts and cutscene parylize the area rather than timestop the module), but I wanted to share this in the meantime.
-David
#2
Posté 29 mai 2011 - 02:45
#3
Posté 30 mai 2011 - 12:23
Modifié par _Guile, 30 mai 2011 - 12:26 .
#4
Posté 30 mai 2011 - 03:15
(1) Considering this is designed for use by a DM and I explicitly mention that it is not designed for single player, playing offline would be nonsensical (I assume you didn't read the post?).
(2) Player pausing has its virtue, and could be enabled given DMs' and players' preference, but having a wand-based, automated solution is preferable because it provides the standard D&D round for real time action before freezing again. It is constant, steady, and reliable (unlike player pausing). Player pausing rarely leads to PnP turn-based style action, particularly if your players are older and have less twitch reflex (my uncle and father prefer playing clerics and wizards... you can imagine how fun it has been as they pause and unpause one another in an attempt to target their spells). Also, from a DM's perspective, a turn-based solution allows me to play the enemy much more intelligently and handle combat better than relying on the AI or randomly pausing (which then appears unfair to the players because it isn't the norm).
#5
Posté 30 mai 2011 - 04:21
Modifié par Xardex, 30 mai 2011 - 04:22 .
#6
Posté 30 mai 2011 - 09:13
Xardex: Thanks for the recommendation to use the DM tool feat. I will definitely check that out. I also considered removing the heartbeat entirely by Next Turn doing a timestop DelayCommand by 6 seconds.
#7
Posté 31 mai 2011 - 03:17
select UNIX_TIMESTAMP()
Retrieves the exact amount of seconds between now and 1/1/1970
eg- 1503294495 or something like that.
If you want to make sure that your players cannot cast spells or act with their wands till after that 6 second timeout, then you simply need to do
SQLExecDirect("SELECT UNIX_TIMESTAMP()");
int iNow = StringToInt(SQLGetData(1));
int iLast = GetLocalInt(oPC,"NEXT_ROUND");
int iDiff = iLast - iNow;
if(iDiff >= 1)
{
SendMessageToPC(oPC,"You cannot act for another "+IntToString(iDiff));
return;
}
int iFuture = iNow+6;
SetLocalInt(oPC,"NEXT_ROUND",iFuture);
This with a few modifications, will disallow the players to perform the desired action, until 6 seconds has passed since their last action.
I use this system for doing cooldowns on PlayerTool powers in my own PW.
#8
Posté 31 mai 2011 - 04:53
Also int's are rounded down into full numbers so that script might miss the round start by up to 0.999... seconds.
Here is a few scripts straight from my module.
Put this in an include script
Modify iH if you modified the minutes per hour in your module
// Returns current server time in seconds
int Time();
int Time()
{
int iTime;
int iH = 2; // Amount of minutes per hour
iTime += GetTimeSecond();
iTime += GetTimeMinute()*60;
iTime += GetTimeHour()*iH*60;
iTime += GetCalendarDay()*24*iH*60;
iTime += GetCalendarMonth()*28*24*iH*60;
iTime += GetCalendarYear()*12*28*24*iH*60;
iTime -= GetLocalInt(GetModule(), "zero");
return iTime;
}
Put this in your OnModuleLoad script
SetLocalInt(GetModule(), "zero", Time());
And after a while of looking through a ridiculous pile of useless scripts I found something that you can easily modify to do what you want. This DOESN'T do what you want as it is, but I did modify it a little for your convenience.
Its ready for use, just add it into one of the DM/Player tool feat scripts and it should work... Its not tested though.#include ""
void main()
{
object oUser = OBJECT_SELF; // The one who used the feat.
// Make sure not to cast it twice in one round
effect eEff = GetFirstEffect(oUser);
while (GetIsEffectValid(eEff)) // This doesn't actually work, too tired to fix it
{ //
if (GetEffectType(eEff) == EFFECT_TYPE_TIMESTOP) {return;}
eEff = GetNextEffect(oUser);
}
int iTime = Time();
int iRound = (iTime/6); // Basically equals to the second
iRound = (iTime*6)+6; // next server round begins, since int's
// are always rounded down... It should work!
float fTime = IntToFloat(iTime) + (GetTimeMillisecond()/1000.0); // Must be accurate
float fRound = IntToFloat(iRound);
float fN = fRound - fTime; // Time in seconds until next server round begins
if (fN != 0.000)
{DelayCommand(fN, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectTimeStop(), oUser, fN));}
else
{ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectTimeStop(), oUser, fN);}
//
//
}
What it does (or should do) is pause the game for one round, starting exactly at the beginning of the next round.
Modifié par Xardex, 31 mai 2011 - 04:58 .
#9
Posté 31 mai 2011 - 05:59
While I'm sure both of your solutions are excellent alternatives, my system is extremely lightweight. I plan to make it even more friendly by eliminating the heartbeat by usingDelayCommand.





Retour en haut







