Difference between revisions of "GetLocation"

From NWN Lexicon
Jump to: navigation, search
Line 1: Line 1:
20171215 junda
+
 
http://www.ysloutlet.us.com
+
 
http://www.footballshirts.me.uk
+
 
http://www.longchampsoldes.fr
+
 
http://www.michaelkorscybermonday.us.com
+
=GetLocation(object)=
http://www.christianlouboutin-shoes.me.uk
+
 
http://www.poloralphlaurens.me.uk
+
Gets the location of an object.
http://www.niketrainersnikeshoes.co.uk
+
 
http://www.michaelkors.de.com
+
<nwscript>
http://www.rayban--sunglasses.co.uk
+
location GetLocation(
http://www.pandoraoutlet-store.us.com
+
    object oObject
http://www.michaelkors.eu.com
+
);
http://www.oakleysunglassescheapoutlet.us.com
+
</nwscript>
http://www.coach-outletonlinesale.us.com
+
 
http://www.mulberryoutlets.org.uk
+
====Parameters====
http://www.coachoutlet-onlines.us.com
+
 
http://www.uggoutletonlinestore.us.org
+
''oObject''
http://www.canadagooseoutlets.name
+
 
http://www.nikerosherun.me.uk
+
The object to get the location of.
http://www.coachcanada-outlet.ca
+
 
http://www.coachoutletcoupons.us.com
+
<br />
http://www.truereligionjeans.org.uk
+
 
http://www.uggsoutlet-boots.us.com
+
====Description====
http://www.lebronjamesshoess.us.com
+
 
http://www.uggbootsclearancesale.us.org
+
Returns the location of the object passed. The object can be any valid object. <br /><br /> Note: A location is made up of a vector position (X, Y, Z) area (object) and facing (0-360 degrees). All can be got by the different functions, GetFacingFromLocation(), GetAreaFromLocation(), and GetPositionFromLocation().
http://www.michaelkorsoutletca.us.com
+
 
http://www.polooutletclearance.us.com
+
<br /><br />
http://www.rayban-sunglassesoutlet.us.com
+
 
http://www.uggoutletstoresofficial.us.com
+
====Remarks====
http://www.mikmok.com
+
 
http://www.christianlouboutinonline.us.com
+
An invalid object will still return a location, of a sort. As you cannot compare a return value from this to, say, LOCATION_INVALID, you must use either an always valid object, or use GetAreaFromLocation() and compare it to OBJECT_INVALID. <br /><br /> There is a problem with GetLocation() and it working on the exiting object (PC) of the On Client Exit event. This is easily worked around, and comes on good authority that it works without problems. See the code sample for how it works, using the On Module Heartbeat event, and the On Client Enter (Or other, see the notes below), and On Client Exit events.
http://www.pandoraoutletstore.us.org
+
 
http://www.ralph-laurenpolo.us.com
+
<br />
http://www.fitflop.in.net
+
 
http://www.coachoutletcoachfactoryoutlet.us.com
+
====Known Bugs====
http://www.michaelkorsoutletme.us.com
+
 
http://www.coachoutletclearance.us.com
+
There is now a workaround to the old problem of GetLocation() not working in the OnClientLeave event, noted above and below.
http://www.canadagoosejackets-uk.org.uk
+
 
http://www.coachoutletonlinefactorystore.us.com
+
<br />
http://www.katespadeoutletonlines.us.com
+
 
http://www.oakleysunglassesoutlet-online.us.com
+
====Version====
http://www.coachoutletclearanceonline.us.com
+
 
http://www.adidasnmdad.us.com
+
1.62
http://www.uggoutletusa.us.com
+
 
http://www.huarachesshop.com
+
====Example====
http://www.cheapnba-jerseys.us.com
+
 
http://www.niketrainers-uk.org.uk
+
<nwscript>
http://www.uggoutletshop.us.com
+
// This will cause the first player to cast a fake fireball at the npc
http://www.coachoutletcanada.com.co
+
void main()
http://www.oakleysunglasses-uk.org.uk
+
{
http://www.michaelkors-outletonlineclearance.us.com
+
    location lTarget = GetLocation(GetObjectByTag("NPC"));
http://www.marc-jacobs.us.org
+
    AssignCommand(GetFirstPC(), ActionCastFakeSpellAtLocation(SPELL_FIREBALL, lTarget));
http://www.uggbootscybermonday.us.com
+
}
http://www.uggsoutlet.ca
+
 
