Rage(PC) Modding Notes   Rage模组制作 指南  二 -------------------------------------------------------------------------------IX.2 Asset/Script Mods 资产/ 脚本 模式-------------------------------------------------------------------------------When you make a map,当你 制作 地图 时the map clearly defines what it needs.地图 清楚地 定义了 它 需要 什么。So when you compile your mod,所以当你编译你的mod时the game knows exactly what models, sounds and even ai declarations to add to the game,游戏 清楚地 知道 什么 模型声音甚至 人工智能声明 添加到 游戏 中but when you write scripts, the game doesnt know....但当你写脚本时游戏不知道..and as a result,结果often times the thing your script needs is not present in memory when you try to access it.通常当您 尝试 访问 脚本所需的内容时内存 中并不存在该 内容。当你制作一个地图时地图清楚地定义了它需要什么。所以当你编译你的mod游戏确切地知道什么模型声音甚至 ai 声明要添加到 游戏中但当你编写脚本时游戏将会出现 不知道…因此你的脚本需要的东西当您试图访问内存时它不存在于内存中。Take this example:举个例子You make an asset mod (No Map) where you edit one of the original games jobsso that it rewards a new item you created..你做了一个资产模式无地图在那里你编辑了一个原始的游戏 jobs 。以便 它 奖励 您 创建的新项目。Your item has a script attached to it that plays a new soundand spawns a new 3d prop in the world using script commands....您的项目 附加了一个脚本用于 播放 新的声音.。并使用脚本命令在世界中生成新的3D道具..您创建 一个资产模型没有地图在那里您 编辑一个原始游戏工作使它奖励你 创建的新项目。您的项目有一个附加的脚本播放 一个新的声音并产生一个新的 3d 使用 脚本 命令。Result:结果.。The inventoryItem and its icon will be included in the mod such that when the job activates,InventoryItem及其图标 将包含在 MOD 中这样当“游戏的job”激活时they will definitely be present in memory.它们 肯定会 出现在 内存 中。The script will also be present,but running it will either not work or may crash the game.脚本 也会到场..但运行它要么不起作用要么可能会使 游戏 崩溃。库存项目 及其 图标将被包括在 模组 中这样当 job 被激活时它们肯定会出现在 内存 中。这个脚本也将出现但运行它将要么不工作要么 可能会让游戏崩溃。WHY:ID Studio knows the script compiled,IDStudio 知道 编译的 脚本but it doesnt know what the script actually does or needs...但它不知道脚本实际上做什么或需要什么。So when it did its dependency trace,.所以当它进行 依赖关系跟踪时it didnt realize it needed to include the new soundand prop because they are only referenced by the script.它没有 意识到 它 需要加入 新的 声音..和prop因为 它们仅由 脚本 引用。ID Studio知道 编译的脚本但它不知道 脚本 是什么 实际上做或需要..。所以当它进行依赖性 跟踪 时它并没有 意识到它需要 包括 新的声音 和道具因为他们是 仅被 脚本 引用。Even if you pointed to existing sounds and props,.即使 你 指出现有的 声音和 道具the script would only workif you were standing in a map that HAPPENED to already contain the model and sound in pre-cache.如果你站在一张地图上而这张 地图 恰好已经包含了预缓存中的 模型 和 声音。脚本 才能 工作。So whether you use items/sounds/resources that came with the gameor new resources you create your own, the problem is the same....因此无论您是否使用 游戏 附带的 物品/声音/资源..或者你 自己创造的 新资源 问题 都是一样的……The optimizing compiler doesnt know you need those things,优化编译器 不知道 你 需要 这些 东西so they will not be in memory when your script tries to use them.因此当 脚本 尝试 使用它们时它们 将 不在内存 中。// 以下 是 以前的 翻译……所以你是否使用游戏附带的物品/声音/资源呢或者是你自己创建的新资源问题也是一样的。这个 优化编译器并不知道你需要这些东西所以他们会需要的当您的脚本尝试使用它们时它们不在内存中。To make things even more confusing...让 事情变得更加 混乱。When you test you scripts in ID STUDIO,当您在 IDStudio 中 测试 脚本 时(maybe within a temporary testing map),.可能在临时测试地图内all game resources are in memory..所有游戏资源都在 内存 中。So you likely will not realize you have a script dependency issue until you try to deploy your modand run it from the actual game.所以你可能不会意识到你有一个脚本依赖问题直到你尝试 部署 你的mod 。并从 实际游戏 中 运行它让事情变得更加混乱..当您使用 ID Studio中测试脚本时..可能在临时测试图内..所有游戏资源都在内存中。....所以你可能不会意识到你有一个脚本依赖问题直到你尝试部署你的mod。并从实际游戏中运行它。让事情更令人困惑。。当您在ID中测试您的脚本时工作室也许是在一个临时的测试地图内所有的游戏资源都是在内存 中。所以您可能不会意识到您有一个脚本依赖性直到你尝试部署你的 mod并从实际的游戏中运行它。This is probably one of the most frustrating things about modding rage..这可能是改变Rage最令人沮丧的事情之一。Scripts assume the programmer will only spawn/use entitiesand items that are already in memorywhen the script runs because ID Studio assumes all mods are map mods.脚本假定程序员只会生成/使用 实体。和已在内存中的项..当脚本运行时因为 ID Studio假设所有的MOD都是地图 MOD。(If it was a map script and you made the map,then you would know what was safe to reference)..如果它是一个 地图脚本并且您 制作了 地图..然后你就会知道什么是 安全的参考。这可能是Rage mod 制作 最令人沮丧的事情之一。脚本假设 程序员 只会 生成/使用 这些实体和项目当脚本运行时已经在内存中因为ID Studio假定所有 模块是地图模块。(如果它是一个地图脚本而你制作了地图那么你就可以完成了我知道什么是安全的参考)。So it is up to you to keep track of what your script spawns/plays andmake sure that those objects are in memory when the script runs.所以它应该由你来跟踪你的脚本产生/播放什么请确保在脚本运行时这些对象都在内存中。Props, sounds, textures:道具、声音、纹理With the exception of AIs (I will get to that in a moment),.除了AIS我马上就会讲到之外you can get around most issues by creating a welcome message (see tutorial above)and rewarding the player by removing items and deployables that link tothe items that your script needs..您可以通过创建欢迎消息请参阅上面的教程来解决大多数问题。并通过移除链接到的物品 和 可部署物品来“奖励”玩家。 脚本所需的项。除了AIs我马上会讲到你可以通过创建一个欢迎消息来解决大多数问题参见上面的教程通过删除项目和可部署来“奖励”玩家脚本所需的项目。So if your script needs to play a sound (existing or not),you need a new hidden inventoryItem with that sound associated with it(maybe a dropSound for example)..因此如果您的 脚本 需要 播放声音存在 或 不存在.。你需要一个新的 隐藏库存项目与 声音 相关联。例如可能是DropSound。因此如果你的脚本需要播放一个声音存在或不存在你就需要一个新的隐藏库存项目与之相关的声音……例如可能是DropSound。The main two settings you want to flip for hidden items are:您 希望“flip”隐藏 项目的 两个 主要 设置 是noPickupMessage : trueplayerCanSeeInInventory : falseYou will also want to mark hidden items as singular..您还需要将 隐藏项目 标记为“单数”。This setting will not prevent items from stacking,此设置不会阻止项目堆叠however it will eliminate all but 1 instance of the item when the player changes maps.然而当玩家 changes其实有时候不知道 具体意思只好引用原文词语 地图时它将消除除1个物品外的所有物品。您还需要将隐藏的项目标记为“单数”。此项设置不会阻止物品的堆叠但它将消除所有的东西吗但当玩家改变地图时该项目的一个实例。Any sounds, props, textures, etc... that the item points to will beloaded into memory when the engine loads the players inventory.任何声音道具纹理等等…项目将的 加载到内存时引擎 加载 玩家库存。If you have a truely global script with no entity attachment,.如果您有一个没有 实体附件 的 真正全局 脚本then you can make the resources globably available by adding thehidden items to the players inventory definition:然后您可以通过添加..玩家库存中的隐藏物品定义如果您有一个真正的全局脚本但没有实体附件那么 您可以通过 添加 隐藏到 玩家库存 定义的 物品decls/entityDef/player - startingInventoryHowever I havent really tested this method..然而我还没有真正测试过这种方法。The welcome message jon is the only method I have proven experience with.欢迎信息Jon是 我 唯一有 经验的 方法。然而我还没有真正测试过这个方法。乔恩收到的欢迎信息是我唯一证明经验的方法。B) AIsAIs (Animated entities such as NPCS) are more complicatedbecause they are not simply a model.AIS动画实体如NPC更加复杂。因为他们不仅仅是一个 模型。They include behaviors, voice tracks, animations,textures, weapon props for their inventory items, etc...它们包括行为、声音轨迹、动画……纹理weapon 道具为他们的库存项目等。AIs动画实体如NPCS更加复杂因为它们 并不仅仅是一个模型。它们包括行为声音轨道动画纹理为他们的库存物品准备的weapon道具等等。A simple item prop can help you get the model mesh in memory,but that is just the tip of the iceburg..一个简单的项目道具 可以帮助你在内存中获得模型网格。但这只是冰山一角。一个简单的项目道具可以帮助你在内存中获得模型网格但那是 就在冰堡的顶端。I did find 1 work around,but it is limited in scope and comes with its own bugs.我确实在附近找到了一些 游戏中的 “处理事项 ”。但它在范围上是 有限的并且有其 自身的缺陷。Rage includes a mind control dart weapon as well as remote control cars.Rage 包括一个 mind control dart weapon 和 remote control cars.When you use these items,you see the player model from the remotely controlled entity..当 你 使用 这些 物品时..您 可以看到来自远程控制实体的 玩家模型。To support this,every map in rage already includes MD6 links to the various player armors.为了支持这一点Rage我自己翻译为 仿徨 中的 每张 地图 都已经 包含了 MD6 链接到 不同的 玩家盔甲。However, the MD6 itself is dynamically loaded at runtime.然而MD6 本身是 在 运行时 动态 加载 的。为了 支持 这一点每张Rage的 地图都已经包含了MD6 链接到各种玩家的盔甲。然而MD6 本身是动态的在运行时 加载。So.. you can edit one of the player outfitsso that it points at a different md6mesh and different animations.所以..你可以编辑其中一个玩家 的装备。以便它指向不同的MD6Mesh和不同的动画。Then your AI can point to the corresponding player MD6 outfit..然后 你的人工智能 可以指向 相应的 玩家MD6 装备。所以..你可以编辑其中一个玩家服装使它指向a 不同的md6网格和不同的动画。然后你的人工智能就可以指向 相应的玩家MD6装备。THis will cause the game to load the model and any associated animationswhen it loads the maps and your script will be able to spawn AIs thatuse the model/animations since they will be in memory.这些功能将导致游戏加载模型和任何相关的动画当它加载地图和你的脚本将能够产生AI的那个使用模型/动画因为它们将在内存中。By the time Rage gives you access to remove control cars,.当 Rage 让你 移除 控制车 的时候you already have to buy a non-ark suit..你已经能够 取得 一套 非方舟的游戏 人物 suit 了。Thus the first 2 arksuit outfits are safe for use..因此前两套Arksuit套装可以安全使用。You could technically use the other outfits as well,.从技术上讲你也可以使用其他装备though you risk a user seeing something unusual when they use the remove control car.尽管 用户在 使用 Remove Control Car 时 可能会看到一些 不寻常的 东西。当“狂怒 ”让你可以 挪离 控制车时 应该是 Rage 游戏中的一个 事件 你已经可以在游戏中 得到 一套非方舟式的 suit了。因此前两套宇航服 使用起来是 安全的。从技术上讲你也可以使用其他服装尽管用户在使用Remove Control Car时可能会看到一些不寻常的东西。-------------------------------------------------------------------------------IX.3 When it fails: 开发运维手册Sometimes a build fails and when this happens you may find thatwhen you try to start up the tool kitthat the menu that appears does not have the ID Studio Link.有时 构建 会失败当这种 情况 发生时您可能会发现.。当你试图 启动 工具箱 时.。出现的菜单没有 “ID Studio”链接。有时一个 构建 失败当这种情况发生时你可能会发现当你尝试启动工具包因为出现的菜单中没有“ID Studio”链接。This is because during the build process,这是因为在构建 过程中。the menu is replaced with a version that does not have the IDSTUDIO link,.菜单被替换为没有 IDStudio 链接的版本as the menu flash program is part of build.因为菜单 flash 程式 是 构建的一部分。When the build fails because of a crash,the menu does not get restored.当 构建因崩溃而失败时.。菜单无法恢复。这是因为在构建过程中菜单会被替换为一个版本没有IDSTUDIO链接因为菜单flash程序的一部分建造当生成因为崩溃而失败时菜单将不会得到 归还Luckily, ID Studio baks up the original menu .swf file..幸运的是ID Studio备份了原始菜单.SWF 文件。You should find it under:.你应该在下面找到它幸运的是ID Studio备份了原始菜单.swf文件。你应该找到它在 下面……Rage Tool Kit/base/swf/Look for any .bak files and manually restore them.If you have version control software installed, it should be obvious..查找任何“.bak”文件并手动 恢复它们..如果您安装了版本控制软件它应该是显而易见的。查找任何“.bak”文件并手动恢复它们。如果你有版本控制软件安装后应该 很明显。X. External Appendix外部附录-------------------------------------------------------------------------------IX.2 Asset/Script Mods 资产/脚本模式-------------------------------------------------------------------------------When you make a map, the map clearly defines what it needs. So when youcompile your mod, the game knows exactly what models, sounds and even aideclarations to add to the game, but when you write scripts, the game doesnt know...and as a result, often times the thing your script needsis not present in memory when you try to access it.当你制作一个地图时地图清楚地定义了它需要什么。所以当你编译你的mod游戏确切地知道什么模型声音甚至 ai声明要添加到游戏中但当你编写脚本时游戏将会出现 不知道…因此你的脚本需要的东西当您试图访问内存时它不存在于内存中。Take this example:You make an asset mod (No Map) where you edit one of the originalgames jobs so that it rewards a new item you created. Your item hasa script attached to it that plays a new sound and spawns a new 3dprop in the world using script commands...您创建一个资产模型没有地图在那里您编辑一个原始游戏工作使它奖励你创建的新项目。您的项目有一个附加的脚本播放一个新的声音并产生一个新的3d使用脚本命令。Result:The inventoryItem and its icon will be included in the mod such thatwhen the job activates, they will definitely be present in memory. Thescript will also be present, but running it will either not work ormay crash the game.库存项目及其图标将被包括在 模组 中这样当job 被激活时它们肯定会出现在 内存 中。这个脚本也将出现但运行它将要么不工作要么可能会让游戏崩溃。WHY:ID Studio knows the script compiled, but it doesnt know what the scriptactually does or needs... So when it did its dependency trace, it didntrealize it needed to include the new sound and prop because they areonly referenced by the script.ID Studio知道编译的脚本但它不知道脚本是什么实际上做或需要..。所以当它进行依赖性跟踪时它并没有意识到它需要包括新的声音和道具因为他们是仅被脚本引用。Even if you pointed to existing sounds and props, the script would onlywork if you were standing in a map that HAPPENED to already contain themodel and sound in pre-cache.即使你指出了现有的声音和道具剧本也只会这么说如果你正站在一张地图上但碰巧已经包含了一个问题预缓存中的模型和声音。So whether you use items/sounds/resources that came with the gameor new resources you create your own, the problem is the same... Theoptimizing compiler doesnt know you need those things, so they willnot be in memory when your script tries to use them.所以你是否使用游戏附带的物品/声音/资源呢或者是你自己创建的新资源问题也是一样的。。这个优化编译器并不知道你需要这些东西所以他们会需要的当您的脚本尝试使用它们时它们不在内存中。To make things even more confusing... When you test you scripts in IDSTUDIO, (maybe within a temporary testing map), all game resources arein memory. So you likely will not realize you have a script dependencyissue until you try to deploy your mod and run it from the actual game.让事情更令人困惑。。当您在ID中测试您的脚本时工作室也许是在一个临时的测试地图内所有的游戏资源都是在记忆中。所以您可能不会意识到您有一个脚本依赖性直到你尝试部署你的 mod并从实际的游戏中运行它。This is probably one of the most frustrating things about modding rage.Scripts assume the programmer will only spawn/use entities and items thatare already in memory when the script runs because ID Studio assumes allmods are map mods. (If it was a map script and you made the map, then youwould know what was safe to reference).这可能是制造愤怒症最令人沮丧的事情之一。脚本假设程序员只会生成/使用这些实体和项目当脚本运行时已经在内存中因为ID Studio假定所有模块是地图模块。(如果它是一个地图脚本而你制作了地图那么你就可以完成了我知道什么是安全的参考)。So it is up to you to keep track of what your script spawns/plays andmake sure that those objects are in memory when the script runs.所以它应该由你来跟踪你的脚本产生/播放什么请确保在脚本运行时这些对象都在内存中。Props, sounds, textures:道具、声音、纹理With the exception of AIs (I will get to that in a moment), you canget around most issues by creating a welcome message (see tutorial above)and rewarding the player by removing items and deployables that link tothe items that your script needs.除了AIs我马上会讲到你可以通过创建一个欢迎消息来解决大多数问题参见上面的教程通过删除项目和可部署来“奖励”玩家脚本所需的项目。So if your script needs to play a sound (existing or not), you needa new hidden inventoryItem with that sound associated with it (maybe adropSound for example).因此如果你的脚本需要播放一个声音存在或不存在你就需要一个新的隐藏库存项目与之相关的声音(可能是a例如DropSound)。The main two settings you want to flip for hidden items are:你想要“翻转”隐藏项目的两个主要设置是:noPickupMessage : trueplayerCanSeeInInventory : falseYou will also want to mark hidden items as singular. This settingwill not prevent items from stacking, however it will eliminate allbut 1 instance of the item when the player changes maps.您还需要将隐藏的项目标记为“单数”。此项设置不会阻止物品的堆叠但它将消除所有的东西吗但当玩家改变地图时该项目的一个实例。Any sounds, props, textures, etc... that the item points to will beloaded into memory when the engine loads the players inventory.任何声音道具纹理等等…项目将的 加载到内存时引擎 加载 玩家库存。If you have a truely global script with no entity attachment, thenyou can make the resources globably available by adding thehidden items to the players inventory definition:如果您有一个真正的全局脚本但没有实体附件那么您可以通过添加 隐藏到 玩家库存定义的物品decls/entityDef/player - startingInventoryHowever I havent really tested this method. The welcome message jon is theonly method I have proven experience with.然而我还没有真正测试过这个方法。乔恩收到的欢迎信息是我唯一证明经验的方法。B) AIsAIs (Animated entities such as NPCS) are more complicated because theyare not simply a model. They include behaviors, voice tracks, animations,textures, weapon props for their inventory items, etc...AIs动画实体如NPCS更加复杂因为它们并不仅仅是一个模型。它们包括行为声音轨道动画纹理为他们的库存物品准备的武器道具等等。A simple item prop can help you get the model mesh in memory, but that isjust the tip of the iceburg.一个简单的项目道具可以帮助你在内存中获得模型网格但那是 就在冰堡的顶端。I did find 1 work around, but it is limited in scope and comes with itsown bugs.我确实找到了一个工作但它的范围有限并附带它自己的错误。Rage includes a mind control dart weapon as well as remote control cars.When you use these items, you see the player model from the remotelycontrolled entity. To support this, every map in rage already includes MD6links to the various player armors. However, the MD6 itself is dynamicallyloaded at runtime.《狂怒》包括一个精神控制飞镖武器 以及 遥控汽车。当你使用这些项目时你可以从 远程 看到 玩家模型 受控 实体。为了支持这一点每张狂怒的地图都已经包含了MD6链接到各种玩家的盔甲。然而MD6本身是动态的在运行时加载。So.. you can edit one of the player outfits so that it points at adifferent md6mesh and different animations. Then your AI can point to thecorresponding player MD6 outfit.所以..你可以编辑其中一个玩家服装使它指向a不同的md6网格和不同的动画。然后你的人工智能就可以指向相应的玩家MD6装备。THis will cause the game to load the model and any associated animationswhen it loads the maps and your script will be able to spawn AIs thatuse the model/animations since they will be in memory.这些功能将导致游戏加载模型和任何相关的动画当它加载地图和你的脚本将能够产生AI的那个使用模型/动画因为它们将在内存中。By the time Rage gives you access to remove control cars, you already haveto buy a non-ark suit. Thus the first 2 arksuit outfits are safe for use.You could technically use the other outfits as well, though you risk auser seeing something unusual when they use the remove control car.游戏中 当“狂怒 ”让你可以删除控制车时你已经有了去买一套非方舟式的西装。因此前两套宇航服使用起来是安全的。从技术上讲你也可以使用其他服装尽管你冒着a用户看到一些不寻常的东西时他们使用的拆卸控制车。-------------------------------------------------------------------------------IX.3 When it fails: 开发运维手册Sometimes a build fails and when this happens you may find that when youtry to start up the tool kit that the menu that appears does not have theID Studio Link.有时一个 构建 失败当这种情况发生时你可能会发现当你尝试启动工具包因为出现的菜单中没有“ID工作室”链接。This is because during the build process, the menu is replaced with a versionthat does not have the IDSTUDIO link, as the menu flash program is part ofbuild. When the build fails because of a crash, the menu does not getrestored.这是因为在构建过程中菜单会被替换为一个版本没有IDSTUDIO链接因为菜单flash程序的一部分建造当生成因为崩溃而失败时菜单将不会得到归还Luckily, ID Studio baks up the original menu .swf file. You should find itunder:幸运的是ID Studio备份了原始菜单.swf文件。你应该找到它在…下面Rage Tool Kit/base/swf/Look for any .bak files and manually restore them. If you have versioncontrol software installed, it should be obvious.查找任何“.bak”文件并手动恢复它们。如果你有版本控制软件安装后应该很明显。X. External Appendix外部附录A) Console Commands:http://docs.google.com/file/d/0B0VAFIuYmSp5WE10cDUtS1A2WVEB) Console Variables 控制台变量http://docs.google.com/file/d/0B0VAFIuYmSp5VkpjRTE0TGdIR0kC) Script Commands and Constants 脚本命令 和 常量http://docs.google.com/file/d/0B0VAFIuYmSp5Ri1SYlNuaGhYb1ED) Script operationshttp://docs.google.com/file/d/0B0VAFIuYmSp5SjlsdFFydVkzaWs