Author Topic: Custom scry event  (Read 333 times)

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
Custom scry event
« on: April 19, 2011, 07:55:02 pm »


               Hello all, in my ultimate pursuit of scripting knowledge I have attempted to write some code for a 'scrying' crystal ball for my PW that I have wanted to implement for awhile.

so I finally got all my code working and work it does (its still needs to be polished but thats for later)

what I am hoping for is if someone can implement(or help guide me) into creating this as a CUTSCENE.

it works as I want except that when your 'scrying' you can still navigate your inventory,bring up main menu,etc...I set PC as uncommandable so they can't move anywhere but still for that extra level of shine, a cutscene would make it.

following is the script.

basically it loops through all player characters in game.
when one is selected an invisible-cutscene invisible-creature is called and ActionForceFollow the PC you wish to scry (critter is set as uncommandable as well so it just keeps following them)

then another critter is created again invisible-cutcene invisible that 'BINDS' the player wanting to scry to his initial starting point.

script is fired and player is made cutscene invisible and actionforcefollow set to the critter specified earlier.
thus a chain of follow me is created.

so the PC wanting to scry is then ported so it appears that they are witnessing this PC from afar...just like a scry!

yay.

now can anyone help me streamline it abit to utilize a cutscene?
also as another option (if viable) can the cutscene be triggered to 'follow' the critter? basically a drive mode cam?
like in the default setup for different game views?

as it is now, the player can move the camera all around the way they wish...not bad but I would like to keep it 'focused' on the main PC we are trying to scry.


here is the code.


OnAction of the dialog that will set the custom tokens to player names and set-up the variables and invisible creature spawns.

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void main()
{
object oUser = GetPCSpeaker();
int iPCTot = 0;  /* total number of PC's in game */
string sPCName;
string sMyname;
string sPCArea;
string sMessage;
string sPCLevel;
location lLoc;
location lLoc2;
sMyname = GetName(oUser);
string sMynameIP = GetPCPublicCDKey(oUser,TRUE);
string sPCNameIP;
int iVal = 88776;
lLoc2 = GetLocation(OBJECT_SELF);

///////////////loops//////////////////////////////////////
object oPC = GetFirstPC();
while (oPC != OBJECT_INVALID)
{
iPCTot++;
{
sPCName = GetName(oPC);
///
sPCNameIP = GetPCPublicCDKey(oPC,TRUE);
////
lLoc = GetLocation(oPC);
sPCArea = " is in Area [" + GetName(GetArea(oPC)) + "] ";
sPCLevel ="Current Total Level is: [ "+ IntToString(GetHitDice(oPC)) + " ] ";
sMessage = sPCName + sPCArea + sPCLevel ;
object oInvis = GetObjectByTag(IntToString(iVal+iPCTot)+sPCNameIP);
if (oInvis == OBJECT_INVALID)
{
object oInvis = CreateObject(OBJECT_TYPE_CREATURE, "scrywp", lLoc,FALSE, IntToString(iVal+iPCTot)+sPCNameIP);
AssignCommand(oInvis,ActionForceFollowObject(oPC, 1.1));
SetCommandable(FALSE, oInvis);
}
AssignCommand(oInvis,ActionForceFollowObject(oPC, 1.1));
SetCommandable(FALSE, oInvis);
//DestroyObject(oInvis, 20.0);
object oInvis2 = GetObjectByTag("scry"+sMynameIP);
if (oInvis2 == OBJECT_INVALID)
{
object oInvis2 = CreateObject(OBJECT_TYPE_CREATURE, "scrydum1", lLoc2,FALSE, "scry"+sMynameIP);
SetLocalString(oInvis2,IntToString(iVal+iPCTot), IntToString(iVal+iPCTot));
SetLocalString(oInvis2,IntToString(iVal+iPCTot)+"name", sPCName);
SetLocalString(oInvis2,IntToString(iVal+iPCTot)+"ipname", sPCNameIP);
}
SetLocalString(oInvis2,IntToString(iVal+iPCTot), IntToString(iVal+iPCTot));
SetLocalString(oInvis2,IntToString(iVal+iPCTot)+"name", sPCName);
SetLocalString(oInvis2,IntToString(iVal+iPCTot)+"ipname", sPCNameIP);
SetCustomToken(iVal+iPCTot, sPCName);
SetCustomToken(10+iVal+iPCTot, sMessage);
}
    oPC = GetNextPC();
}
///////////////////end loops/////////////////////////
 
sMessage = "[ There are a total of [ " + IntToString(iPCTot) +" ] Players currently online ]";
FloatingTextStringOnCreature(sMessage, oUser);
}



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
the next script is ONAction taken for the selected PC we wish to scry.