http://www.nikeshoesfactory.us.com
+
// The fix to the GetLocation() and persistant locations in persistant
http://www.outletchristianlouboutin.us.com
+
// worlds has many fixes, this one is quite simple for anyone
http://www.christianlouboutinoutletfactory.us.com
+
// needing it and has been provided by Muirwen. This is for more
http://www.true-religion.org.uk
+
// advanced scripters - you have been warned, incase anything
http://www.adidasnmduk.org.uk
+
// goes wrong!
http://www.adidas-wings.in.net
+
 
http://www.michaelkors-outletonlinesale.us.com
+
// The modules On Heartbeat event will capture, and set on each
http://www.toryburchoutletstores.us.org
+
// PC,  thier current location.
http://www.birkenstock-outlet.us.com
+
// - An alternative use of this way (using SetLocalLocation()) might
http://www.long-champhandbags.co.uk
+
//   be in an area's On Enter event, which can be more selective
http://www.swarovskioutletstores.us.com
+
//   (you choose which areas have the script) and means the PC
http://www.coach-outletclearance.us.com
+
//   should be in a safer location.
http://www.niketrainers-uk.co.uk
+
// - In addition, using GetLocation() will not be that persistant
http://www.addidasshoes.net
+
//   over changes in the module. Using vectors, and area's tags
http://www.michaelkorsfactory-outlets.us.com
+
//   might be better, and can easily be subsituted in a similar way.
http://www.uggsoutletonlinestore.us.com
+
 
http://www.cheap-snapbacks.us.com
+
void main()
http://www.jordanshoesstore.us.com
+
{
http://www.cheapoakleysunglassesfactory.us.com
+
    // Loop all the PC's
http://www.uggsbootsclearance.us.org
+
    object oPC = GetFirstPC();
http://www.fitflopssale.me.uk
+
    while(GetIsObjectValid(oPC))
http://www.coachoutlet-clearance.us.com
+
    {
http://www.michaelkorswallets.us.org
+
        // Note: Must be in a valid area, not "in transition" between them
http://www.burberrysaleoutlet.us.com
+
        if(GetIsObjectValid(GetArea(oPC)))
http://www.poloralphlaurendiscount.us.com
+
        {
http://www.poloralphlaurenoutlet-online.us.com
+
            // Save the PC's location to them
http://www.raybansunglassesok.us.com
+
            SetLocalLocation(oPC, "EXIT_LOCATION", GetLocation(oPC));
http://www.vansshoesoutletstore.us.com
+
        }
http://mulberryoutlet.outlet-store.co.uk
+
        oPC = GetNextPC();
http://www.michaelkorsoutletcheap.us.com
+
    }
http://www.salvatore-ferragamo.in.net
+
}
http://www.eccosale.com
+
 
http://www.pradahandbagsuk.co.uk
+
// The On Client Enter will get the PC's details (the CD key and so
http://www.ferragamo-outlets.us.com
+
// forth) and make a 32 string value to make sure persistant
http://www.canadagooseparka.name
+
// locations are stored and got correctly.
http://www.moncleroutletonline.us.com
+
 
http://www.canadagooseoutlet-stores.com
+
// Big note: I recommend this being put in the On Used event of a
http://www.oakleysunglasseseye.us.com
+
// portal, in a seperate out-of-character starting area, else this
http://www.ferragamooutletstore.net
+
// can go wrong.
http://www.michaelkorsukhandbags.co.uk
+
 
