logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Converting scripts to persistience. To learn from...

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support
View previous topic :: View next topic  
Author Message
Daijin



Joined: 09 Jul 2007
Posts: 23
Location: Dunjon/Warr Acres, Ok

PostPosted: Sat Jul 14, 2012 20:32    Post subject: Converting scripts to persistience. To learn from... Reply with quote

Can someone show me how to convert these to persistence so I have a basic understanding to learn from?


//::///////////////////////////////////////////////
//:: Teleport: Place Binding
//:: x4_s0_teleport1
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates a "portal" at the caster's location.
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"

void main()
{
//Spellcast Hook Code
if (!X2PreSpellCastCode())
return;
// End of Spell Cast Hook


object oCaster = OBJECT_SELF;
location lTarget = GetLocation(oCaster);

//Clear existing bindings if any
object oBinding = GetLocalObject(oCaster, "oBinding");
if (oBinding != OBJECT_INVALID)
{
DestroyObject(oBinding);
DeleteLocalObject(oCaster, "oBinding");
}

oBinding = CreateObject(OBJECT_TYPE_WAYPOINT, "x4_wp_telebnd", lTarget);
//If this binding is placed, assign values
if (GetIsObjectValid(oBinding) == TRUE)
{
DelayCommand(1.0, SetLocalObject(oCaster, "oBinding", oBinding));
DelayCommand(1.0, SetLocalObject(oBinding, "oCreator", oCaster));
}
}




and




//::///////////////////////////////////////////////
//:: Teleport: Place Binding
//:: x4_s0_teleport1
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Jump the caster and all associates to the previously placed
"binding."
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"

void main()
{
//Spellcast Hook Code
if (!X2PreSpellCastCode())
return;
// End of Spell Cast Hook

object oCaster = OBJECT_SELF;
object oBinding = GetLocalObject(oCaster, "oBinding");

if (oBinding != OBJECT_INVALID)
{
object oTeleport = GetFirstFactionMember(oCaster, FALSE);
while (oTeleport != OBJECT_INVALID)
{
//* Take the Caster and anybody who calls them master
if ((oTeleport == oCaster) || (GetMaster(oTeleport) == oCaster))
{
AssignCommand(oTeleport, ClearAllActions(TRUE));
AssignCommand(oTeleport, ActionJumpToObject(oBinding, FALSE));
}
oTeleport = GetNextFactionMember(oCaster, FALSE);
}
}
else
{
SendMessageToPC(oCaster, "You must place a portal before teleporting!");
}
}
_________________
Daijin Dreamweaver, Leader of the Dream Warriors for 32 Earth years.
Faith, Loyalty, Honor, Truth and Friendship always.
I live to serve, O' Lord Jesus, Thy Will Be Done!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group