Thanks for answering my questions Elendil. The fact that scripting in the new game will use Lua sounds very exciting! That will definitely make the creation of expansions in the new game way more interesting I think.
Just to clear it up, what I meant by "function definition" in question 2 is the same as function definition as outlined in
https://www.lua.org/pil/5.html, whereby a new function can be made by giving it a name and body of things it should do. In the Lua example, the function `add`is defined and it takes parameter `a`, adds its contents then returns the result. Can I also do the same in The Quest and use the newly defined function in other parts of the script?
I've also got other issues. First, I tried make a script that contains the line:
- Code: Select all
createmonsterdir("base_mugger3", dir north, 1);
which can't be compiled. The resulting error is:
- Code: Select all
Invalid number of arguments.
createmonsterdir(monstertypeid, dir (north | west |
south | east), distance)
Since that doesn't seem to be the proper way to use `createmonsterdir()`, what is?
Second, when I use the `talknpc()` function, then use the "Buy/Sell" option in the dialogue screen that appears, the game crashes. To see an example of it, load the questworld file
https://www.dropbox.com/s/d7sargpt4p3hz ... world?dl=0 or the pak file
https://www.dropbox.com/s/01k3ufhwooqzl ... d.pak?dl=0 then go to The Void (accessible from the captain in Matras), after arriving, go through the door behind you, choose the "Other shops" dialogue option, select "Ok" which would change the NPC, and then choose the "Buy/Sell" option which would cause the crash. Another way to reproduce this issue is if you choose to go the The Arena, then hit a teleporter using the "Cheap Summoner Staff", the choose the "Buy/Sell" option. Is there any way I can make this work, or will I have to have separate doors for different NPCs?
Third, I can't seem to get the `questionyesno()` function to work properly. I use it in the same expansion above, in the scripts that have names starting with `void_script_mapobj_arena_teleporter_` which are used on the teleporters in the map `void_map_arena`. The "Yes" option works fine and moves the player to the appropriate place, but the "No" option does not cause the dialogue box to disappear as expected. Am I using it improperly? If so, what is the proper way to use it?
Fourth, in the same expansion, I made a shared dialogue topic "The Arena" with the id `void_topic_arena_options`. On one of the scripts, the one with the cond1 "ObjectListResult == 0", there is a section at the bottom that is not functioning as expected:
- Code: Select all
if (choice_0 == "view_distance_change") {
current = getglobal("void_global_arena_view_distance");
message("The current visibility in The Arena is " + (current) + "%.");
message("Change hundreds value:");
createobjectlist("");
addobjecttolist(0, "0");
addobjecttolist(1, "1");
showobjectlist();
setstate(2);
}
I thought that after it runs, the script with the cond1 "StateThis == 2" will run but instead it does not and I'm not sure why. Is there a way to fix it?
Fifth, in the same topic as the one in my fourth issue, the script with the cond1 "StateThis == 1" also doesn't seem to work as expected. When "Yes" is chosen after being asked if the player would like to go back to The Void, the player is not returned to `void_map_void` as expected.
Sixth, when I activate enemy spawning in the arena (by hitting a teleporter with the "Opponent Generator Staff") then move around, enemies spawn when in the editor, but they don't when in game. In the game, I have to sleep first before they appear.