http://www.longchampoutlet1.us.com
+
void main()
http://www.nikeshoesforwomen.us.com
+
{
http://www.pandoracharmss.us.com
+
    // Get the entering PC
http://www.nhljerseysforsale.us.com
+
    object oPC = GetEnteringObject();
http://www.vans-shoes.cc
+
 
http://www.longchampoutletonlines.us.com
+
    // Get the PC's CD key, and character name
http://www.burberryoutletstore.in.net
+
    string sAccountName = GetPCPlayerName(oPC);
http://www.nfljerseysonlines.us.com
+
    string sName = GetName(oPC);
http://www.coachoutletstore.com.co
+
 
http://www.michael-korsoutletuk.org.uk
+
    // If either is over 24 characters, we chop it. There is a
http://www.oakleysunglasseswholesaleusa.us.com
+
    // limit of 32 total characters for the database entry.
http://www.oakleysunglassesoutletcheap.us.com
+
    sAccountName = GetStringLeft(sAccountName, 24);
http://www.nikeshoesusa.us.com
+
    sName = GetStringLeft(sName, 24);
http://www.cheapjordan-shoes.us.com
+
 
http://www.pandorajewellery.cc
+
    // Create the string that the database uses
http://www.uggboots-australia.us.com
+
    // We add a little ` just so it has something to divide it.
http://www.hervelegeroutlet.us.com
+
    string sDB = GetStringLeft(sAccountName + "`" + sName, 32);
http://www.ralphlauren-pascher.fr
+
 
http://www.soccerjerseys.us.com
+
    // Set the PC's database name, and also move them to thier stored
http://www.michaelkors-handbagsuk.me.uk
+
    // location.
http://www.ray-bansunglassesofficial.us.com
+
    SetLocalString(oPC, "EXIT_DATABASE_LOCATION_NAME", sDB);
http://www.ralphlauren-outletuk.co.uk
+
 
http://www.long-champpliage.fr
+
    location lMoveTo = GetCampaignLocation("LOCATION_STORAGE", sDB);
http://www.oakleysunglassesoutletsale.us.com
+
 
http://www.pradasunglasses.us.com
+
    // Note: As lMoveTo may well be invalid, we make sure with an area check
http://www.mulberryhandbags-uk.me.uk
+
    if(GetIsObjectValid(GetAreaFromLocation(lMoveTo)))
http://www.kobeshoes.us
+
    {
http://www.polooutletonlinestores.us.com
+
        DelayCommand(5.0, AssignCommand(oPC, JumpToLocation(lMoveTo)));
http://www.hermes-birkin.in.net
+
    }
http://www.poloralphlaurensale.us.com
+
}
http://www.raybansunglassescheapsale.us.com
+
 
http://www.michaelkorsoutletonline-stores.us.com
+
// This will be put in the On Client Exit event, and will store, in
http://www.simlogy.com
+
// a database (under the local string set On Client Enter), the
http://www.edhardy.us.com
+
// last location done in the heartbeat script, but no more.
http://www.ugg-outletsstore.us.com
+
 
http://www.shoelysale.com
+
void main()
http://www.reebokoutletstores.us.com
+
{
http://www.michaelkorsoutletclearance-online.us.com
+
    // Get the PC
http://www.ugg-bootsoutlet.us.org
+
    object oPC = GetExitingObject();
http://www.katespadeoutletonlinestores.us.com
+
 
http://www.coachhandbagsclearance.us.com
+
    // Make sure to save the last location in the database
http://www.christianlouboutinoutletsale.us.com
+
    string sDB = GetLocalString(oPC, "EXIT_DATABASE_LOCATION_NAME");
http://www.fitflopsshoes.me.uk
+
    location lStore = GetLocalLocation(oPC, "EXIT_LOCATION");
http://www.michaelkorsoutletwww.us.com
+
 
http://www.polooutletsale.us.com
+
    // Store it
http://www.cheapuggbootsonline.us.com
+
    SetCampaignLocation("LOCATION_STORAGE", sDB, lStore);
http://www.hermesoutletstore.us.com
+
}
http://www.lacostepoloshirts.us
+
</nwscript>
http://www.uggoutlets.ca
+
 
http://www.raybansunglassesforwomens.us.com
+
====See Also====
http://www.airmax-trainers.co.uk
+
 
http://www.canadagooseoutletstoresale.us.com
+
{| class="seealso"
http://www.fredperrypolo-shirts.com
+
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
http://www.monclersjackets.com
+
|
http://www.ralphlaurenpoloshirts.org.uk
+
[[  Location  | Location ]]
http://www.coachoutlet-store.us.org
+
|-
http://www.canadagoosejacketssale.co.uk
+
|}
http://www.michaelkorsoutletonline-shop.us.com
+
 
http://www.polotshirts.org
+
<br />
http://www.coachfactoryoutletcoachoutlet.us.com
+
----
http://www.pandora-outletstore.us.com
+
<font color="gray">  author: GoLeM, editor: Jasperre, additional contributor(s): Lilac Soul, Jasperre, Muirwen</font><br />  <br />
http://www.poloralphlaurenfactorystore.org.uk
+
[[Category:Functions]]
http://www.fitflopssaleclearance.in.net
+
[[Category:Get_Data_Functions]]
http://www.canada-goosejacketsoutlet.us.com
+
[[Category:Targeting_Functions]]
http://www.toryburchoutletclearance.us.com
 
http://www.oakleysunglassescheapwholesale.us.com
 
http://www.raybansunglasses-outlets.us.com
 
http://www.adidastrainersshoes.co.uk
 
http://www.canadagooseoutletclearance.us.com
 
http://www.uggoutlets-store.us.com
 
http://www.canadagoosejacketssale.ca
 
http://www.raybansunglassesonsales.us.com
 
http://www.christianlouboutins.org.uk
 
http://www.bottega-venetaoutlet.us
 
