About: GetSurfaceMaterialAtLocation   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

When using this function it helps to think of the return value as a number within a range rather than a constant value. To clarify, if I wanted something to happen when my PC was standing on a particular type of terrain using this: object oPC = OBJECT_SELF; int nDirt = GetSurfaceMaterialsAtLocation(GetLocation(oPC)); if (nDirt == SM_TYPE_DIRT) { DoThis(); } object oPC = OBJECT_SELF; int nTerrain = GetSurfaceMaterialsAtLocation(GetLocation(oPC)); if ((nTerrain >= SM_TYPE_DIRT) && (nTerrain < SM_TYPE_GRASS)) { DoThat(); } * Added in Patch 1.23

AttributesValues
rdfs:label
  • GetSurfaceMaterialAtLocation
rdfs:comment
  • When using this function it helps to think of the return value as a number within a range rather than a constant value. To clarify, if I wanted something to happen when my PC was standing on a particular type of terrain using this: object oPC = OBJECT_SELF; int nDirt = GetSurfaceMaterialsAtLocation(GetLocation(oPC)); if (nDirt == SM_TYPE_DIRT) { DoThis(); } object oPC = OBJECT_SELF; int nTerrain = GetSurfaceMaterialsAtLocation(GetLocation(oPC)); if ((nTerrain >= SM_TYPE_DIRT) && (nTerrain < SM_TYPE_GRASS)) { DoThat(); } * Added in Patch 1.23
dbkwik:nwn2/proper...iPageUsesTemplate
abstract
  • When using this function it helps to think of the return value as a number within a range rather than a constant value. To clarify, if I wanted something to happen when my PC was standing on a particular type of terrain using this: object oPC = OBJECT_SELF; int nDirt = GetSurfaceMaterialsAtLocation(GetLocation(oPC)); if (nDirt == SM_TYPE_DIRT) { DoThis(); } It wouldn't work because nDirt will almost never be equal to SM_TYPE_DIRT, despite the dark brown patch of dirt it looks like the PC is standing on. To actually have something happen while the PC is standing on a "Dirt" type terrain I would use this: object oPC = OBJECT_SELF; int nTerrain = GetSurfaceMaterialsAtLocation(GetLocation(oPC)); if ((nTerrain >= SM_TYPE_DIRT) && (nTerrain < SM_TYPE_GRASS)) { DoThat(); } Because the range of surface materials that represent the dirt bitmasks are between SM_TYPE_DIRT (8) and SM_TYPE_GRASS (16). * Added in Patch 1.23
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software