Meditation Time
#1
Posté 13 avril 2012 - 11:02
for example.
[code=auto:0]
object oPC;oPC = GetItemActivator(); AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0f, 120.0f));//wont need this time as it could be ongoing until the player is interupted.
[code=auto:0]
Any suggestions?
#2
Posté 13 avril 2012 - 11:23
I think first you need to timestamp the PC the moment they enter the animation. So just before you assign the command to play the animation, set an int on the PC that represents GameTime in seconds. Lets call this int the meditation timestamp.
You also I think need to create a user defined event that will catch any action by the player which will end the animation state.
In the user defined event you would get the meditation timestamp and subtract it from current GameTime in seconds. This would be the length in seconds that the PC was in the looping animation.
The tricky part is defining the user defined event properly, and turning this event catching on or off. Without the toolset in front of me I am unable to puzzle it out.
#3
Posté 16 avril 2012 - 09:33
void ActionTimerCheck(object oPC, location lCheck)
{
int iMedTime = GetLocalInt(oPC, "MEDITATE_TIME");
SetLocalInt(oPC, "MEDITATE_TIME", iMedTime + 1);
//SendMessageToPC(oPC, "1 second meditation time has been added.");
location lCurrent = GetLocation(oPC);
if (lCurrent == lCheck)
DelayCommand(1.0, ActionTimerCheck(oPC, lCheck));
}
void main()
{
object oPC = GetLastUsedBy();
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, 10000.0));
DelayCommand(3.0, ActionTimerCheck(oPC, GetLocation(oPC)));
}
P.S. This script would be for the OnUsed event of an object. Then later when you need to check how long they were meditating you would just do a: GetLocalInt(oPC, "MEDITATE_TIME");
Modifié par GhostOfGod, 16 avril 2012 - 09:39 .
#4
Posté 16 avril 2012 - 12:20
Anyway, it would probably be far easier to have the PC touch something to start the animation, create a tracks trigger around the device, so if they move away from the device that they touch to start the animation, you know instantly that they stopped...
All you would need to do is set an int on the PC based upon the module minute and hour, and then have the tracks trigger calculate time spent based upon current game time...
Naturally the reward for meditation would probably be handled by this tracks trigger script too, and you will want to turn off that the PC is "meditating" so the script doesn't fire multiple times...
Furthermore, you would have to check to see if the variable is on the PC to start meditating so that the tracks trigger doesn't fire when the PC crosses it to go meditate...
Just some pointers..
#5
Posté 16 avril 2012 - 12:40
#6
Posté 16 avril 2012 - 01:57
#7
Posté 16 avril 2012 - 03:27
#8
Posté 16 avril 2012 - 08:33
Thanks for the suggestions guys, I'll take a better look at them when I get home. THanks again!
#9
Posté 16 avril 2012 - 11:02
Buddywarrior wrote...
I'll be having a unique power that does d4 roll damage + the time meditated before cast. Kind of like a concentration or a 'build up' found in other games. So if a user 'meditates for say 10 seconds, the unique power will do d4 + 10. What I'm not sure how to do is how to keep track of the time a player "meditates" in one place without moving.
Thanks for the suggestions guys, I'll take a better look at them when I get home. THanks again!
OK, now it's starting to make "a little" more sense, it's best to always state what you are planning with your request, otherwise we have to guess exactly what you are doing...
Therefore I need to ask a question...
What will trigger the "mediation"? Will it be a spells script? A placeable object?
Get back to us with more details about your system, thanks..
#10
Posté 17 avril 2012 - 02:43
#11
Posté 17 avril 2012 - 10:31
#12
Posté 18 avril 2012 - 04:04
Buddywarrior wrote...
The trigger is a unique power called Meditation. It's to simulate meditation in classic EverQuest. You med, you're blind, and you hope nothing comes beating up on you and interrupts your meditation. If it's not something I'm able to do then I'll find another solution.
Hmmm, this is a rather complex request...
I think the best way to handle it, is like Ghost of the God said, use a re-occuring script....
Set a variable on the PC every time they pass a concentration check...
You would naturally want to roll the concentration check within the re-occuring script..
Then, once the variable on the PC has reached X (meaning X minutes or seconds of successful mediation), then you would actually cast the spelld or do the function you desire to happen...
Hope that helps...
#13
Posté 18 avril 2012 - 04:11





Retour en haut