http://www.coachoutletstoreoutlet.us.com
 
http://www.uggsoutletssale.us.com
 
http://www.airmax90uk.me.uk
 
http://www.nikeairhuaraches.co.uk
 
http://www.canada--goosejackets.ca
 
http://www.uggoutletclearance.us.com
 
http://www.cheapnfljerseysus.us.com
 
http://www.jordanshoesoutlet.us.com
 
http://www.katespadeoutletstore.us
 
http://www.michaelkorsoutletmichaelkorsoutletonline.us.com
 
http://www.toryburch.com.co
 
http://www.christianlouboutinoutletshop.us
 
http://www.hermesbelts.us.com
 
http://www.coachoutletonline.com.co
 
http://www.jordan-shoes.us.com
 
http://www.uggboots-clearance.us.org
 
http://www.ferragamoshoes.org.uk
 
http://www.coachfactoryoutletstores.us.org
 
http://www.toryburchoutlets.us.org
 
http://www.toryburchoutlet-online.us.com
 
http://www.thomassabocharms.me.uk
 
http://www.oakleysunglasseswholesaleus.us.com
 
http://www.uggsoutletuggboots.us.com
 
http://www.cheapnhljerseyss.us.com
 
http://www.airforce1.us.com
 
http://www.jordanshoesshop.us.com
 
http://www.raybansunglassesrbs.us.com
 
http://www.canadagoose-jackets.us.org
 
http://www.yeezyboostoutlet.us.com
 
http://www.basketballshoes.us.com
 
http://www.coachoutletstoreonlineclearance.us.com
 
http://www.airmax90.us.com
 
http://www.nikeairmax90.nl
 
http://www.cheapmlbjerseys.net
 
http://www.cheapmichaelkors-handbags.us.com
 
http://www.nikefree5.us
 
http://www.giuseppe-zanotti-outlet.org
 
http://www.ugg-outletonlineclearance.us.com
 
http://www.fitflopsshoes.in.net
 
http://www.truereligionjeansoutlets.us.com
 
http://www.fitflopssale.us
 
http://www.uggsoutlet-stores.us.com
 
http://www.canadagooseoutlet-store.name
 
http://www.michaelkorsoutletfriday.us.com
 
http://www.michaelkorshandbags-onsale.us.com
 
http://www.moncler-jackets.org.uk
 
http://www.nfljerseysusa.us.com
 
http://oakley.sunglassess.us.com
 
http://www.uggbootsblackfridays.us.com
 
http://www.canada-gooseoutletstore.com
 
http://www.truereligionjeanssale.com
 
http://www.uggoutletofficials.us.com
 
http://www.uggoutlet.ca
 
http://www.canadagooseblackfriday.us.com
 
http://www.michaelkorsoutletclearanceinc.us.com
 
http://www.michaelkorsoutlet-sale.us.com
 
http://www.adidas-uk.me.uk
 
http://www.pandoraoutletjewelry.us.com
 
http://www.coachoutletclearance.us.org
 
http://www.michaelkorsoutlet-uk.me.uk
 
http://www.coachoutletonline-clearance.us.com
 
http://www.canadagooseoutlet-online.com
 
http://www.cheapjordansonline.us.com
 
http://www.truereligionoutletclearance.us.com
 
http://www.uggoutletonlineclearance.us.org
 
http://www.michaelkorsofficial.us.com
 
http://www.canadagooseoutletss.us.com
 
http://www.uggcybermonday.us.com
 
http://www.christianlouboutinoutletcl.us.com
 
http://www.coachoutletoutlet.us.com
 
http://www.poloralphlauren-outlets.us.com
 
http://www.newbalanceshoes.in.net
 
http://www.tomsnosko.com
 
http://www.salomonshoessalomonoutlet.us.com
 
http://www.moncler.us.com
 
http://www.ralphlaurenpolo.eu.com
 
http://www.coachoutletcoachoutletonline.us.com
 
http://www.canadagooseoutletstore.cc
 
http://www.coachoutletsales.us.com
 
http://www.truereligionoutlet-store.us.com
 
http://www.handbagslongchamp.us.com
 
http://www.kobebryantshoes.in.net
 
http://www.todsoutlet.us.org
 
http://www.longchamphand-bags.co.uk
 
http://www.pandoracharms-saleclearance.org.uk
 
http://www.truereligionjeans.co.uk
 
http://www.hermesoutletonline.us.com
 
http://www.canadagoosejacketsca.ca
 
http://www.polo-outletstore.us.com
 
http://www.oakleysunglasseswholesaleoakley.us.com
 
http://www.foampositeshoe.net
 
