脚本更改后如何重新加载虚幻开发套件
我目前正在学习虚幻脚本。我在 Visual Studio 上创建它们,然后在其中编译它们。我已经用我创建的演员创建了一个关卡。
我遇到的问题是每次对脚本进行更改时,我都会关闭 UDK 并重新打开关卡以查看更改。
有没有办法让UDK重新加载?
i am currently learning unreal scripting. i am creating them on visual studio then compile them in it. I have created a level with the actor i have created.
The problem i have is every time i make changes to the script I am closing the UDK and reopen the level to see the changes.
Is there a way of saying to UDK to reload?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您对脚本进行更改,则需要关闭 UDK.exe 的所有实例,无论是游戏还是编辑器。
以下是使用 .bat 文件运行游戏或编辑器来加速整个过程的工作流程。
C:\UDK\Kel\Binaries\Win32\udk.exe Level01
请注意,Level01 是关卡/地图的名称文件。此 .bat 文件将在该级别运行您的游戏。
接下来,创建另一个名为 run_editor.bat 的 .bat 文件,并将以下文本放入其中:
C:\UDK\Kel\Binaries\Win32\udk.exe editor Level01
通过添加编辑器 > 参数,您要求直接以所需的级别运行编辑器。
复制 C:\Users[您的用户名] 中的两个 .bat 文件以快速访问。
按 Windows + R 打开命令行,然后键入 cmd 并按 Enter 键。键入 run_game 或 run_editor 并按 Enter。
如果您有未编译的代码,系统会询问您是否编译它,所以选择“是”。您还将看到编译期间出现的任何错误或警告,这很有用。如果编译后一切顺利,请按向上键或输入您尝试运行的 .bat 名称,然后按 Enter。
使用上述方法也更快,因为它不需要您在 Visual Studio 中编译脚本。
If you make changes to the script, you need to close any instances of UDK.exe, whether game or editor.
Here is a workflow to speed up the whole process by using .bat files to run the game or editor.
C:\UDK\Kel\Binaries\Win32\udk.exe Level01
Note that Level01 is the name of your level / map file. This .bat file will run your game within that level.
Next, create another .bat file called run_editor.bat and put this text inside:
C:\UDK\Kel\Binaries\Win32\udk.exe editor Level01
By adding the editor parameter, you're asking to run the editor directly with the desired level.
Copy the two .bat files in C:\Users[Your username] for fast access.
Open the command line by pressing Windows + R, then typing cmd and hitting Enter. Type either run_game or run_editor and hit Enter.
If you have uncompiled code, you'll be asked whether to compile it, so say yes. You will also see any errors or warnings that showed up during compile, which is useful. If everything went well after the compile, press the Up key or type in the name of the .bat you are trying to run, and hit Enter.
Using the above method is also faster because it doesn't require you to compile the scripts in Visual Studio.
不幸的是,没有。对 UnrealScript 的更改需要重新编译
.u
文件,并且必须关闭游戏/编辑器,以便删除并重新创建该文件。从你的问题中我不确定你是说每次想要看到更改时都重新打开 UDK 编辑器,还是只是重新打开游戏。如果您只想修改脚本、编译并查看结果(而不修改级别),则不必重新打开编辑器。您只需运行 UDK.exe,按“~”键调出控制台,然后输入
open yourlevelname
即可。或者您可以创建一个运行UDK.exe yourlevelname
的快捷方式以在该级别启动游戏。当然,如果您想生成并到处跑,您需要在关卡中放置一个PlayerStart
。Unfortunately, no. Changes to UnrealScript require recompiling the
.u
file, and the game/editor has to be closed so the file can be deleted and recreated.I'm not sure from your question if you're saying you're reopening the UDK editor every time you want to see the change, or if you're just reopening the game. If you just want to modify the script, compile, and see the result (without modifying the level), you don't have to reopen the editor. You can just run UDK.exe, press the '~' key to bring up the console, and type
open yourlevelname
. Or you can create a shortcut that runsUDK.exe yourlevelname
to start the game on that level. Of course if you want to spawn in and run around, you'll need to put aPlayerStart
in your level.