////////////////////////////////////////
//#include "nw_i0_tool"
void main()
{
  object oPC = GetPCSpeaker();
  string sMyName = GetPCPublicCDKey(oPC,TRUE);// get name of PC triggering scry
  object oDummy1 = GetObjectByTag("scry"+sMyName); //get our binding creature (specified byname for multiplay)
  string sName = GetLocalString(oDummy1,"88777"); // get the 88777 # associated
  string sPCName = GetLocalString(oDummy1,sName+"ipname");//get cdkey of PC we are setting to scry on
  object oDummyMoveTo = GetObjectByTag(sName+sPCName);// get the 88777ref and name of creature to create unique name
  location lLoc = GetLocation(oDummyMoveTo); // get location of PC we are trying to scry
  effect eEffect;
  eEffect = EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);
  eEffect = SupernaturalEffect(eEffect);
 ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eEffect, oPC,65.0);
  FloatingTextStringOnCreature("DEBUG:You wish to teleport to "+(sName+sPCName), oPC);
  FloatingTextStringOnCreature("DEBUG:your bind tag is 'scry"+sMyName+"'", oPC);

  ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oPC));
  AssignCommand(oPC, JumpToLocation(lLoc));
  AssignCommand(oPC, FloatingTextStringOnCreature("Your vision fades as you begin to focus upon the crystal ball and repeat the name "+sPCName+"....",oPC,FALSE));
  DelayCommand(1.0,SetCommandable(FALSE,oPC));
  DelayCommand(59.8, SetCommandable(TRUE, oPC));
  AssignCommand(oPC, FloatingTextStringOnCreature("Your vision fades as you begin to focus upon the crystal ball and repeat the name "+sPCName+"....",oPC,FALSE));
  AssignCommand(oPC, PlaySound("as_mg_telepout1"));
  AssignCommand(oPC, ActionForceFollowObject(oDummyMoveTo, 1.0));
  AssignCommand(oPC,DelayCommand(60.0,FloatingTextStringOnCreature("....Your vision slowly begins to return back to your body",oPC,FALSE)));
  AssignCommand(oPC,DelayCommand(60.0,JumpToLocation(GetLocation(oDummy1))));
  DelayCommand(60.1,ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oDummy1)));
  AssignCommand(oPC,DelayCommand(60.5,ClearAllActions()));
     }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////




just a few notes.
I am writing this from work so this is my old build of this script/system so I have made changes,cleaned up the code and removed redundant uneccessary calls...so dont worry at all about streamlining anything...

basically I need to call a cutscene (and if possible set camera to follow a specific object that I can define) that starts at or before this line:

''ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oPC));
  AssignCommand(oPC, JumpToLocation(lLoc));


and end at this one:
AssignCommand(oPC,DelayCommand(60.0,JumpToLocation(GetLocation(oDummy1))));
  DelayCommand(60.1,ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oDummy1)));
  AssignCommand(oPC,DelayCommand(60.5,ClearAllActions()));


these last two excerpts were taken from last code chunk.


Thank you as always.
Low
 
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
Custom scry event
« Reply #1 on: April 19, 2011, 08:15:20 pm »


               Commands you will want to use would include some of the following:



SetCutsceneMode()

EffectCutsceneParalyze()

I'm sure you'll  know what to do with these once you eyeball the engine's explanation - else just drop me a msg and I'll send you some more evolved code bits.

BTW, we have scrying working - as always, lag free, crash free, if you'd like to talk shop let me know.

Be well. Game on.
GM_ODA
               
               

               


                     Modifié par ehye_khandee, 19 avril 2011 - 07:20 .
                     
                  


            

Legacy_Builder_Anthony

  • Hero Member
  • *****
  • Posts: 786
  • Karma: +0/-0
Custom scry event
« Reply #2 on: April 20, 2011, 02:30:53 pm »


               Whats the name of your server and where is it located
               
               

               
            

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
Custom scry event
« Reply #3 on: April 21, 2011, 12:10:58 pm »


               http://arborfalls.dyndns-web.com/

or were you asking for Ehye_Khandee's server?
which is:
66.232.100.90
               
               

               
            

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
Custom scry event
« Reply #4 on: April 21, 2011, 12:12:58 pm »


               I also see this posted on the vault within a day of this initial post

http://nwvault.ign.c....Detail&id=3809

...spooky. But the vault looks to be waaaay more detailed...so I might give that option a go...