http://www.cazaloutlet.us.com
 
http://www.raybansunglasses1.us.com
 
http://www.christian-louboutinoutletstore.us.com
 
http://www.christian-louboutin.us.org
 
http://www.cheapsoccerjersey.net
 
http://www.ralphlaurenpoloshirtss.us.com
 
http://www.nikeblazerpaschers.fr
 
http://www.chicagoblackhawksjerseys.us.com
 
http://www.michaelkorsoutletfactorystore.us.com
 
http://www.toryburch-outletstore.in.net
 
http://www.pandoraoutletshop.us.com
 
http://www.coach-outletstore.us.org
 
http://www.asics-shoes.us.com
 
http://www.truereligion-jeansoutlet.us.com
 
http://www.swarovskicrystaluk.org.uk
 
http://www.pandorajewelrycharm.us.com
 
http://www.poloralphlaurens.org.uk
 
http://www.fitflopsoutletsale.com
 
http://www.uggsoutletclearance.us.org
 
http://www.coachoutletonline-factory.us.com
 
http://www.oakley-sunglasseswholesale.us.com
 
http://www.canadagooseoutletstores.name
 
http://www.nikeshoessale.us.com
 
http://www.canadagooseoutletofficial.name
 
http://www.michaelkorsoutletclearanceus.us.com
 
http://www.coachoutletstorecoach.us.com
 
http://www.uggoutletscheap.us.com
 
http://www.cheapmlbjerseyss.us.com
 
http://www.true-religionjeanssale.us.com
 
http://www.airmax90uk.co.uk
 
http://www.coachoutletonlinecoachfactory-outlet.us.com
 
http://www.cartieroutlets.us.com
 
http://www.canadagoosesjackets.com.co
 
http://www.poloralphlaurencheap.us.com
 
http://www.airhuaracheuk.org.uk
 
http://www.canadagooseoutletca.us.com
 
http://www.canadagoosecybermonday.us.com
 
http://www.uggoutletcheap.us.com
 
http://www.reeboktrainers.me.uk
 
http://www.uggoutletuggs.us.com
 
http://www.oakley-sunglasses.nom.co
 
http://www.montblancpenssale.us.com
 
http://www.katespade-outlets.us.org
 
http://www.coachoutletonline.us.org
 
http://www.eccoshoesoutlet.us.com
 
http://www.mulberrysaleuk.org.uk
 
http://www.ralphlauren-polo.us.org
 
http://www.cheap-jordanshoes.us.com
 
http://www.nfljerseysus.us.com
 
http://www.coachoutletonlineclearance.us.com
 
http://www.raybansunglassesonlines.us.com
 
http://www.polooutletpolo.us.com
 
http://www.truereligionjeansoutlet.co.uk
 
http://www.toryburchoutletonlinestore.us.com
 
http://www.uggsoutletscheap.us.com
 
http://www.pradaoutlet.us
 
http://www.ralphlaurenpolo.us.org
 
http://www.oakleysunglasses-sale.us.com
 
http://www.truereligion-jean.us.com
 
http://www.coach-factoryoutletclearance.us.com
 
http://www.jordanshoesfactory.us.com
 
http://www.ralphlaurenoutlet.org.uk
 
http://www.canadagoosejackets-outlet.us.com
 
http://www.uggsboots.ca
 
http://www.oakleysunglassesformens.us.com
 
http://www.coachfactoryoutletoutlet.us.com
 
http://www.max1.nl
 
http://www.montblancpenss.us.com
 
http://www.longchampoutlet.us.com
 
http://www.oakleysunglassesofficial.us.com
 
http://www.oakleysunglasseswholesalestore.us.com
 
http://www.mulberryhandbagssale.me.uk
 
http://www.michaelkorsoutletonlinefactory.us.com
 
http://www.ralphlaurenoutletclearance.us.com
 
http://www.cheap-nfljerseyschina.us.com
 
http://www.michaelkorshandbagsclearancestore.us.com
 
http://www.raybansunglassesusa.us.com
 
http://www.nbajerseysnike.us.com
 
http://www.truereligionjeans-canada.com
 
http://www.longchamppascher.fr
 
http://www.uggoutletstoress.us.com
 
http://www.ralphlaurenpoloshirt.us.com
 
http://www.pandoracharmsofficial.us.com
 
http://www.raybanssunglassesoutlets.us.com
 
http://www.canadagoosejackets.me.uk
 
http://www.oakleysunglassescheapsale.us.com
 
http://www.uggsbootsclearance.us.com
 
http://www.michaelkorsoutletonlineus.us.com
 
http://www.sunglassesrayban.org.uk
 
