编辑“︁
StendhalScripting/LuaAPI
”︁(章节)
跳转到导航
跳转到搜索
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
== game == The main object that handles setting zone & adding entities to game. Methods: ; ''<span style="color:green">game:add</span>(object)'' : Adds an {{MarauroaFile|master|src/marauroa/common/game/RPObject.java|RPObject}} instance to the current zone. : '''''object:''''' Object to add. ; ''<span style="color:green">game:add</span>(npc)'' : Adds an {{StendhalFile|master|src/games/stendhal/server/entity/npc/NPC.java|NPC}} instance to the current zone. : '''''npc:''''' NPC to add. ; ''<span style="color:green">game:add</span>(creature, x, y)'' : Adds a {{StendhalFile|master|src/games/stendhal/server/entity/creature/Creature.java|Creature}} instance to the current zone. : '''''creature:''''' Creature to add. : '''''x:''''' Horizontal position of where to add creature. : '''''y:''''' Vertical position of where to add creature. ; ''<span style="color:green">game:remove</span>(object)'' : : '''''object:''''' ; ''<span style="color:green">game:remove</span>(npc)'' : : '''''npc:''''' ; ''<span style="color:green">game:addGameEvent</span>(source, event, params)'' : Adds a new {{StendhalFile|master|src/games/stendhal/server/core/engine/GameEvent.java|GameEvent}}. : '''''source:''''' : '''''event:''''' : '''''params:''''' ; ''<span style="color:green">game:setZone</span>(name)'' : Sets the current zone. : '''''name:''''' String identifier for zone to be set as current zone. : ''returns:'' <code>true</code> if zone was successfully set. ; ''<span style="color:green">game:setZone</span>(zone)'' : Sets the current zone. : '''''zone:''''' {{StendhalFile|master|src/games/stendhal/server/core/engine/StendhalRPZone.java|StendhalRPZone}} instance to set as current zone. : ''returns:'' <code>true</code> if zone was successfully set. ; ''<span style="color:green">game:getZone</span>(object)'' : Retrieves the zone where <code>object</code> is located. : '''''object:''''' The {{MarauroaFile|master|src/marauroa/common/game/RPObject.java|RPObject}} from which the zone should be retrieved. : ''returns:'' {{StendhalFile|master|src/games/stendhal/server/core/engine/StendhalRPZone.java|StendhalRPZone}} or <code>null</code> if it doesn't exists ; ''<span style="color:green">game:getZone</span>(name)'' : Retrieves a zone by string ID. : '''''zoneName:''''' Name of zone to retrieve. : ''returns:'' {{StendhalFile|master|src/games/stendhal/server/core/engine/StendhalRPZone.java|StendhalRPZone}} or <code>null</code> if it doesn't exist. ; ''<span style="color:green">game:setMusic</span>(filename, args)'' : Sets the music for the currently selected zone. :; <span style="color:darkgreen; font-style:italic;">filename:</span> :: File basename excluding .ogg extension. :; <span style="color:darkgreen; font-style:italic;">args:</span> :: Lua table of key=value integer values. ::; Valid keys: ::: <span style="color:darkblue; font-style:italic;">volume:</span> Volume level (default: 100). ::: <span style="color:darkblue; font-style:italic;">x:</span> The X coordinate of the sound source (default: 1). ::: <span style="color:darkblue; font-style:italic;">y:</span> The Y coordinate of the sound source (default: 1). ::: <span style="color:darkblue; font-style:italic;">radius:</span> The radius from which the music can be heard (default: 10000). ; ''<span style="color:green">game:playerIsInZone</span>(player, zoneName)'' : : '''''player:''''' : '''''zoneName:''''' : ''returns:'' <code>boolean</code> ; ''<span style="color:green">game:getCreatures</span>()'' : : ''returns:'' An array of all available creatures. ; ''<span style="color:green">game:getCreature</span>(clazz)'' : Retrieves a {{StendhalFile|master|src/games/stendhal/server/entity/creature/Creature.java|Creature}} instance. : '''''clazz:''''' String name of the creature. : ''returns:'' Creature or <code>null</code> if doesn't exist. ; ''<span style="color:green">game:getItems</span>()'' : : ''returns:'' Array list of available items. ; ''<span style="color:green">game:getItem</span>(name)'' : : '''name:''' : ''returns:'' Item instance or <code>null</code> if doesn't exist. ; ''<span style="color:green">game:modify</span>(entity)'' : : '''''entity:''''' ; ''<span style="color:green">game:privateText</span>(player, text)'' : Sends a private text to a player. : '''''player:''''' Player to receive the message. : '''''text:''''' Message text to send to player. ; ''<span style="color:green">game:getMessage</span>()'' : : ''returns:'' <code>String</code>
摘要:
请注意,所有对gamedev的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
Gamedev:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
页面
讨论
不转换
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
查看
阅读
编辑
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息