OsNpcLoadAppearance
From OpenSimulator
(Difference between revisions)
(New page: {{osslfunc |function_syntax=osNpcLoadAppearance(key npc, string notecard) |csharp_syntax= |description=Load appearance from a notecard. This notecard must contain appearance data created w...) |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
|csharp_syntax= | |csharp_syntax= | ||
|description=Load appearance from a notecard. This notecard must contain appearance data created with one of the save appearance functions. | |description=Load appearance from a notecard. This notecard must contain appearance data created with one of the save appearance functions. | ||
− | |threat_level= | + | |threat_level=High |
− | |ossl_example= | + | |permissions=${OSSL|osslNPC} |
− | |additional_info= | + | |delay=0 |
+ | |ossl_example=<source lang="lsl"> | ||
+ | //Load an appearance notecard on the collided npc with the same name like the npc. | ||
+ | |||
+ | default | ||
+ | { | ||
+ | collision_start(integer num) //On Collision | ||
+ | { | ||
+ | if(osIsNpc(llDetectedKey(0))) //Check is the the agent an npc | ||
+ | { | ||
+ | if(llGetInventoryType(llDetectedName(0)) == INVENTORY_NOTECARD) //is the notecard available | ||
+ | { | ||
+ | osNpcLoadAppearance(llDetectedKey(0), llDetectedName(0)); //load the new appearance | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </source> | ||
+ | |additional_info=This function was added in 0.7.2-post-fixes | ||
+ | '''An important hint:''' | ||
+ | This function works only for the npc owner. | ||
+ | |||
+ | You must create the npc with [[OsNpcCreate]] and the option OS_NPC_NOT_OWNED to allow all others to change the appearance. | ||
}} | }} |
Revision as of 21:01, 25 September 2019
osNpcLoadAppearance(key npc, string notecard)
| |
Load appearance from a notecard. This notecard must contain appearance data created with one of the save appearance functions. | |
Threat Level | High |
Permissions | ${OSSL|osslNPC} |
Extra Delay | 0 seconds |
Example(s) | |
//Load an appearance notecard on the collided npc with the same name like the npc. default { collision_start(integer num) //On Collision { if(osIsNpc(llDetectedKey(0))) //Check is the the agent an npc { if(llGetInventoryType(llDetectedName(0)) == INVENTORY_NOTECARD) //is the notecard available { osNpcLoadAppearance(llDetectedKey(0), llDetectedName(0)); //load the new appearance } } } } | |
Notes | |
This function was added in 0.7.2-post-fixes
An important hint: This function works only for the npc owner. You must create the npc with OsNpcCreate and the option OS_NPC_NOT_OWNED to allow all others to change the appearance. |