http://www.coach-factoryoutlets.us.org
 
http://www.swarovski-outlets.us.com
 
http://www.pandoraoutlets.us.org
 
http://www.michaelkorsoutletmks.us.com
 
http://www.montblancpensoffcial.us.com
 
http://www.poloralphlaurenwholesale.us.com
 
http://www.montblanc-pensoutlet.us.com
 
http://www.christian-louboutin-heels.com
 
http://www.cheapjerseyswholesale.org
 
http://www.converseshoes.us.com
 
http://www.raybansunglasses-sales.us.com
 
http://www.raybansunglassesofficialsite.us.com
 
http://www.poloralphlaurenofficial.us.com
 
http://www.raybansunglasseshut.us.com
 
http://www.nikeoutletonline.us.org
 
http://www.conversestar.com
 
http://www.nikeairmax-90.org.uk
 
http://www.michaelkorsbagss.co.uk
 
http://www.valentinooutlet.us.com
 
http://www.lakersjerseys.us.com
 
http://www.uggoutletonline-clearance.us.com
 
http://www.nfljerseyss.us.com
 
http://www.coachoutlet-canada.ca
 
http://www.nikean.com
 
http://www.moncler-jackets.co.uk
 
http://www.michaelkorsoutletnew.us.com
 
http://www.pandoracharmssaleclearances.co.uk
 
http://www.coachoutletonlinecoachoutlet.us.com
 
http://www.oakleysunglassesusa.us.com
 
http://www.uggblackfridays.us.com
 
http://www.kicksnice.com
 
http://www.chromeheartsoutletstore.us.com
 
http://www.coachoutletstores.eu.com
 
http://www.ralphlauren-poloshirts.org.uk
 
http://www.longchamphandbagsuk.me.uk
 
http://www.jordanshoesclearance.us.com
 
http://www.coach-handbags.us.com
 
http://www.ferragamoshoesofficial.us.com
 
http://www.michaelkorsoutlet-storesofficial.us.com
 
http://www.michaelkorsoutletnyc.us.com
 
http://www.michael-korsoutletuk.me.uk
 
http://www.birkenstocksandals.me.uk
 
http://www.coachfactoryoutletclearance.us.com
 
http://www.canadagooseoutletstore.ca
 
http://www.timberlandboots.net
 
http://www.katespadeoutletonlinestore.us.com
 
http://www.airjordan4.org
 
http://www.raybansunglasses2.us.com
 
http://www.linksoflondon.org.uk
 
http://www.fitflopssale.in.net
 
http://www.nikeairmax-90.me.uk
 
http://www.oakleysunglasseswholesaleauthentic.us.com
 
http://www.cheapjordansfreeshipping.us.com
 
http://www.nikerosheone.us
 
http://www.cheapoakleysunglassesformen.us.com
 
http://www.christianlouboutin-outletsale.us.com
 
http://www.swarovski-outlet.us.com
 
http://www.mulberryhandbagss.org.uk
 
http://www.christianlouboutin-outlet.me.uk
 
http://www.oakleysunglassesoak.us.com
 
http://www.oakleysunglasseswholesalechina.us.com
 
http://www.chromeheartsoutlet.com.co
 
http://www.kevindurantshoes.net
 
http://www.cheapsnapbacks.net
 
http://www.polooutletfactorystore.us.com
 
http://www.pandoracharmsonline.us.com
 
http://www.christianlouboutin-outlet.us.org
 
http://www.michaelkorsoutletclearancer.us.com
 
http://www.poloralph-lauren.us.com
 
http://www.canada--goose.ca
 
http://www.swarovskicrystaluk.me.uk
 
http://www.canadagooseoutletsstore.com.co
 
http://www.ralph-laurenpoloshirts.us.com
 
http://www.uggbootsclearancesale.us.com
 
http://www.michaelkorsoutletcoupons.us.com
 
http://www.nfljerseysofficial.us.com
 
http://www.clearancefitflopssale.com
 
http://www.pandoraoutletinc.us.com
 
http://www.canadagooseoutletusa.us.com
 
http://www.moncler.us.org
 
http://www.uggoutlet-onlineclearance.us.com
 
http://www.nikeshoesstore.us.com
 
http://www.raybans-sunglasses.us.com
 
http://www.michaelkorshandbags.in.net
 
http://www.adidasoutletstore.in.net
 
http://www.mulberry-handbagsoutlet.org.uk
 
http://www.polo-outletonline.us.com
 
http://www.oakleysunglasses-clearance.us.com
 
http://www.pradashoesofficial.us
 
http://www.michae-kors-outlet.ca
 
http://www.canadagooseoutletoutlet.us.com
 
http://www.ferragamooutletstore.us.com
 
http://www.futbol-baratas.com
 
http://www.canadagooseoutletgoose.us.com
 
http://www.coachoutletonlineco.us.com
 
http://www.suprashoes.us.com
 
http://www.nike-airmax2015.us
 
http://www.cheap-jerseyswholesale.us.com
 
http://www.pandorajewelryoutlet.us.com
 
http://www.swarovskioutletstore.us.com
 
http://www.michaelkorsoutletonlinecheap.us.com
 
http://www.shoesjordan.net
 
http://www.michaelkorssuk.org.uk
 
http://www.christianlouboutin-shoes.co.uk
 
http://www.adidasko.com
 
http://www.michaelkorsoutletkors.us.com
 
http://www.toryburchoutletofficial.us.com
 
http://www.truereligion-jeanssale.us.com
 
http://www.cheap-uggsoutlet.us.com
 
http://www.katespadesoutletonlinestore.us.com
 
http://www.nfljerseysfactorystore.us.com
 
http://www.pumaoutlet-online.com
 
http://www.christianlouboutin-shoes.us.org
 
http://www.coachfactoryoutlet-sale.us.com
 
http://www.canadagoose-jackets.org.uk
 
http://www.michaelkorsoutletcheapsale.us.com
 
http://www.coach-onlineoutlet.us.com
 
http://www.clevelandcavaliers.us.com
 
http://www.ralphlauren-poloshirts.us.com
 
http://www.coachfactoryoutletshop.us.org
 
http://www.mont-blancpens.com.co
 
http://www.outlettruereligion.in.net
 
http://www.truereligionjeansclearance.us.com
 
http://www.nikeshoes-outlet.us.com
 
http://www.nikeoutlets.us.org
 
http://www.michaelkorsoutletz.us.com
 
http://www.yeezyboost350sale.us.com
 
http://www.coachoutletonline-coachfactoryoutlet.us.com
 
http://www.mulberrybagssale.org.uk
 
http://www.skysneakers.com
 
http://www.mulberrybagsuk.co.uk
 
http://www.ralphlaurenoutletstores.us.com
 
http://www.nikestore-uk.org.uk
 
http://www.dansko-shoes.us.com
 
http://www.uggoutletauthentic.us.com
 
http://www.soccer-shoes.us
 
http://www.long-champsolde.fr
 
http://www.canadagoosecoats.org.uk
 
http://www.ralphlaurenpolo-outlet.us.com
 
http://www.cheapnfljerseysfactorystore.us.com
 
http://www.nike-store.org.uk
 
http://www.oakleysunglassesoakley.us.com
 
http://www.canadagoose-jackets.co.uk
 
http://www.jeanstruereligion.in.net
 
http://www.newbalance2018.com
 
http://www.kobe9elite.us.com
 
http://www.christian-louboutinshoes.us.org
 
http://www.pandoraoutletstore.us
 
http://www.longchamphandbagssale.us.com
 
http://www.nikeairmaxtrainers.co.uk
 
http://www.nikefactoryoutlets.us.com
 
http://www.uggoutletugg.us.com
 
http://www.mbt-shoesoutlet.us.com
 
http://www.rayban-sunglassesoutlets.us.com
 
http://www.uggsoutletstores.us.org
 
http://www.polooutletfactory.us.com
 
http://www.coachoutletonlineshops.us.com
 
http://www.ugg-bootsclearance.us.org
 
http://www.canadagooseoutletstoress.us.com
 
http://www.uggbootsclearance.us
 
http://www.coachfactory-outlets.us.org
 
http://www.michaelkorsoutletonlineofficial.us.com
 
http://www.mcmoutletstore.us.org
 
http://www.canadagoosesoutletstore.com
 
http://www.jordanshoes.us.com
 
http://www.uggsoutletsclearance.us.com
 
http://www.ralphlaurenpolostore.us.com
 
http://www.coachfactoryoutlet-clearance.us.com
 
http://www.michaelkorshandbags-outlets.us.com
 
http://www.maccosmeticsoutlet.us.com
 
http://www.ferragamo.us.org
 
http://www.burberryoutlet.ca
 
http://www.polo-lacostepascher.fr
 
http://www.canadagooseoutletstore.com.co
 
http://www.michaelkorshandbagsoutletstores.us.com
 
http://www.cheapraybansunglasseswholesale.us.com
 
http://www.coachfactoryoutletstore.com.co
 
http://www.burberry-outletstore.in.net
 
http://www.sunglassofficialstore.com
 

Revision as of 16:27, 24 December 2017



GetLocation(object)

Gets the location of an object.

location GetLocation(
    object oObject
);

Parameters

oObject

The object to get the location of.


Description

Returns the location of the object passed. The object can be any valid object.

Note: A location is made up of a vector position (X, Y, Z) area (object) and facing (0-360 degrees). All can be got by the different functions, GetFacingFromLocation(), GetAreaFromLocation(), and GetPositionFromLocation().



Remarks

An invalid object will still return a location, of a sort. As you cannot compare a return value from this to, say, LOCATION_INVALID, you must use either an always valid object, or use GetAreaFromLocation() and compare it to OBJECT_INVALID.

There is a problem with GetLocation() and it working on the exiting object (PC) of the On Client Exit event. This is easily worked around, and comes on good authority that it works without problems. See the code sample for how it works, using the On Module Heartbeat event, and the On Client Enter (Or other, see the notes below), and On Client Exit events.


Known Bugs

There is now a workaround to the old problem of GetLocation() not working in the OnClientLeave event, noted above and below.


Version

1.62

Example

// This will cause the first player to cast a fake fireball at the npc
void main()
{
    location lTarget = GetLocation(GetObjectByTag("NPC"));
    AssignCommand(GetFirstPC(), ActionCastFakeSpellAtLocation(SPELL_FIREBALL, lTarget));
}
 
// The fix to the GetLocation() and persistant locations in persistant
// worlds has many fixes, this one is quite simple for anyone 
// needing it and has been provided by Muirwen. This is for more
// advanced scripters - you have been warned, incase anything
// goes wrong!
 
// The modules On Heartbeat event will capture, and set on each 
// PC,  thier current location.
// - An alternative use of this way (using SetLocalLocation()) might
//   be in an area's On Enter event, which can be more selective 
//   (you choose which areas have the script) and means the PC
//   should be in a safer location.
// - In addition, using GetLocation() will not be that persistant
//   over changes in the module. Using vectors, and area's tags
//   might be better, and can easily be subsituted in a similar way.
 
void main()
{
    // Loop all the PC's
    object oPC = GetFirstPC();
    while(GetIsObjectValid(oPC))
    {
        // Note: Must be in a valid area, not "in transition" between them
        if(GetIsObjectValid(GetArea(oPC)))
        {
            // Save the PC's location to them
            SetLocalLocation(oPC, "EXIT_LOCATION", GetLocation(oPC));
        }
        oPC = GetNextPC();
    }
}
 
// The On Client Enter will get the PC's details (the CD key and so
// forth) and make a 32 string value to make sure persistant
// locations are stored and got correctly.
 
// Big note: I recommend this being put in the On Used event of a
// portal, in a seperate out-of-character starting area, else this
// can go wrong.
 
void main()
{
    // Get the entering PC
    object oPC = GetEnteringObject();
 
    // Get the PC's CD key, and character name
    string sAccountName = GetPCPlayerName(oPC);
    string sName = GetName(oPC);
 
    // If either is over 24 characters, we chop it. There is a
    // limit of 32 total characters for the database entry.
    sAccountName = GetStringLeft(sAccountName, 24);
    sName = GetStringLeft(sName, 24);
 
    // Create the string that the database uses
    // We add a little ` just so it has something to divide it.
    string sDB = GetStringLeft(sAccountName + "`" + sName, 32);
 
    // Set the PC's database name, and also move them to thier stored
    // location.
    SetLocalString(oPC, "EXIT_DATABASE_LOCATION_NAME", sDB);
 
    location lMoveTo = GetCampaignLocation("LOCATION_STORAGE", sDB);
 
    // Note: As lMoveTo may well be invalid, we make sure with an area check
    if(GetIsObjectValid(GetAreaFromLocation(lMoveTo)))
    {
        DelayCommand(5.0, AssignCommand(oPC, JumpToLocation(lMoveTo)));
    }
}
 
// This will be put in the On Client Exit event, and will store, in
// a database (under the local string set On Client Enter), the
// last location done in the heartbeat script, but no more.
 
void main()
{
    // Get the PC
    object oPC = GetExitingObject();
 
    // Make sure to save the last location in the database
    string sDB = GetLocalString(oPC, "EXIT_DATABASE_LOCATION_NAME");
    location lStore = GetLocalLocation(oPC, "EXIT_LOCATION");
 
    // Store it
    SetCampaignLocation("LOCATION_STORAGE", sDB, lStore);
}

See Also

functions: 

Location



 author: GoLeM, editor: Jasperre, additional contributor(s): Lilac Soul, Jasperre, Muirwen